From 4ebe42637fc279c27a1ed7fd2ad436f9b13272de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=82=E4=BD=B3=E4=BF=8A?= Date: Tue, 30 Apr 2024 18:41:23 +0800 Subject: [PATCH 01/14] =?UTF-8?q?[Feature]:=20=E5=88=9B=E5=BB=BA=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=97=B6=EF=BC=8C=E5=88=87=E6=8D=A2=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=97=B6=E8=87=AA=E5=8A=A8=E6=9B=B4=E6=96=B0?= =?UTF-8?q?"=E5=8F=AF=E6=8E=92=E5=BA=8F"=E7=8A=B6=E6=80=81=20#6699?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../object_fields/fields/sortable.field.yml | 1 - .../pages/object_fields_form.page.amis.json | 36 +++++++++++++------ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/services/standard-object-database/main/default/objects/object_fields/fields/sortable.field.yml b/services/standard-object-database/main/default/objects/object_fields/fields/sortable.field.yml index 0f793d9948..34daeb974d 100644 --- a/services/standard-object-database/main/default/objects/object_fields/fields/sortable.field.yml +++ b/services/standard-object-database/main/default/objects/object_fields/fields/sortable.field.yml @@ -1,5 +1,4 @@ name: sortable -defaultValue: true group: Advanced hidden: false label: Sortable diff --git a/services/standard-object-database/main/default/pages/object_fields_form.page.amis.json b/services/standard-object-database/main/default/pages/object_fields_form.page.amis.json index 52bad65345..b77837266c 100644 --- a/services/standard-object-database/main/default/pages/object_fields_form.page.amis.json +++ b/services/standard-object-database/main/default/pages/object_fields_form.page.amis.json @@ -143,15 +143,18 @@ "amis": { "onEvent": { "change": { - "actions": [{ - "actionType": "setValue", - "args": { - "value": { - "defaultValue": null - } - }, - "componentId": "steedos_object_fields_form" - }] + "actions": [ + { + "actionType": "setValue", + "args": { + "value": { + "defaultValue": null, + "sortable": "${ARRAYSOME(allowSort, item => item === event.data.value)}" + } + }, + "componentId": "steedos_object_fields_form" + } + ] } }, "disabledOn": "${is_system == true}", @@ -197,7 +200,20 @@ "tabsMode": "line" }], "data": { - "context": {} + "context": {}, + "allowSort": [ + "text", + "select", + "date", + "datetime", + "time", + "number", + "currency", + "percent", + "autoumber", + "summary", + "formula" + ] }, "onEvent": { "init": { From da91e3eb892fe3bb5f006e0d3ff0744dc7db2b94 Mon Sep 17 00:00:00 2001 From: baozhoutao Date: Mon, 6 May 2024 11:40:03 +0800 Subject: [PATCH 02/14] Update fields.field.yml --- .../main/default/objects/object_webhooks/fields/fields.field.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/services/standard-object-database/main/default/objects/object_webhooks/fields/fields.field.yml b/services/standard-object-database/main/default/objects/object_webhooks/fields/fields.field.yml index 9f77d1e920..a8ac3972f4 100644 --- a/services/standard-object-database/main/default/objects/object_webhooks/fields/fields.field.yml +++ b/services/standard-object-database/main/default/objects/object_webhooks/fields/fields.field.yml @@ -4,6 +4,7 @@ label: Fields multiple: true is_wide: true sort_no: 60 +description: 如果未配置, 则推送所有字段 depend_on: - object_name optionsFunction: !!js/function | From 7f6fe7469961e7600279886884dcaaed2f7a4ce6 Mon Sep 17 00:00:00 2001 From: baozhoutao Date: Mon, 6 May 2024 11:40:33 +0800 Subject: [PATCH 03/14] =?UTF-8?q?webhook=20data=20=E5=94=AF=E4=B8=80?= =?UTF-8?q?=E6=A0=87=E8=AF=86=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/default/services/object_webhooks.service.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/services/standard-object-database/main/default/services/object_webhooks.service.js b/services/standard-object-database/main/default/services/object_webhooks.service.js index 5824b3097a..db0b562c28 100644 --- a/services/standard-object-database/main/default/services/object_webhooks.service.js +++ b/services/standard-object-database/main/default/services/object_webhooks.service.js @@ -2,7 +2,7 @@ * @Author: baozhoutao@steedos.com * @Date: 2024-04-23 14:35:03 * @LastEditors: baozhoutao@steedos.com - * @LastEditTime: 2024-04-26 12:02:56 + * @LastEditTime: 2024-05-06 11:39:14 * @Description: */ @@ -50,7 +50,6 @@ module.exports = { const { url, data } = ctx.params const result = await axios.post(url, data); ctx.locals.job.updateProgress(100) - console.log('====>send', url, data.doc?.name) return result.data; } } @@ -71,14 +70,14 @@ module.exports = { const userSession = await ctx.call('@steedos/service-accounts.getUserSession', {userId, spaceId}) if(userSession){ sender = { - id: userSession.userId, + _id: userSession.userId, username: userSession.username, name: userSession.name, email: userSession.email } space = { - id: userSession.space._id, + _id: userSession.space._id, name: userSession.space.name } } From 0d34a69b4bc0e0e35e55430a83e92064a05cfb57 Mon Sep 17 00:00:00 2001 From: baozhoutao Date: Mon, 6 May 2024 11:46:30 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E5=A4=84=E7=90=86=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/services/object_webhooks.service.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/services/standard-object-database/main/default/services/object_webhooks.service.js b/services/standard-object-database/main/default/services/object_webhooks.service.js index db0b562c28..b107e0c098 100644 --- a/services/standard-object-database/main/default/services/object_webhooks.service.js +++ b/services/standard-object-database/main/default/services/object_webhooks.service.js @@ -2,7 +2,7 @@ * @Author: baozhoutao@steedos.com * @Date: 2024-04-23 14:35:03 * @LastEditors: baozhoutao@steedos.com - * @LastEditTime: 2024-05-06 11:39:14 + * @LastEditTime: 2024-05-06 11:45:46 * @Description: */ @@ -22,22 +22,28 @@ module.exports = { }, events: { "*.inserted": async function(ctx){ - // TODO 校验是否是objectql的记录新增事件. 使用@objectApiName + .inserted 后,与ctx.eventName对比,看是否相同 const { objectApiName, id, spaceId, userId } = ctx.params; + if(ctx.eventName != `@${objectApiName}.inserted`){ + return + } if(objectApiName && id && spaceId){ await this.addQueue(ctx, objectApiName, "create", id, spaceId, userId) } }, "*.updated": async function(ctx){ - // TODO 校验是否是objectql的记录新增事件. 使用@objectApiName + .updated 后,与ctx.eventName对比,看是否相同 const { objectApiName, id, spaceId, userId, previousDoc } = ctx.params; + if(ctx.eventName != `@${objectApiName}.updated`){ + return + } if(objectApiName && id && spaceId){ await this.addQueue(ctx, objectApiName, "update", id, spaceId, userId, previousDoc) } }, "*.deleted": async function(ctx){ - // TODO 校验是否是objectql的记录新增事件. 使用@objectApiName + .deleted 后,与ctx.eventName对比,看是否相同 const { objectApiName, id, spaceId, userId, previousDoc } = ctx.params; + if(ctx.eventName != `@${objectApiName}.deleted`){ + return + } if(objectApiName && id){ await this.addQueue(ctx, objectApiName, "delete", id, spaceId, userId, previousDoc) } From 3781fb4eff7abf6d958e995e460c629c953caba9 Mon Sep 17 00:00:00 2001 From: baozhoutao Date: Mon, 6 May 2024 13:48:05 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E5=A4=84=E7=90=86webhook=20=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E5=AD=97=E6=AE=B5=E6=8F=8F=E8=BF=B0=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/default/pages/object_webhooks_form.page.amis.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/standard-object-database/main/default/pages/object_webhooks_form.page.amis.json b/services/standard-object-database/main/default/pages/object_webhooks_form.page.amis.json index 1099028c61..c91c4583e1 100644 --- a/services/standard-object-database/main/default/pages/object_webhooks_form.page.amis.json +++ b/services/standard-object-database/main/default/pages/object_webhooks_form.page.amis.json @@ -16,7 +16,7 @@ "method": "get", "url": "/service/api/amis-metadata-objects/objects/${object_name}/fields/options", "cache": 30000, - "adaptor": "const visibleOnVariables = SteedosUI.getFormulaVariables(payload.data.options);\n const defaultValueVariables = [visibleOnVariables[1]];\n const variables = [];\n const varItem = {\n label: '对象字段',\n children: _.map(payload.data.options, (item)=>{\n return {\n label: item.label,\n value: item.value\n }\n })\n };\n variables.push(varItem);\n payload.data={label: '准入条件', type:'input-formula', name: 'condition', variables: variables} \n return payload;", + "adaptor": "const field = context.uiSchema.fields.condition; const visibleOnVariables = SteedosUI.getFormulaVariables(payload.data.options);\n const defaultValueVariables = [visibleOnVariables[1]];\n const variables = [];\n const varItem = {\n label: '对象字段',\n children: _.map(payload.data.options, (item)=>{\n return {\n label: item.label,\n value: item.value\n }\n })\n };\n variables.push(varItem);\n payload.data={label: field.label, type:'input-formula', name: 'condition', variables: variables, labelRemark: field.inlineHelpText, description: field.description } \n return payload;", "trackExpression": "${object_name}", "sendOn": "${object_name}" } From f4703370d0483a8a65f5ad6670ec852121901ce4 Mon Sep 17 00:00:00 2001 From: baozhoutao Date: Mon, 6 May 2024 13:48:24 +0800 Subject: [PATCH 06/14] =?UTF-8?q?fix=20[Bug]:=20=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=9A=84=20description=20=EF=BC=8C=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E6=9C=AA=E7=94=9F=E6=95=88=20#6797?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/i18n/src/translations/objectTranslation.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/i18n/src/translations/objectTranslation.ts b/packages/i18n/src/translations/objectTranslation.ts index 88410f527d..f339e6a12e 100644 --- a/packages/i18n/src/translations/objectTranslation.ts +++ b/packages/i18n/src/translations/objectTranslation.ts @@ -271,9 +271,6 @@ const translationListviewLabel = function(lng, objectName, name, def, datasource export const translationObject = function(lng: string, objectName: string, object: StringMap, convert?: boolean, ignoreBase = false){ const cacheKey = getCacherKey(lng, object); - if(objectName === 'test_obj_layout1'){ - console.log('translationObject', objectName, cacheKey) - } const fromCacher = Cacher.get(cacheKey); if(fromCacher){ return Object.assign(object, cloneDeep(fromCacher)); @@ -286,9 +283,8 @@ export const translationObject = function(lng: string, objectName: string, objec object.description = translationObjectDescription(lng, objectName, object.description); _.each(object.fields, function(field, fieldName){ field.label = translationFieldLabel(lng, objectName, fieldName, field.label, object.datasource, ignoreBase); - if(field.inlineHelpText){ - field.inlineHelpText = translationFieldHelp(lng, objectName, fieldName, field.inlineHelpText, object.datasource, ignoreBase) - } + field.inlineHelpText = translationFieldHelp(lng, objectName, fieldName, field.inlineHelpText, object.datasource, ignoreBase) + field.description = translationFieldDescription(lng, objectName, fieldName, field.description, object.datasource, ignoreBase) if(field.group){ field.group = translationFieldGroup(lng, objectName, field.group, field.group, object.datasource, ignoreBase); } From c172a203b4ce8bcf30bd2d16b5cb43e7202c3ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=82=E4=BD=B3=E4=BF=8A?= Date: Mon, 6 May 2024 15:17:24 +0800 Subject: [PATCH 07/14] =?UTF-8?q?[Feature]:=20=E6=94=AF=E6=8C=81=E5=A4=9A?= =?UTF-8?q?=E9=80=89=E7=9A=84lookup=E5=AD=97=E6=AE=B5=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=A1=AB=E5=85=85=E5=8A=9F=E8=83=BD=20#6732?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fields/auto_fill_mapping.$.from.field.yml | 14 ++++++++------ .../fields/auto_fill_mapping.$.to.field.yml | 11 +++++++++++ .../fields/auto_fill_mapping.field.yml | 2 +- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/services/standard-object-database/main/default/objects/object_fields/fields/auto_fill_mapping.$.from.field.yml b/services/standard-object-database/main/default/objects/object_fields/fields/auto_fill_mapping.$.from.field.yml index 4b8cdd0953..e8f42bef45 100644 --- a/services/standard-object-database/main/default/objects/object_fields/fields/auto_fill_mapping.$.from.field.yml +++ b/services/standard-object-database/main/default/objects/object_fields/fields/auto_fill_mapping.$.from.field.yml @@ -4,17 +4,19 @@ depend_on: filtersFunction: ! |- function(filters,values ) { - - + var currentFilter = []; + var referenceObject = BuilderAmisObject && BuilderAmisObject.AmisLib && BuilderAmisObject.AmisLib.getUISchemaSync(values.reference_to); + if (values.multiple) { + currentFilter.push(['multiple', '!=', true]); + } if(values && values.reference_to){ - return ['object', '=', values.reference_to] + currentFilter.push(['object', '=', values.reference_to]); }else{ - return ['_id', '=', 'no'] + currentFilter.push(['_id', '=', 'no']); } - - + return currentFilter; } group: auto_fill hidden: false diff --git a/services/standard-object-database/main/default/objects/object_fields/fields/auto_fill_mapping.$.to.field.yml b/services/standard-object-database/main/default/objects/object_fields/fields/auto_fill_mapping.$.to.field.yml index 8cb471b6b6..d093a2436a 100644 --- a/services/standard-object-database/main/default/objects/object_fields/fields/auto_fill_mapping.$.to.field.yml +++ b/services/standard-object-database/main/default/objects/object_fields/fields/auto_fill_mapping.$.to.field.yml @@ -24,6 +24,17 @@ filtersFunction: ! |- var referenceObject = BuilderAmisObject && BuilderAmisObject.AmisLib && BuilderAmisObject.AmisLib.getUISchemaSync(values.reference_to); var fromField = referenceObject && referenceObject.fields[values.from]; + if (values.multiple) { + if (_.includes(["lookup","master_detail","select"], fromField.type)) { + currentFilter.push(['multiple', '=', true]); + } + }else { + if (fromField.multiple){ + currentFilter.push(['multiple', '=', true]); + } else { + currentFilter.push(['multiple', '!=', true]); + } + } if (fromField && fromField.data_type) { currentFilter.push(['type', 'in', fieldFilters[fromField.data_type] || fromField.data_type.split()]); }else if (fromField) { diff --git a/services/standard-object-database/main/default/objects/object_fields/fields/auto_fill_mapping.field.yml b/services/standard-object-database/main/default/objects/object_fields/fields/auto_fill_mapping.field.yml index b0b5d0497c..241a2bb7b5 100644 --- a/services/standard-object-database/main/default/objects/object_fields/fields/auto_fill_mapping.field.yml +++ b/services/standard-object-database/main/default/objects/object_fields/fields/auto_fill_mapping.field.yml @@ -13,4 +13,4 @@ sort_no: 500 type: table visible_on: >- {{(formData.type === 'lookup' || formData.type === 'master_detail') && - formData.reference_to && !!!formData.multiple}} + formData.reference_to}} From a5ed33f0f8296fbf1575d4bc87cb2f4c149433ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E6=B5=A9=E6=9E=97?= Date: Mon, 6 May 2024 16:47:56 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E5=BD=93=E7=94=B3=E8=AF=B7=E5=8D=95?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E9=9D=9E=E8=8D=89=E7=A8=BF=EF=BC=8C=E4=BD=86?= =?UTF-8?q?=E6=98=AF=E5=9C=A8=E8=8D=89=E7=A8=BF=E7=AE=B1=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/steedos/steedos-project-hbport/issues/688 --- .../steedos-creator/client/router.coffee | 4 ++- .../views/instance/instance_view.coffee | 1 + .../programs/server/packages/modules.js | 26 +++++++++---------- ...c7743e7ee186e9416e9fdc8fd12ef809800f8f.js} | 6 ++--- ...e186e9416e9fdc8fd12ef809800f8f.stats.json} | 12 ++++----- .../programs/web.browser.legacy/program.json | 22 ++++++++-------- ...c7743e7ee186e9416e9fdc8fd12ef809800f8f.js} | 6 ++--- ...e186e9416e9fdc8fd12ef809800f8f.stats.json} | 12 ++++----- .../bundle/programs/web.browser/program.json | 22 ++++++++-------- ...e1fcae915a1de041dcaf88b8709ec3c8773097.js} | 6 ++--- ...5a1de041dcaf88b8709ec3c8773097.stats.json} | 12 ++++----- .../bundle/programs/web.cordova/program.json | 26 +++++++++---------- server/bundle/star.json | 2 +- .../public/tailwind/tailwind-steedos.css | 8 ++++++ 14 files changed, 88 insertions(+), 77 deletions(-) rename server/bundle/programs/web.browser.legacy/{bf9e564fb5bad63a77f21af4189ee0551286f776.js => 44c7743e7ee186e9416e9fdc8fd12ef809800f8f.js} (92%) rename server/bundle/programs/web.browser.legacy/{bf9e564fb5bad63a77f21af4189ee0551286f776.stats.json => 44c7743e7ee186e9416e9fdc8fd12ef809800f8f.stats.json} (99%) rename server/bundle/programs/web.browser/{bf9e564fb5bad63a77f21af4189ee0551286f776.js => 44c7743e7ee186e9416e9fdc8fd12ef809800f8f.js} (92%) rename server/bundle/programs/web.browser/{bf9e564fb5bad63a77f21af4189ee0551286f776.stats.json => 44c7743e7ee186e9416e9fdc8fd12ef809800f8f.stats.json} (99%) rename server/bundle/programs/web.cordova/{770f0114c10012fbbe0f4d4763609665f737e948.js => 06e1fcae915a1de041dcaf88b8709ec3c8773097.js} (92%) rename server/bundle/programs/web.cordova/{770f0114c10012fbbe0f4d4763609665f737e948.stats.json => 06e1fcae915a1de041dcaf88b8709ec3c8773097.stats.json} (99%) diff --git a/creator/packages/steedos-creator/client/router.coffee b/creator/packages/steedos-creator/client/router.coffee index 8fd48ab000..9467f19686 100644 --- a/creator/packages/steedos-creator/client/router.coffee +++ b/creator/packages/steedos-creator/client/router.coffee @@ -281,7 +281,9 @@ objectRoutes.route '/view/:record_id', triggersExit: [ (context, redirect) -> if Session.get("instance_change") && ((context.params?.object_name == 'instances' && context.queryParams?.side_listview_id == 'draft') || (context.params?.object_name == 'instance_tasks' && context.queryParams?.side_listview_id == 'inbox')) - InstanceManager.saveIns(false); + ins = WorkflowManager.getInstance() + if !("draft" != ins.state && "draft" == Session.get("box")) + InstanceManager.saveIns(false); ] objectRoutes.route '/grid/:list_view_id', action: (params, queryParams)-> diff --git a/creator/packages/steedos-workflow/client/views/instance/instance_view.coffee b/creator/packages/steedos-workflow/client/views/instance/instance_view.coffee index 8231198187..fe4a54df63 100644 --- a/creator/packages/steedos-workflow/client/views/instance/instance_view.coffee +++ b/creator/packages/steedos-workflow/client/views/instance/instance_view.coffee @@ -159,6 +159,7 @@ Template.instance_view.onRendered -> # 当申请单在草稿箱,但是申请单的状态不是草稿时,页面切换到草稿箱列表 if "draft" != ins.state && "draft" == Session.get("box") + Session.set("instance_change", false) window.history.back() Tracker.nonreactive ()-> diff --git a/server/bundle/programs/server/packages/modules.js b/server/bundle/programs/server/packages/modules.js index 3f3823fcc3..04d1b35ca3 100644 --- a/server/bundle/programs/server/packages/modules.js +++ b/server/bundle/programs/server/packages/modules.js @@ -463,7 +463,7 @@ module.useNode(); // module.exports = { "name": "@steedos/objectql", - "version": "2.7.1-beta.2", + "version": "2.7.1-beta.7", "main": "lib/index.js" }; @@ -490,7 +490,7 @@ module.useNode(); // module.exports = { "name": "@steedos/i18n", - "version": "2.7.1-beta.2", + "version": "2.7.1-beta.7", "main": "lib/index.js" }; @@ -517,7 +517,7 @@ module.useNode(); // module.exports = { "name": "@steedos/core", - "version": "2.7.1-beta.2", + "version": "2.7.1-beta.7", "main": "lib/index.js" }; @@ -544,7 +544,7 @@ module.useNode(); // module.exports = { "name": "@steedos/service-meteor-package-loader", - "version": "2.7.1-beta.2", + "version": "2.7.1-beta.7", "main": "index.js" }; @@ -571,7 +571,7 @@ module.useNode(); // module.exports = { "name": "@steedos/service-api", - "version": "2.7.1-beta.2", + "version": "2.7.1-beta.7", "main": "index.js" }; @@ -598,7 +598,7 @@ module.useNode(); // module.exports = { "name": "@steedos/service-metadata-server", - "version": "2.7.1-beta.2", + "version": "2.7.1-beta.7", "main": "index.js" }; @@ -625,7 +625,7 @@ module.useNode(); // module.exports = { "name": "@steedos/service-package-registry", - "version": "2.7.1-beta.2", + "version": "2.7.1-beta.7", "main": "package.service.js" }; @@ -652,7 +652,7 @@ module.useNode(); // module.exports = { "name": "@steedos/service-objectql", - "version": "2.7.1-beta.2", + "version": "2.7.1-beta.7", "main": "package.service.js" }; @@ -679,7 +679,7 @@ module.useNode(); // module.exports = { "name": "@steedos/service-ui", - "version": "2.7.1-beta.2", + "version": "2.7.1-beta.7", "main": "package.service.js" }; @@ -706,7 +706,7 @@ module.useNode(); // module.exports = { "name": "@steedos/service-pages", - "version": "2.7.1-beta.2", + "version": "2.7.1-beta.7", "main": "package.service.js" }; @@ -733,7 +733,7 @@ module.useNode(); // module.exports = { "name": "@steedos/router", - "version": "2.7.1-beta.2", + "version": "2.7.1-beta.7", "main": "lib/index.js" }; @@ -760,7 +760,7 @@ module.useNode(); // module.exports = { "name": "@steedos/auth", - "version": "2.7.1-beta.2", + "version": "2.7.1-beta.7", "main": "lib/index.js" }; @@ -787,7 +787,7 @@ module.useNode(); // module.exports = { "name": "@steedos/workflow", - "version": "2.7.1-beta.2", + "version": "2.7.1-beta.7", "main": "index.js" }; diff --git a/server/bundle/programs/web.browser.legacy/bf9e564fb5bad63a77f21af4189ee0551286f776.js b/server/bundle/programs/web.browser.legacy/44c7743e7ee186e9416e9fdc8fd12ef809800f8f.js similarity index 92% rename from server/bundle/programs/web.browser.legacy/bf9e564fb5bad63a77f21af4189ee0551286f776.js rename to server/bundle/programs/web.browser.legacy/44c7743e7ee186e9416e9fdc8fd12ef809800f8f.js index 52de6c9631..ad270c1961 100644 --- a/server/bundle/programs/web.browser.legacy/bf9e564fb5bad63a77f21af4189ee0551286f776.js +++ b/server/bundle/programs/web.browser.legacy/44c7743e7ee186e9416e9fdc8fd12ef809800f8f.js @@ -68,7 +68,7 @@ object-assign * Copyright 2011-2019 Twitter, Inc. * Licensed under the MIT license */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(e){"use strict";var t=e.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1==t[0]&&9==t[1]&&t[2]<1||t[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),function(e){"use strict";function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(void 0!==e.style[n])return{end:t[n]};return!1}e.fn.emulateTransitionEnd=function(t){var n=!1,r=this,i;return e(this).one("bsTransitionEnd",(function(){n=!0})),setTimeout((function(){n||e(r).trigger(e.support.transition.end)}),t),this},e((function(){e.support.transition=t(),e.support.transition&&(e.event.special.bsTransitionEnd={bindType:e.support.transition.end,delegateType:e.support.transition.end,handle:function(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})}))}(jQuery),function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};function r(t){return this.each((function(){var r=e(this),i=r.data("bs.alert");i||r.data("bs.alert",i=new n(this)),"string"==typeof t&&i[t].call(r)}))}n.VERSION="3.4.1",n.TRANSITION_DURATION=150,n.prototype.close=function(t){var r=e(this),i=r.attr("data-target");i||(i=(i=r.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),i="#"===i?[]:i;var o=e(document).find(i);function s(){o.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),o.length||(o=r.closest(".alert")),o.trigger(t=e.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),e.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",s).emulateTransitionEnd(n.TRANSITION_DURATION):s())};var i=e.fn.alert;e.fn.alert=r,e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=i,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}(jQuery),function(e){"use strict";var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r),this.isLoading=!1};function n(n){return this.each((function(){var r=e(this),i=r.data("bs.button"),o="object"==typeof n&&n;i||r.data("bs.button",i=new t(this,o)),"toggle"==n?i.toggle():n&&i.setState(n)}))}t.VERSION="3.4.1",t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(t){var n="disabled",r=this.$element,i=r.is("input")?"val":"html",o=r.data();t+="Text",null==o.resetText&&r.data("resetText",r[i]()),setTimeout(e.proxy((function(){r[i](null==o[t]?this.options[t]:o[t]),"loadingText"==t?(this.isLoading=!0,r.addClass(n).attr(n,n).prop(n,!0)):this.isLoading&&(this.isLoading=!1,r.removeClass(n).removeAttr(n).prop(n,!1))}),this),0)},t.prototype.toggle=function(){var e=!0,t=this.$element.closest('[data-toggle="buttons"]');if(t.length){var n=this.$element.find("input");"radio"==n.prop("type")?(n.prop("checked")&&(e=!1),t.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(e=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),e&&n.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var r=e.fn.button;e.fn.button=n,e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=r,this},e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(t){var r=e(t.target).closest(".btn");n.call(r,"toggle"),e(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),r.is("input,button")?r.trigger("focus"):r.find("input:visible,button:visible").first().trigger("focus"))})).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',(function(t){e(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))}))}(jQuery),function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",e.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",e.proxy(this.pause,this)).on("mouseleave.bs.carousel",e.proxy(this.cycle,this))};function n(n){return this.each((function(){var r=e(this),i=r.data("bs.carousel"),o=e.extend({},t.DEFAULTS,r.data(),"object"==typeof n&&n),s="string"==typeof n?n:o.slide;i||r.data("bs.carousel",i=new t(this,o)),"number"==typeof n?i.to(n):s?i[s]():o.interval&&i.pause().cycle()}))}t.VERSION="3.4.1",t.TRANSITION_DURATION=600,t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},t.prototype.keydown=function(e){if(!/input|textarea/i.test(e.target.tagName)){switch(e.which){case 37:this.prev();break;case 39:this.next();break;default:return}e.preventDefault()}},t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},t.prototype.getItemIndex=function(e){return this.$items=e.parent().children(".item"),this.$items.index(e||this.$active)},t.prototype.getItemForDirection=function(e,t){var n=this.getItemIndex(t),r;if(("prev"==e&&0===n||"next"==e&&n==this.$items.length-1)&&!this.options.wrap)return t;var i,o=(n+("prev"==e?-1:1))%this.$items.length;return this.$items.eq(o)},t.prototype.to=function(e){var t=this,n=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(e>this.$items.length-1||e<0))return this.sliding?this.$element.one("slid.bs.carousel",(function(){t.to(e)})):n==e?this.pause().cycle():this.slide(e>n?"next":"prev",this.$items.eq(e))},t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},t.prototype.next=function(){if(!this.sliding)return this.slide("next")},t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},t.prototype.slide=function(n,r){var i=this.$element.find(".item.active"),o=r||this.getItemForDirection(n,i),s=this.interval,a="next"==n?"left":"right",u=this;if(o.hasClass("active"))return this.sliding=!1;var f=o[0],c=e.Event("slide.bs.carousel",{relatedTarget:f,direction:a});if(this.$element.trigger(c),!c.isDefaultPrevented()){if(this.sliding=!0,s&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=e(this.$indicators.children()[this.getItemIndex(o)]);l&&l.addClass("active")}var h=e.Event("slid.bs.carousel",{relatedTarget:f,direction:a});return e.support.transition&&this.$element.hasClass("slide")?(o.addClass(n),"object"==typeof o&&o.length&&o[0].offsetWidth,i.addClass(a),o.addClass(a),i.one("bsTransitionEnd",(function(){o.removeClass([n,a].join(" ")).addClass("active"),i.removeClass(["active",a].join(" ")),u.sliding=!1,setTimeout((function(){u.$element.trigger(h)}),0)})).emulateTransitionEnd(t.TRANSITION_DURATION)):(i.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(h)),s&&this.cycle(),this}};var r=e.fn.carousel;e.fn.carousel=n,e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=r,this};var i=function(t){var r=e(this),i=r.attr("href");i&&(i=i.replace(/.*(?=#[^\s]+$)/,""));var o=r.attr("data-target")||i,s=e(document).find(o);if(s.hasClass("carousel")){var a=e.extend({},s.data(),r.data()),u=r.attr("data-slide-to");u&&(a.interval=!1),n.call(s,a),u&&s.data("bs.carousel").to(u),t.preventDefault()}};e(document).on("click.bs.carousel.data-api","[data-slide]",i).on("click.bs.carousel.data-api","[data-slide-to]",i),e(window).on("load",(function(){e('[data-ride="carousel"]').each((function(){var t=e(this);n.call(t,t.data())}))}))}(jQuery),function(e){"use strict";var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r),this.$trigger=e('[data-toggle="collapse"][href="#'+n.id+'"],[data-toggle="collapse"][data-target="#'+n.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function n(t){var n,r=t.attr("data-target")||(n=t.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"");return e(document).find(r)}function r(n){return this.each((function(){var r=e(this),i=r.data("bs.collapse"),o=e.extend({},t.DEFAULTS,r.data(),"object"==typeof n&&n);!i&&o.toggle&&/show|hide/.test(n)&&(o.toggle=!1),i||r.data("bs.collapse",i=new t(this,o)),"string"==typeof n&&i[n]()}))}t.VERSION="3.4.1",t.TRANSITION_DURATION=350,t.DEFAULTS={toggle:!0},t.prototype.dimension=function(){var e;return this.$element.hasClass("width")?"width":"height"},t.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var n,i=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(i&&i.length&&(n=i.data("bs.collapse"))&&n.transitioning)){var o=e.Event("show.bs.collapse");if(this.$element.trigger(o),!o.isDefaultPrevented()){i&&i.length&&(r.call(i,"hide"),n||i.data("bs.collapse",null));var s=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[s](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[s](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return a.call(this);var u=e.camelCase(["scroll",s].join("-"));this.$element.one("bsTransitionEnd",e.proxy(a,this)).emulateTransitionEnd(t.TRANSITION_DURATION)[s](this.$element[0][u])}}}},t.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var n=e.Event("hide.bs.collapse");if(this.$element.trigger(n),!n.isDefaultPrevented()){var r=this.dimension();this.$element[r](this.$element[r]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!e.support.transition)return i.call(this);this.$element[r](0).one("bsTransitionEnd",e.proxy(i,this)).emulateTransitionEnd(t.TRANSITION_DURATION)}}},t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},t.prototype.getParent=function(){return e(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(e.proxy((function(t,r){var i=e(r);this.addAriaAndCollapsedClass(n(i),i)}),this)).end()},t.prototype.addAriaAndCollapsedClass=function(e,t){var n=e.hasClass("in");e.attr("aria-expanded",n),t.toggleClass("collapsed",!n).attr("aria-expanded",n)};var i=e.fn.collapse;e.fn.collapse=r,e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=i,this},e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',(function(t){var i=e(this);i.attr("data-target")||t.preventDefault();var o=n(i),s,a=o.data("bs.collapse")?"toggle":i.data();r.call(o,a)}))}(jQuery),function(e){"use strict";var t=".dropdown-backdrop",n='[data-toggle="dropdown"]',r=function(t){e(t).on("click.bs.dropdown",this.toggle)};function i(t){var n=t.attr("data-target");n||(n=(n=t.attr("href"))&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r="#"!==n?e(document).find(n):null;return r&&r.length?r:t.parent()}function o(r){r&&3===r.which||(e(t).remove(),e(n).each((function(){var t=e(this),n=i(t),o={relatedTarget:this};n.hasClass("open")&&(r&&"click"==r.type&&/input|textarea/i.test(r.target.tagName)&&e.contains(n[0],r.target)||(n.trigger(r=e.Event("hide.bs.dropdown",o)),r.isDefaultPrevented()||(t.attr("aria-expanded","false"),n.removeClass("open").trigger(e.Event("hidden.bs.dropdown",o)))))})))}function s(t){return this.each((function(){var n=e(this),i=n.data("bs.dropdown");i||n.data("bs.dropdown",i=new r(this)),"string"==typeof t&&i[t].call(n)}))}r.VERSION="3.4.1",r.prototype.toggle=function(t){var n=e(this);if(!n.is(".disabled, :disabled")){var r=i(n),s=r.hasClass("open");if(o(),!s){"ontouchstart"in document.documentElement&&!r.closest(".navbar-nav").length&&e(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(e(this)).on("click",o);var a={relatedTarget:this};if(r.trigger(t=e.Event("show.bs.dropdown",a)),t.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),r.toggleClass("open").trigger(e.Event("shown.bs.dropdown",a))}return!1}},r.prototype.keydown=function(t){if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)){var r=e(this);if(t.preventDefault(),t.stopPropagation(),!r.is(".disabled, :disabled")){var o=i(r),s=o.hasClass("open");if(!s&&27!=t.which||s&&27==t.which)return 27==t.which&&o.find(n).trigger("focus"),r.trigger("click");var a=" li:not(.disabled):visible a",u=o.find(".dropdown-menu"+a);if(u.length){var f=u.index(t.target);38==t.which&&f>0&&f--,40==t.which&&fdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&e?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!e?this.scrollbarWidth:""})},t.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},t.prototype.checkScrollbar=function(){var e=window.innerWidth;if(!e){var t=document.documentElement.getBoundingClientRect();e=t.right-Math.abs(t.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:i},f.prototype.init=function(t,n,r){if(this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&e(document).find(e.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var i=this.options.trigger.split(" "),o=i.length;o--;){var s=i[o];if("click"==s)this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",u="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(u+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},f.prototype.getDefaults=function(){return f.DEFAULTS},f.prototype.getOptions=function(n){var r=this.$element.data();for(var i in r)r.hasOwnProperty(i)&&-1!==e.inArray(i,t)&&delete r[i];return(n=e.extend({},this.getDefaults(),r,n)).delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),n.sanitize&&(n.template=u(n.template,n.whiteList,n.sanitizeFn)),n},f.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,(function(e,r){n[e]!=r&&(t[e]=r)})),t},f.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusin"==t.type?"focus":"hover"]=!0),n.tip().hasClass("in")||"in"==n.hoverState)n.hoverState="in";else{if(clearTimeout(n.timeout),n.hoverState="in",!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout((function(){"in"==n.hoverState&&n.show()}),n.options.delay.show)}},f.prototype.isInStateTrue=function(){for(var e in this.inState)if(this.inState[e])return!0;return!1},f.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusout"==t.type?"focus":"hover"]=!1),!n.isInStateTrue()){if(clearTimeout(n.timeout),n.hoverState="out",!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout((function(){"out"==n.hoverState&&n.hide()}),n.options.delay.hide)}},f.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var n=e.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!n)return;var r=this,i=this.tip(),o=this.getUID(this.type);this.setContent(),i.attr("id",o),this.$element.attr("aria-describedby",o),this.options.animation&&i.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,u=a.test(s);u&&(s=s.replace(a,"")||"top"),i.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?i.appendTo(e(document).find(this.options.container)):i.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var c=this.getPosition(),l=i[0].offsetWidth,h=i[0].offsetHeight;if(u){var d=s,p=this.getPosition(this.$viewport);s="bottom"==s&&c.bottom+h>p.bottom?"top":"top"==s&&c.top-hp.width?"left":"left"==s&&c.left-ls.top+s.height&&(i.top=s.top+s.height-u)}else{var f=t.left-o,c=t.left+o+n;fs.right&&(i.left=s.left+s.width-c)}return i},f.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)},f.prototype.getUID=function(e){do{e+=~~(1e6*Math.random())}while(document.getElementById(e));return e},f.prototype.tip=function(){if(!this.$tip&&(this.$tip=e(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},f.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},f.prototype.enable=function(){this.enabled=!0},f.prototype.disable=function(){this.enabled=!1},f.prototype.toggleEnabled=function(){this.enabled=!this.enabled},f.prototype.toggle=function(t){var n=this;t&&((n=e(t.currentTarget).data("bs."+this.type))||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n))),t?(n.inState.click=!n.inState.click,n.isInStateTrue()?n.enter(n):n.leave(n)):n.tip().hasClass("in")?n.leave(n):n.enter(n)},f.prototype.destroy=function(){var e=this;clearTimeout(this.timeout),this.hide((function(){e.$element.off("."+e.type).removeData("bs."+e.type),e.$tip&&e.$tip.detach(),e.$tip=null,e.$arrow=null,e.$viewport=null,e.$element=null}))},f.prototype.sanitizeHtml=function(e){return u(e,this.options.whiteList,this.options.sanitizeFn)};var l=e.fn.tooltip;e.fn.tooltip=c,e.fn.tooltip.Constructor=f,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=l,this}}(jQuery),function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");function n(n){return this.each((function(){var r=e(this),i=r.data("bs.popover"),o="object"==typeof n&&n;!i&&/destroy|hide/.test(n)||(i||r.data("bs.popover",i=new t(this,o)),"string"==typeof n&&i[n]())}))}t.VERSION="3.4.1",t.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();if(this.options.html){var r=typeof n;this.options.sanitize&&(t=this.sanitizeHtml(t),"string"===r&&(n=this.sanitizeHtml(n))),e.find(".popover-title").html(t),e.find(".popover-content").children().detach().end()["string"===r?"html":"append"](n)}else e.find(".popover-title").text(t),e.find(".popover-content").children().detach().end().text(n);e.removeClass("fade top bottom left right in"),e.find(".popover-title").html()||e.find(".popover-title").hide()},t.prototype.hasContent=function(){return this.getTitle()||this.getContent()},t.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||("function"==typeof t.content?t.content.call(e[0]):t.content)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var r=e.fn.popover;e.fn.popover=n,e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=r,this}}(jQuery),function(e){"use strict";function t(n,r){this.$body=e(document.body),this.$scrollElement=e(n).is(document.body)?e(window):e(n),this.options=e.extend({},t.DEFAULTS,r),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e.proxy(this.process,this)),this.refresh(),this.process()}function n(n){return this.each((function(){var r=e(this),i=r.data("bs.scrollspy"),o="object"==typeof n&&n;i||r.data("bs.scrollspy",i=new t(this,o)),"string"==typeof n&&i[n]()}))}t.VERSION="3.4.1",t.DEFAULTS={offset:10},t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},t.prototype.refresh=function(){var t=this,n="offset",r=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),e.isWindow(this.$scrollElement[0])||(n="position",r=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map((function(){var t=e(this),i=t.data("target")||t.attr("href"),o=/^#./.test(i)&&e(i);return o&&o.length&&o.is(":visible")&&[[o[n]().top+r,i]]||null})).sort((function(e,t){return e[0]-t[0]})).each((function(){t.offsets.push(this[0]),t.targets.push(this[1])}))},t.prototype.process=function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.getScrollHeight(),n=this.options.offset+t-this.$scrollElement.height(),r=this.offsets,i=this.targets,o=this.activeTarget,s;if(this.scrollHeight!=t&&this.refresh(),e>=n)return o!=(s=i[i.length-1])&&this.activate(s);if(o&&e=r[s]&&(void 0===r[s+1]||e .active"),s=i&&e.support.transition&&(o.length&&o.hasClass("fade")||!!r.find("> .fade").length);function a(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),n.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),s?(n[0].offsetWidth,n.addClass("in")):n.removeClass("fade"),n.parent(".dropdown-menu").length&&n.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}o.length&&s?o.one("bsTransitionEnd",a).emulateTransitionEnd(t.TRANSITION_DURATION):a(),o.removeClass("in")};var r=e.fn.tab;e.fn.tab=n,e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=r,this};var i=function(t){t.preventDefault(),n.call(e(this),"show")};e(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),function(e){"use strict";var t=function(n,r){this.options=e.extend({},t.DEFAULTS,r);var i=this.options.target===t.DEFAULTS.target?e(this.options.target):e(document).find(this.options.target);this.$target=i.on("scroll.bs.affix.data-api",e.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",e.proxy(this.checkPositionWithEventLoop,this)),this.$element=e(n),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function n(n){return this.each((function(){var r=e(this),i=r.data("bs.affix"),o="object"==typeof n&&n;i||r.data("bs.affix",i=new t(this,o)),"string"==typeof n&&i[n]()}))}t.VERSION="3.4.1",t.RESET="affix affix-top affix-bottom",t.DEFAULTS={offset:0,target:window},t.prototype.getState=function(e,t,n,r){var i=this.$target.scrollTop(),o=this.$element.offset(),s=this.$target.height();if(null!=n&&"top"==this.affixed)return i=e-r&&"bottom"},t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var e=this.$target.scrollTop(),n=this.$element.offset();return this.pinnedOffset=n.top-e},t.prototype.checkPositionWithEventLoop=function(){setTimeout(e.proxy(this.checkPosition,this),1)},t.prototype.checkPosition=function(){if(this.$element.is(":visible")){var n=this.$element.height(),r=this.options.offset,i=r.top,o=r.bottom,s=Math.max(e(document).height(),e(document.body).height());"object"!=typeof r&&(o=i=r),"function"==typeof i&&(i=r.top(this.$element)),"function"==typeof o&&(o=r.bottom(this.$element));var a=this.getState(s,n,i,o);if(this.affixed!=a){null!=this.unpin&&this.$element.css("top","");var u="affix"+(a?"-"+a:""),f=e.Event(u+".bs.affix");if(this.$element.trigger(f),f.isDefaultPrevented())return;this.affixed=a,this.unpin="bottom"==a?this.getPinnedOffset():null,this.$element.removeClass(t.RESET).addClass(u).trigger(u.replace("affix","affixed")+".bs.affix")}"bottom"==a&&this.$element.offset({top:s-n-o})}};var r=e.fn.affix;e.fn.affix=n,e.fn.affix.Constructor=t,e.fn.affix.noConflict=function(){return e.fn.affix=r,this},e(window).on("load",(function(){e('[data-spy="affix"]').each((function(){var t=e(this),r=t.data();r.offset=r.offset||{},null!=r.offsetBottom&&(r.offset.bottom=r.offsetBottom),null!=r.offsetTop&&(r.offset.top=r.offsetTop),n.call(t,r)}))}))}(jQuery)}}}},fibers:{"package.json":function e(t,n,e){e.exports={name:"fibers",version:"5.0.3",main:"fibers"}},"fibers.js":function e(t,n,e,r,i){if(process.fiberLib)e.exports=process.fiberLib;else{var o=t("fs"),s=t("path"),a=t("detect-libc");Math.random();var u=s.join(i,"bin",process.platform+"-"+process.arch+"-"+process.versions.modules+("linux"===process.platform?"-"+a.family:""),"fibers");try{process.fiberLib=e.exports=t(u).Fiber}catch(c){throw console.error("## There is an issue with `node-fibers` ##\n`"+u+".node` is missing.\n\nTry running this to fix the issue: "+process.execPath+" "+i.replace(" ","\\ ")+"/build"),console.error(c.stack||c.message||c),new Error("Missing binary. See message above.")}f(e.exports)}function f(e){try{var t=process.binding("async_wrap"),n;if(t.asyncIdStackSize instanceof Function)n=t.asyncIdStackSize;else{if(void 0===t.constants.kStackLength)throw new Error("Couldn't figure out how to get async stack size");l=t.constants.kStackLength,n=function(){return t.async_hook_fields[l]}}var r=t.popAsyncContext||t.popAsyncIds,i=t.pushAsyncContext||t.pushAsyncIds,o,s;if(!r||!i)throw new Error("Push/pop do not exist");o=void 0===t.constants.kExecutionAsyncId?t.constants.kCurrentAsyncId:t.constants.kExecutionAsyncId,s=void 0===t.constants.kTriggerAsyncId?t.constants.kCurrentTriggerId:t.constants.kTriggerAsyncId;var a=t.async_id_fields||t.async_uid_fields;function u(){for(var e=n(),t=new Array(e);e>0;--e){var i=a[o];t[e-1]={asyncId:i,triggerId:a[s]},r(i)}return t}function f(e){for(var t=0;t0)i.changeLanguage(e,r);else if(0!=a[u]){a[u]=0;var f=new XMLHttpRequest;f.overrideMimeType("application/json"),f.open("GET",u,!1),f.send(null),200===f.status?a[u]=1:a[u]=-1,n.addResourceBundle(e,s,JSON.parse(f.response)||{}),i.changeLanguage(e,r)}};n.changeLanguage=p;var g=function(e,t,n){return i.format(e,t,n)};n.format=g;var b=function(){return i.languages};n.getLanguages=b;var m=function(e,t){return i.loadLanguages(e,t)};n.loadLanguages=m;var v=function(e,t){return i.loadNamespaces(e,t)};n.loadNamespaces=v;var y=function(e,t){return i.on(e,t)};n.on=y;var _=function(e,t){return i.off(e,t)};n.off=_,r.__exportStar(t("./i18n/i18n"),n),r.__exportStar(t("./i18n/i18n.app"),n),r.__exportStar(t("./translations"),n)},i18n:{"i18n.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.fallbackKeys=n.getObjectI18nTemplate=n.translationI18nObjects=n.addObjectsI18n=n.translationI18nObject=void 0;var r=t("../index"),i=t("underscore"),o=t("clone"),s="_",a="base",u="core",f="translation",c=function(e,t){var n={lng:t,ns:f};if((0,r.exists)(e,n))return(0,r._t)(e,n)},l=function(e){return"".concat(e,"__object")},h=function(e,t){return t&&(t=t.replace(/\./g,"_")),"".concat(e).concat("_","field").concat("_").concat(t)},d=function(e,t){var n=h(e,t);return"".concat(n).concat("_","inlineHelpText")},p=function(e,t){var n=t.toLocaleLowerCase().replace(/\%/g,"_").replace(/\./g,"_").replace(/\ /g,"_");return"".concat(e).concat("_","group").concat("_").concat(n)},g=function(e,t,n){return t&&(t=t.replace(/\./g,"_")),"".concat(e).concat("_","field").concat("_").concat(t).concat("_","options").concat("_").concat(n)},b=function(e,t){return"".concat(e).concat("_","action").concat("_").concat(t)},m=function(e,t){return"".concat(e).concat("_","listview").concat("_").concat(t)},v=function(e){if(!e)return"";var t="core";return"default"!==e&&"meteor"!==e||(t="base"),t},y=function(e,t,n){var r=l(t);return c(r,e)||n||""},_=function(e,t,n,r,i){var o=h(t,n),s=c(o,e);if(!s){var a=v(i);a&&"base"!=t&&"core"!=t&&(s=_(e,a,n,r,i))}return s||r||""},w=function(e,t,n,r,i){var o=d(t,n),s=c(o,e);if(!s){var a=v(i);a&&"base"!=t&&"core"!=t&&(s=w(e,a,n,r,i))}return s||r||""},k=function(e,t,n,r){var i=p(t,n);return c(i,e)||r||""},j=function(e,t,n,r,i,o){var s=g(t,n,r),a=c(s,e);if(!a){var u=v(o);u&&"base"!=t&&"core"!=t&&(a=j(e,u,n,r,i,o))}return a||i||""},x=function(e,t,n,r,i){var o=b(t,n),s=c(o,e);if(!s){var a=v(i);a&&"base"!=t&&"core"!=t&&(s=x(e,a,n,r,i))}return s||r||""},S=function(e,t,n,r,i){var o=m(t,n),s=c(o,e);if(!s){var a=v(i);a&&"base"!=t&&"core"!=t&&(s=S(e,a,n,r,i))}return s||r||""},D=function(e){var t;return(t=e.split(":")).length>1?{label:t[0],value:t[1]}:{label:t[0],value:t[0]}},E=function(e){i.forEach(e.fields,(function(e,t){var n=[];if(e.options&&i.isString(e.options))try{i.forEach(e.options.split("\n"),(function(e){var t;return e.indexOf(",")?(t=e.split(","),i.forEach(t,(function(e){return n.push(D(e))}))):n.push(D(e))})),e.options=n}catch(r){console.error("convertFieldsOptions error: ",e.options,r)}else e.options&&!i.isFunction(e.options)&&!i.isArray(e.options)&&i.isObject(e.options)&&(i.each(e.options,(function(e,t){return n.push({label:e,value:t})})),e.options=n)}))},A=function(e,t,n){n.label=y(e,t,n.label),i.each(n.fields,(function(r,o){if(r.label=_(e,t,o,r.label,n.datasource),r.inlineHelpText&&(r.inlineHelpText=w(e,t,o,r.inlineHelpText,n.datasource)),r.group&&(r.group=k(e,t,r.group,r.group)),r.options){var s=[];i.each(r.options,(function(r){if(i.has(r,"value")){var a=j(e,t,o,r.value,r.label,n.datasource);s.push(i.extend({},r,{label:a}))}else s.push(r)})),r.options=s}})),i.each(n.actions,(function(r,i){r.label=x(e,t,i,r.label,n.datasource)})),i.each(n.list_views,(function(r,i){r.label=S(e,t,i,r.label,n.datasource)}))};n.translationI18nObject=A;var C=function(e){i.each(e,(function(e){(0,r.addResourceBundle)(e.lng,f,e.data,!0,!0)}))};n.addObjectsI18n=C;var M=function(e,t){i.each(t,(function(t,r){(0,n.translationI18nObject)(e,r,t)}))};n.translationI18nObjects=M;var O=function(e,t,n){var r=o(n);E(r);var s={};return s[l(t)]=y(e,t,r.label),i.each(r.fields,(function(n,o){s[h(t,o)]=_(e,t,o,n.label),n.inlineHelpText&&(s[d(t,o)]=w(e,t,o,n.inlineHelpText,r.datasource)),n.group&&(s[p(t,n.group)]=k(e,t,n.group,n.group)),n.options&&i.each(n.options,(function(n){i.has(n,"value")&&(s[g(t,o,n.value)]=j(e,t,o,n.value,n.label))}))})),i.each(r.actions,(function(n,r){s[b(t,r)]=x(e,t,r,n.label)})),i.each(r.list_views,(function(n,r){s[m(t,r)]=S(e,t,r,n.label)})),s};n.getObjectI18nTemplate=O,n.fallbackKeys={getObjectLabelKey:l,getObjectFieldLabelKey:h,getObjectFieldInlineHelpTextLabelKey:d,getObjectFieldGroupKey:p,getObjectFieldOptionsLabelKey:g,getObjectActionLabelKey:b,getObjectListviewLabelKey:m}},"i18n.app.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.appFallbackKeys=n.getAppI18nTemplate=n.translationI18nApps=n.translationI18nMenus=void 0;var r=t("../index"),i=t("underscore"),o=t("clone"),s="translation",a="_",u=function(e,t){var n={lng:t,ns:s};if((0,r.exists)(e,n))return(0,r._t)(e,n)},f=function(e){return"app".concat("_").concat(e).concat("_","name")},c=function(e){return"app".concat("_").concat(e).concat("_","description")},l=function(e,t){var n=t.toLocaleLowerCase().replace(/\%/g,"_").replace(/\./g,"_").replace(/\ /g,"_");return"".concat(e).concat("_","tab_group").concat("_").concat(n)},h=function(e){return"menu".concat("_").concat(e)},d=function(e){return"tab".concat("_").concat(e)},p=function(e,t,n){var r=f(t);return u(r,e)||n||""},g=function(e,t,n){var r=c(t);return u(r,e)||n||""},b=function(e,t,n){var r=h(t);return u(r,e)||n||""},m=function(e,t,r){r.label=p(e,t,r.label||r.name),r.description=g(e,t,r.description),(0,n.translationI18nMenus)(e,r.admin_menus)},v=function(e,t){i.each(t,(function(t){var n=b(e,t._id,t.label||t.name);t.label=n,t.name=n}))};n.translationI18nMenus=v;var y=function(e,t){i.each(t,(function(t,n){m(e,n,t)}))};n.translationI18nApps=y;var _=function(e,t,n){var r=o(n),s={};return s[f(t)]=p(e,t,r.label||r.name),s[c(t)]=g(e,t,r.description),i.each(r.admin_menus,(function(t){s[h(t._id)]=b(e,t._id,t.label||t.name)})),s};n.getAppI18nTemplate=_,n.appFallbackKeys={getAppLabelKey:f,getAppDescriptionKey:c,getAppGroupKey:l,getMenuLabelKey:h,getTabKey:d}}},translations:{"index.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.SteedosTranslationPrefixKeys=n.convertObject=void 0;var r=t("tslib"),i=t("underscore");r.__exportStar(t("./objectTranslation"),n),r.__exportStar(t("./translation"),n),r.__exportStar(t("./templates/objectTranslation"),n),r.__exportStar(t("./templates/translation"),n);var o=function(e){var t;return(t=e.split(":")).length>1?{label:t[0],value:t[1]}:{label:t[0],value:t[0]}},s=function(e){i.forEach(e.fields,(function(e,t){var n=[];if(e.options&&i.isString(e.options))try{i.forEach(e.options.split("\n"),(function(e){var t;e.indexOf(",")?(t=e.split(","),i.forEach(t,(function(e){return n.push(o(e))}))):n.push(o(e))})),e.options=n}catch(r){console.error("convertFieldsOptions error: ",e.options,r)}else if(e.options&&i.isArray(e.options))try{i.forEach(e.options,(function(e){i.isString(e)?n.push(o(e)):n.push(e)})),e.options=n}catch(r){console.error("Creator.convertFieldsOptions",e.options,r)}else e.options&&!i.isFunction(e.options)&&!i.isArray(e.options)&&i.isObject(e.options)&&(i.each(e.options,(function(e,t){return n.push({label:e,value:t})})),e.options=n)}))},a;n.convertObject=s,function(e){e.Object="CustomObject",e.Field="CustomField",e.Action="CustomAction",e.Listview="CustomListview",e.Permission="CustomPermission",e.ValidationRule="CustomValidationRule",e.Application="CustomApplication",e.Tab="CustomTabs",e.Permissionset="CustomPermissionset",e.Profile="CustomProfile",e.Report="CustomReport",e.Workflow="Workflow",e.Layout="Layout",e.Client="Client",e.Server="Server",e.Function="Function",e.Router="Router",e.Trigger="Trigger"}(a=n.SteedosTranslationPrefixKeys||(n.SteedosTranslationPrefixKeys={}))},"objectTranslation.js":function e(t,n,e,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.addObjectsTranslation=n.getObjectTranslationTemplate=n.translationObjects=n.translationObject=n.translationObjectLabel=void 0;var i=t("underscore"),o=t("./"),s=t("../index"),a=t("./index"),u=t("../i18n/i18n"),f=t("lodash"),c=t("crypto"),l,h=(0,t("@steedos/cachers").getCacher)("lru.translations.objects");function d(e){var t;return c.createHash("md5").update(e).digest("hex")}var p=function(e,t){return"".concat(e,"_").concat(t.name,"_").concat(d(JSON.stringify(t)))},g=t("clone"),b=".",m="base",v="core",y="translation",_="object",w="field",k="listview",j="action",x=function(e,t){var n={lng:t,ns:y,keySeparator:!1};if((0,s.exists)(e,n))return(0,s._t)(e,n)},S=function(e){if(!e)return"";var t="core";return"default"!==e&&"meteor"!==e||(t="base"),t},D=function(e){switch(e){case"object":return o.SteedosTranslationPrefixKeys.Object;case"field":return o.SteedosTranslationPrefixKeys.Field;case"listview":return o.SteedosTranslationPrefixKeys.Listview;case"action":return o.SteedosTranslationPrefixKeys.Action;default:return"CustomLabels"}},E=function(e){var t;return[D(),e].join(".")},A=function(e){var t;return[D("object"),e,"label"].join(".")},C=function(e){var t;return[D("object"),e,"description"].join(".")},M=function(e,t){var n;return t&&(t=t.replace(/\./g,"_")),[D("field"),e,t,"label"].join(".")},O=function(e,t){var n;return t&&(t=t.replace(/\./g,"_")),[D("field"),e,t,"help"].join(".")},T=function(e,t){var n;return t&&(t=t.replace(/\./g,"_")),[D("field"),e,t,"description"].join(".")},B=function(e,t){var n=t.toLocaleLowerCase().replace(/\%/g,"_").replace(/\./g,"_").replace(/\ /g,"_"),r;return[D("field"),e,"group",n].join(".")},I=function(e,t,n){var r;return t&&(t=t.replace(/\./g,"_")),[D("field"),e,t,"options",n].join(".")},R=function(e,t){var n;return[D("action"),e,t].join(".")},F=function(e,t){var n;return[D("listview"),e,t].join(".")},P=function(e,t,n){var r,i=[A(t)],o=u.fallbackKeys.getObjectLabelKey(t);return o&&i.push(o),x(i,e)||n||""};n.translationObjectLabel=P;var N=function(e,t,n){var r=C(t);return x(r,e)||n||""},L=function(e,t,n,r,i,o){var s,a=[M(t,n)],f=u.fallbackKeys.getObjectFieldLabelKey(t,n);f&&a.push(f);var c=x(a,e);if(1!=o&&!c){var l=S(i);l&&"base"!=t&&"core"!=t&&(c=L(e,l,n,r,i))}return c||r||""},z=function(e,t,n,r,i,o){var s,a=[O(t,n)],f=u.fallbackKeys.getObjectFieldInlineHelpTextLabelKey(t,n);f&&a.push(f);var c=x(a,e);if(1!=o&&!c){var l=S(i);l&&"base"!=t&&"core"!=t&&(c=z(e,l,n,r,i))}return c||r||""},U=function(e,t,n,r,i,o){var s=T(t,n),a,u=x([s],e);if(1!=o&&!u){var f=S(i);f&&"base"!=t&&"core"!=t&&(u=U(e,f,n,r,i))}return u||r||""},q=function(e,t,n,r,i,o){var s,a=[B(t,n)],f=u.fallbackKeys.getObjectFieldGroupKey(t,n);f&&a.push(f);var c=x(a,e);if(1!=o&&!c){var l=S(i);l&&"base"!=t&&"core"!=t&&(c=q(e,l,n,r,i))}return c||r||""},$=function(e,t,n,r,i,o,s){var a,f=[I(t,n,r)],c=u.fallbackKeys.getObjectFieldOptionsLabelKey(t,n,r);c&&f.push(c);var l=x(f,e);if(1!=s&&!l){var h=S(o);h&&"base"!=t&&"core"!=t&&(l=$(e,h,n,r,i,o))}return l||i||""},H=function(e,t,n,r,i,o){var s,a=[R(t,n)],f=u.fallbackKeys.getObjectActionLabelKey(t,n);f&&a.push(f);var c=x(a,e);if(1!=o&&!c){var l=S(i);l&&"base"!=t&&"core"!=t&&(c=H(e,l,n,r,i))}return c||r||""},W=function(e,t,n,r,i,o){var s,a=[F(t,n)],f=u.fallbackKeys.getObjectListviewLabelKey(t,n);f&&a.push(f);var c=x(a,e);if(1!=o&&!c){var l=S(i);l&&"base"!=t&&"core"!=t&&(c=W(e,l,n,r,i))}return c||r||""},Y=function(e,t,r,o,s){void 0===s&&(s=!1);var u=p(e,r);"test_obj_layout1"===t&&console.log("translationObject",t,u);var c=h.get(u);if(c)return Object.assign(r,(0,f.cloneDeep)(c));o&&(0,a.convertObject)(r),r.label=(0,n.translationObjectLabel)(e,t,r.label),r.description=N(e,t,r.description),i.each(r.fields,(function(n,o){if(n.label=L(e,t,o,n.label,r.datasource,s),n.inlineHelpText&&(n.inlineHelpText=z(e,t,o,n.inlineHelpText,r.datasource,s)),n.group&&(n.group=q(e,t,n.group,n.group,r.datasource,s)),n.options){var a=[];i.each(n.options,(function(n){if(i.has(n,"value")){var u=$(e,t,o,n.value,n.label,r.datasource,s);a.push(i.extend({},n,{label:u}))}else a.push(n)})),n.options=a}})),i.each(r.actions,(function(n,i){n.label=H(e,t,i,n.label,r.datasource,s)})),i.each(r.list_views,(function(n,i){n.label=W(e,t,i,n.label,r.datasource,s)})),h.set(u,(0,f.cloneDeep)(r))};n.translationObject=Y;var V=function(e,t){i.each(t,(function(t,r){(0,n.translationObject)(e,r,t)}))};n.translationObjects=V;var K=function(e,t,r){var o=g(r);(0,a.convertObject)(o);var s={};return s[A(t)]=(0,n.translationObjectLabel)(e,t,o.label),s[C(t)]=N(e,t,o.description),i.each(o.fields,(function(n,r){s[M(t,r)]=L(e,t,r,n.label),n.inlineHelpText&&(s[O(t,r)]=z(e,t,r,n.inlineHelpText,o.datasource)),n.description&&(s[T(t,r)]=U(e,t,r,n.description,o.datasource)),n.group&&(s[B(t,n.group)]=q(e,t,n.group,n.group,o.datasource)),n.options&&i.each(n.options,(function(n){i.has(n,"value")&&(s[I(t,r,n.value)]=$(e,t,r,n.value,n.label))}))})),i.each(o.actions,(function(n,r){s[R(t,r)]=H(e,t,r,n.label)})),i.each(o.list_views,(function(n,r){s[F(t,r)]=W(e,t,r,n.label)})),s};function G(e,t){var n=g(e);(0,a.convertObject)(n);var r={},o=n.name;return o||console.error("Error: Invalid objectTranslation:"+t),r[A(o)]=n.label,r[C(o)]=n.description,i.each(n.fields,(function(e,t){r[M(o,t)]=e.label,e.help&&(r[O(o,t)]=e.help),e.description&&(r[T(o,t)]=e.description),e.options&&i.each(e.options,(function(e){i.has(e,"value")&&(r[I(o,t,e.value)]=e.label)}))})),i.each(n.groups,(function(e,t){r[B(o,t)]=e})),i.each(n.actions,(function(e,t){r[R(o,t)]=e.label})),i.each(n.listviews,(function(e,t){r[F(o,t)]=e.label})),i.each(n.CustomLabels,(function(e,t){r[E(t)]=e})),r}n.getObjectTranslationTemplate=K;var X=function(e){i.each(e,(function(e){var t=G(e.data,e.__filename);(0,s.addResourceBundle)(e.lng,y,t,!0,!0)}))};n.addObjectsTranslation=X},"translation.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.addTranslations=n.convertTranslation=n.convertTranslationData=n.getAppTranslationTemplate=n.translationApps=n.translationMenus=n.translationApp=n.translationTabLabel=n.translationTabGroup=void 0;var r=t("../index"),i=t("underscore"),o=t("./"),s=t("../i18n/i18n.app"),a=t("clone"),u="translation",f=".",c="app",l="menu",h="tab",d=function(e){switch(e){case"app":return o.SteedosTranslationPrefixKeys.Application;case"tab":return o.SteedosTranslationPrefixKeys.Tab;default:return"CustomLabels"}},p=function(e){var t;return[d(),e].join(".")},g=function(e,t){var n={lng:t,ns:u,keySeparator:!1};if((0,r.exists)(e,n))return(0,r._t)(e,n)},b=function(e){var t;return[d("app"),e,"name"].join(".")},m=function(e){var t;return[d("app"),e,"description"].join(".")},v=function(e,t){var n,r;return[d("app"),e,"groups",t.toLocaleLowerCase().replace(/\%/g,"_").replace(/\./g,"_").replace(/\ /g,"_")].join(".")},y=function(e){var t;return[d("menu"),"menu_".concat(e)].join(".")},_=function(e){var t;return[d("tab"),e].join(".")},w=function(e,t,n){var r,i=[b(t)],o=s.appFallbackKeys.getAppLabelKey(t);return o&&i.push(o),g(i,e)||n||""},k=function(e,t,n){var r,i=[m(t)],o=s.appFallbackKeys.getAppDescriptionKey(t);return o&&i.push(o),g(i,e)||n||""},j=function(e,t,n,r){var i,o=[v(t,n)],a=s.appFallbackKeys.getAppGroupKey(t,n);return a&&o.push(a),g(o,e)||r||""};n.translationTabGroup=j;var x=function(e,t,n){var r,i=[y(t)],o=s.appFallbackKeys.getMenuLabelKey(t);return o&&i.push(o),g(i,e)||n||""},S=function(e,t,n){var r,i=[_(t)],o=s.appFallbackKeys.getTabKey(t);return o&&i.push(o),g(i,e)||n||""};n.translationTabLabel=S;var D=function(e,t,r){r.label=w(e,t,r.label||r.name),r.description=k(e,t,r.description),i.each(r.tab_groups,(function(i,o){r.tab_groups[o].id=i.id||i.group_name,r.tab_groups[o].group_name=(0,n.translationTabGroup)(e,t,i.group_name,i.group_name)})),(0,n.translationMenus)(e,r.admin_menus)};n.translationApp=D;var E=function(e,t){i.each(t,(function(t){var n=x(e,t._id,t.label||t.name);t.label=n,t.name=n}))};n.translationMenus=E;var A=function(e,t){i.each(t,(function(t,r){(0,n.translationApp)(e,r,t)}))};n.translationApps=A;var C=function(e,t,n){var r=a(n),o={};return o[b(t)]=w(e,t,r.label||r.name),o[m(t)]=k(e,t,r.description),i.each(r.admin_menus,(function(t){o[y(t._id)]=x(e,t._id,t.label||t.name)})),o};n.getAppTranslationTemplate=C;var M=function(e,t,n){i.isArray(n)?i.each(n,(function(e){M(e,"",e)})):n&&i.each(i.keys(n),(function(r){var o=t?"".concat(t,".").concat(r):r,s=n[r];"object"==typeof s?i.isArray(s)?i.each(s,(function(e){M(e,o,s)})):M(e,o,s):e[o]=s}))};function O(e){for(var t in e)"object"==typeof e[t]&&M(e,t,e[t]);return e}n.convertTranslationData=O;var T=function(e){var t=a(e),n={};return i.each(t.CustomApplications,(function(e,t){n[b(t)]=e.name,n[m(t)]=e.description,i.each(e.groups,(function(e,r){n[v(t,r)]=e}))})),i.each(t.CustomTabs,(function(e,t){n[_(t)]=e})),i.each(t.CustomLabels,(function(e,t){var r;if("simpleschema"!=t&&i.isObject(e)){var o=O(((r={})[t]=e,r));i.each(o,(function(e,t){i.isObject(e)||(n[p(t)]=e)}))}else n[p(t)]=e})),n};n.convertTranslation=T;var B=function(e){i.each(e,(function(e){var t=(0,n.convertTranslation)(e.data);(0,r.addResourceBundle)(e.lng,u,t,!0,!0)}))};n.addTranslations=B},templates:{"objectTranslation.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getObjectMetadataTranslationTemplate=void 0;var r=t("underscore"),i=t("../index"),o=t("clone");function s(e,t){var n={};return r.each(e,(function(e){n[e]="help"===e?t.inlineHelpText||"":t[e]||""})),n}function a(e){return s(["label","description"],e)}function u(e){switch(e.type){case"select":return s(["label","help","options","description"],e);default:return s(["label","help","description"],e)}}function f(e){return s(["label"],e)}function c(e){return s(["label"],e)}function l(e){var t={};return r.each(e,(function(e,n){t[n]=u(e)})),t}function h(e){var t={};return r.each(e,(function(e,n){t[n]=c(e)})),t}function d(e){var t={};return r.each(e,(function(e,n){t[n]=f(e)})),t}function p(e,t){var n={};return r.each(e,(function(e,r){if(e.group){var i=e.group.toLocaleLowerCase().replace(/\%/g,"_").replace(/\./g,"_").replace(/\ /g,"_");n[i]=t[r].group}})),n}var g=function(e,t,n,s){void 0===s&&(s=!1);var u=o(n);1!=s&&(0,i.translationObject)(e,t,u,!0,s);var f=Object.assign({},a(u));f=Object.assign({},f,{fields:l(u.fields)});var c=p(n.fields,u.fields);r.isEmpty(c)||(f=Object.assign({},f,{groups:c}));var g=d(u.list_views);r.isEmpty(g)||(f=Object.assign({},f,{listviews:g}));var b=h(u.actions);return r.isEmpty(b)||(f=Object.assign({},f,{actions:b})),Object.assign({name:t},f)};n.getObjectMetadataTranslationTemplate=g},"translation.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getAppMetadataTranslationTemplate=void 0;var r=t("underscore"),i=t("../index"),o=t("clone");function s(e,t){var n={};return r.each(e,(function(e){n[e]=t[e]||""})),n}function a(e){var t={groups:{}};return e?(r.each(e,(function(e){var n=e.group_name.toLocaleLowerCase().replace(/\%/g,"_").replace(/\./g,"_").replace(/\ /g,"_");t.groups[n]=e.group_name})),t):{}}var u=function(e){return Object.assign({},s(["name","description"],e),a(e.tab_groups))},f=function(e){var t={};return r.each(e,(function(e,n){t[n]=n})),t},c=function(e){var t={};return r.each(e,(function(e){var n=e.toLocaleLowerCase().replace(/\%/g,"_").replace(/\./g,"_").replace(/\ /g,"_");t[n]=e})),t},l=function(e,t,n){var r,s=o(n);(0,i.translationApp)(e,t,s);var a={},l;return s.tab_items?a=f(s.tab_items):s.tabs&&(a=c(s.tabs)),Object.assign({},{CustomApplications:(r={},r[t]=u(s),r)},{CustomTabs:a})};n.getAppMetadataTranslationTemplate=l}}}},node_modules:{i18next:{"package.json":function e(t,n,e){e.exports={name:"i18next",version:"19.9.2",module:"./dist/esm/i18next.js",main:"./dist/cjs/i18next.js"}},dist:{esm:{"i18next.js":function e(t,n,e){let r,i,o,s,a,u,f,c;e.link("@babel/runtime/helpers/esm/typeof",{default(e){r=e}},0),e.link("@babel/runtime/helpers/esm/objectSpread",{default(e){i=e}},1),e.link("@babel/runtime/helpers/esm/classCallCheck",{default(e){o=e}},2),e.link("@babel/runtime/helpers/esm/createClass",{default(e){s=e}},3),e.link("@babel/runtime/helpers/esm/possibleConstructorReturn",{default(e){a=e}},4),e.link("@babel/runtime/helpers/esm/getPrototypeOf",{default(e){u=e}},5),e.link("@babel/runtime/helpers/esm/assertThisInitialized",{default(e){f=e}},6),e.link("@babel/runtime/helpers/esm/inherits",{default(e){c=e}},7);var l={type:"logger",log:function e(t){this.output("log",t)},warn:function e(t){this.output("warn",t)},error:function e(t){this.output("error",t)},output:function e(t,n){console&&console[t]&&console[t].apply(console,n)}},h,d=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this.init(t,n)}return s(e,[{key:"init",value:function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||l,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function e(t){this.debug=t}},{key:"log",value:function e(){for(var t=arguments.length,n=new Array(t),r=0;r1?n-1:0),i=1;i-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function y(e,t,n){var r=v(e,t,Object),i,o;r.obj[r.k]=n}function _(e,t,n,r){var i=v(e,t,Object),o=i.obj,s=i.k;o[s]=o[s]||[],r&&(o[s]=o[s].concat(n)),r||o[s].push(n)}function w(e,t){var n=v(e,t),r=n.obj,i=n.k;if(r)return r[i]}function k(e,t,n){var r=w(e,n);return void 0!==r?r:w(t,n)}function j(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):j(e[r],t[r],n):e[r]=t[r]);return e}function x(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var S={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function D(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return S[e]})):e}var E="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,A=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return o(this,t),n=a(this,u(t).call(this)),E&&p.call(f(n)),n.data=e||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return c(t,e),s(t,[{key:"addNamespaces",value:function e(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function e(t){var n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}},{key:"getResource",value:function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,s=[t,n];return r&&"string"!=typeof r&&(s=s.concat(r)),r&&"string"==typeof r&&(s=s.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(s=t.split(".")),w(this.data,s)}},{key:"addResource",value:function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},s=this.options.keySeparator;void 0===s&&(s=".");var a=[t,n];r&&(a=a.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(i=n,n=(a=t.split("."))[1]),this.addNamespaces(n),y(this.data,a,i),o.silent||this.emit("added",t,n,r,i)}},{key:"addResources",value:function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in r)"string"!=typeof r[o]&&"[object Array]"!==Object.prototype.toString.apply(r[o])||this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}},{key:"addResourceBundle",value:function e(t,n,r,o,s){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},u=[t,n];t.indexOf(".")>-1&&(o=r,r=n,n=(u=t.split("."))[1]),this.addNamespaces(n);var f=w(this.data,u)||{};o?j(f,r,s):f=i({},f,r),y(this.data,u,f),a.silent||this.emit("added",t,n,r)}},{key:"removeResourceBundle",value:function e(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}},{key:"hasResourceBundle",value:function e(t,n){return void 0!==this.getResource(t,n)}},{key:"getResourceBundle",value:function e(t,n){return n||(n=this.options.defaultNS),"v1"===this.options.compatibilityAPI?i({},{},this.getResource(t,n)):this.getResource(t,n)}},{key:"getDataByLanguage",value:function e(t){return this.data[t]}},{key:"toJSON",value:function e(){return this.data}}]),t}(p),C={processors:{},addPostProcessor:function e(t){this.processors[t.name]=t},handle:function e(t,n,r,i,o){var s=this;return t.forEach((function(e){s.processors[e]&&(n=s.processors[e].process(n,r,i,o))})),n}},M={},O=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o(this,t),n=a(this,u(t).call(this)),E&&p.call(f(n)),m(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,f(n)),n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=d.create("translator"),n}return c(t,e),s(t,[{key:"changeLanguage",value:function e(t){t&&(this.language=t)}},{key:"exists",value:function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},r=this.resolve(t,n);return r&&void 0!==r.res}},{key:"extractFromKey",value:function e(t,n){var r=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");var i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=n.ns||this.options.defaultNS;if(r&&t.indexOf(r)>-1){var s=t.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:t,namespaces:o};var a=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(a[0])>-1)&&(o=a.shift()),t=a.join(i)}return"string"==typeof o&&(o=[o]),{key:t,namespaces:o}}},{key:"translate",value:function e(n,o,s){var a=this;if("object"!==r(o)&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),null==n)return"";Array.isArray(n)||(n=[String(n)]);var u=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,f=this.extractFromKey(n[n.length-1],o),c=f.key,l=f.namespaces,h=l[l.length-1],d=o.lng||this.language,p=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(p){var g=o.nsSeparator||this.options.nsSeparator;return h+g+c}return c}var b=this.resolve(n,o),m=b&&b.res,v=b&&b.usedKey||c,y=b&&b.exactUsedKey||c,_=Object.prototype.toString.apply(m),w=["[object Number]","[object Function]","[object RegExp]"],k=void 0!==o.joinArrays?o.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject,x="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(j&&m&&x&&w.indexOf(_)<0&&("string"!=typeof k||"[object Array]"!==_)){if(!o.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,m,o):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");if(u){var S="[object Array]"===_,D=S?[]:{},E=S?y:v;for(var A in m)if(Object.prototype.hasOwnProperty.call(m,A)){var C="".concat(E).concat(u).concat(A);D[A]=this.translate(C,i({},o,{joinArrays:!1,ns:l})),D[A]===C&&(D[A]=m[A])}m=D}}else if(j&&"string"==typeof k&&"[object Array]"===_)(m=m.join(k))&&(m=this.extendTranslation(m,n,o,s));else{var M=!1,O=!1,T=void 0!==o.count&&"string"!=typeof o.count,B=t.hasDefaultValue(o),I=T?this.pluralResolver.getSuffix(d,o.count):"",R=o["defaultValue".concat(I)]||o.defaultValue;!this.isValidLookup(m)&&B&&(M=!0,m=R),this.isValidLookup(m)||(O=!0,m=c);var F=B&&R!==m&&this.options.updateMissing;if(O||M||F){if(this.logger.log(F?"updateKey":"missingKey",d,h,c,F?R:m),u){var P=this.resolve(c,i({},o,{keySeparator:!1}));P&&P.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var N=[],L=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if("fallback"===this.options.saveMissingTo&&L&&L[0])for(var z=0;z1&&void 0!==arguments[1]?arguments[1]:{},i,o,s,a,u;return"string"==typeof t&&(t=[t]),t.forEach((function(e){if(!n.isValidLookup(i)){var t=n.extractFromKey(e,r),f=t.key;o=f;var c=t.namespaces;n.options.fallbackNS&&(c=c.concat(n.options.fallbackNS));var l=void 0!==r.count&&"string"!=typeof r.count,h=void 0!==r.context&&"string"==typeof r.context&&""!==r.context,d=r.lngs?r.lngs:n.languageUtils.toResolveHierarchy(r.lng||n.language,r.fallbackLng);c.forEach((function(e){n.isValidLookup(i)||(u=e,!M["".concat(d[0],"-").concat(e)]&&n.utils&&n.utils.hasLoadedNamespace&&!n.utils.hasLoadedNamespace(u)&&(M["".concat(d[0],"-").concat(e)]=!0,n.logger.warn('key "'.concat(o,'" for languages "').concat(d.join(", "),'" won\'t get resolved as namespace "').concat(u,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach((function(t){if(!n.isValidLookup(i)){a=t;var o=f,u=[o],c,d;if(n.i18nFormat&&n.i18nFormat.addLookupKeys)n.i18nFormat.addLookupKeys(u,f,t,e,r);else l&&(c=n.pluralResolver.getSuffix(t,r.count)),l&&h&&u.push(o+c),h&&u.push(o+="".concat(n.options.contextSeparator).concat(r.context)),l&&u.push(o+=c);for(;d=u.pop();)n.isValidLookup(i)||(s=d,i=n.getResource(t,e,d,r))}})))}))}})),{res:i,usedKey:o,exactUsedKey:s,usedLng:a,usedNS:u}}},{key:"isValidLookup",value:function e(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}},{key:"getResource",value:function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}}],[{key:"hasDefaultValue",value:function e(t){var n="defaultValue";for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&void 0!==t[r])return!0;return!1}}]),t}(p);function T(e){return e.charAt(0).toUpperCase()+e.slice(1)}var B=function(){function e(t){o(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=d.create("languageUtils")}return s(e,[{key:"getScriptPartFromCode",value:function e(t){if(!t||t.indexOf("-")<0)return null;var n=t.split("-");return 2===n.length?null:(n.pop(),"x"===n[n.length-1].toLowerCase()?null:this.formatLanguageCode(n.join("-")))}},{key:"getLanguagePartFromCode",value:function e(t){if(!t||t.indexOf("-")<0)return t;var n=t.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function e(t){if("string"==typeof t&&t.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],r=t.split("-");return this.options.lowerCaseLng?r=r.map((function(e){return e.toLowerCase()})):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=T(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=T(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=T(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isWhitelisted",value:function e(t){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(t)}},{key:"isSupportedCode",value:function e(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function e(t){var n=this,r;return t?(t.forEach((function(e){if(!r){var t=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(t)||(r=t)}})),!r&&this.options.supportedLngs&&t.forEach((function(e){if(!r){var t=n.getLanguagePartFromCode(e);if(n.isSupportedCode(t))return r=t;r=n.options.supportedLngs.find((function(e){if(0===e.indexOf(t))return e}))}})),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r):null}},{key:"getFallbackCodes",value:function e(t,n){if(!t)return[];if("function"==typeof t&&(t=t(n)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!n)return t.default||[];var r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}},{key:"toResolveHierarchy",value:function e(t,n){var r=this,i=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],s=function e(t){t&&(r.isSupportedCode(t)?o.push(t):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&s(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&s(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&s(this.getLanguagePartFromCode(t))):"string"==typeof t&&s(this.formatLanguageCode(t)),i.forEach((function(e){o.indexOf(e)<0&&s(r.formatLanguageCode(e))})),o}}]),e}(),I=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],R={1:function e(t){return Number(t>1)},2:function e(t){return Number(1!=t)},3:function e(t){return 0},4:function e(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function e(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function e(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function e(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function e(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function e(t){return Number(t>=2)},10:function e(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function e(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function e(t){return Number(t%10!=1||t%100==11)},13:function e(t){return Number(0!==t)},14:function e(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function e(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function e(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function e(t){return Number(1==t||t%10==1&&t%100!=11?0:1)},18:function e(t){return Number(0==t?0:1==t?1:2)},19:function e(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function e(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function e(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function e(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}};function F(){var e={};return I.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:R[t.fc]}}))})),e}var P=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this.languageUtils=t,this.options=n,this.logger=d.create("pluralResolver"),this.rules=F()}return s(e,[{key:"addRule",value:function e(t,n){this.rules[t]=n}},{key:"getRule",value:function e(t){return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function e(t){var n=this.getRule(t);return n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function e(t,n){return this.getSuffixes(t).map((function(e){return n+e}))}},{key:"getSuffixes",value:function e(t){var n=this,r=this.getRule(t);return r?r.numbers.map((function(e){return n.getSuffix(t,e)})):[]}},{key:"getSuffix",value:function e(t,n){var r=this,i=this.getRule(t);if(i){var o=i.noAbs?i.plurals(n):i.plurals(Math.abs(n)),s=i.numbers[o];this.options.simplifyPluralSuffix&&2===i.numbers.length&&1===i.numbers[0]&&(2===s?s="plural":1===s&&(s=""));var a=function e(){return r.options.prepend&&s.toString()?r.options.prepend+s.toString():s.toString()};return"v1"===this.options.compatibilityJSON?1===s?"":"number"==typeof s?"_plural_".concat(s.toString()):a():"v2"===this.options.compatibilityJSON?a():this.options.simplifyPluralSuffix&&2===i.numbers.length&&1===i.numbers[0]?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: ".concat(t)),""}}]),e}(),N=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e),this.logger=d.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return s(e,[{key:"init",value:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var n=t.interpolation;this.escape=void 0!==n.escape?n.escape:D,this.escapeValue=void 0===n.escapeValue||n.escapeValue,this.useRawValueToEscape=void 0!==n.useRawValueToEscape&&n.useRawValueToEscape,this.prefix=n.prefix?x(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?x(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?x(n.nestingPrefix):n.nestingPrefixEscaped||x("$t("),this.nestingSuffix=n.nestingSuffix?x(n.nestingSuffix):n.nestingSuffixEscaped||x(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=void 0!==n.alwaysFormat&&n.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function e(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function e(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(n,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function e(t,n,r,i){var o=this,s,a,u,f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var l=function e(t){if(t.indexOf(o.formatSeparator)<0){var s=k(n,f,t);return o.alwaysFormat?o.format(s,void 0,r):s}var a=t.split(o.formatSeparator),u=a.shift().trim(),c=a.join(o.formatSeparator).trim();return o.format(k(n,f,u),c,r,i)};this.resetRegExp();var h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,d=i&&i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,p;return[{regex:this.regexpUnescape,safeValue:function e(t){return c(t)}},{regex:this.regexp,safeValue:function e(t){return o.escapeValue?c(o.escape(t)):c(t)}}].forEach((function(e){for(u=0;s=e.regex.exec(t);){if(void 0===(a=l(s[1].trim())))if("function"==typeof h){var n=h(t,s,i);a="string"==typeof n?n:""}else{if(d){a=s[0];continue}o.logger.warn("missed to pass in variable ".concat(s[1]," for interpolating ").concat(t)),a=""}else"string"==typeof a||o.useRawValueToEscape||(a=b(a));if(t=t.replace(s[0],e.safeValue(a)),e.regex.lastIndex=0,++u>=o.maxReplaces)break}})),t}},{key:"nest",value:function e(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s,a,u=i({},o);function f(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),o="{".concat(r[1]);e=r[0],o=(o=this.interpolate(o,u)).replace(/'/g,'"');try{u=JSON.parse(o),t&&(u=i({},t,u))}catch(s){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),s),"".concat(e).concat(n).concat(o)}return delete u.defaultValue,e}for(u.applyPostProcessor=!1,delete u.defaultValue;s=this.nestingRegexp.exec(t);){var c=[],l=!1;if(s[0].includes(this.formatSeparator)&&!/{.*}/.test(s[1])){var h=s[1].split(this.formatSeparator).map((function(e){return e.trim()}));s[1]=h.shift(),c=h,l=!0}if((a=n(f.call(this,s[1].trim(),u),u))&&s[0]===t&&"string"!=typeof a)return a;"string"!=typeof a&&(a=b(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(t)),a=""),l&&(a=c.reduce((function(e,t){return r.format(e,t,o.lng,o)}),a.trim())),t=t.replace(s[0],a),this.regexp.lastIndex=0}return t}}]),e}();function L(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}var z=function(e){function t(e,n,r){var i,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return o(this,t),i=a(this,u(t).call(this)),E&&p.call(f(i)),i.backend=e,i.store=n,i.services=r,i.languageUtils=r.languageUtils,i.options=s,i.logger=d.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,s.backend,s),i}return c(t,e),s(t,[{key:"queueLoad",value:function e(t,n,r,i){var o=this,s=[],a=[],u=[],f=[];return t.forEach((function(e){var t=!0;n.forEach((function(n){var i="".concat(e,"|").concat(n);!r.reload&&o.store.hasResourceBundle(e,n)?o.state[i]=2:o.state[i]<0||(1===o.state[i]?a.indexOf(i)<0&&a.push(i):(o.state[i]=1,t=!1,a.indexOf(i)<0&&a.push(i),s.indexOf(i)<0&&s.push(i),f.indexOf(n)<0&&f.push(n)))})),t||u.push(e)})),(s.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:i}),{toLoad:s,pending:a,toLoadLanguages:u,toLoadNamespaces:f}}},{key:"loaded",value:function e(t,n,r){var i=t.split("|"),o=i[0],s=i[1];n&&this.emit("failedLoading",o,s,n),r&&this.store.addResourceBundle(o,s,r),this.state[t]=n?-1:2;var e={};this.queue.forEach((function(r){_(r.loaded,[o],s),L(r.pending,t),n&&r.errors.push(n),0!==r.pending.length||r.done||(Object.keys(r.loaded).forEach((function(t){e[t]||(e[t]=[]),r.loaded[t].length&&r.loaded[t].forEach((function(n){e[t].indexOf(n)<0&&e[t].push(n)}))})),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())})),this.emit("loaded",e),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function e(t,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return t.length?this.backend[r](t,n,(function(e,u){e&&u&&o<5?setTimeout((function(){i.read.call(i,t,n,r,o+1,2*s,a)}),s):a(e,u)})):a(null,{})}},{key:"prepareLoading",value:function e(t,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof n&&(n=[n]);var s=this.queueLoad(t,n,i,o);if(!s.toLoad.length)return s.pending.length||o(),null;s.toLoad.forEach((function(e){r.loadOne(e)}))}},{key:"load",value:function e(t,n,r){this.prepareLoading(t,n,{},r)}},{key:"reload",value:function e(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}},{key:"loadOne",value:function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=t.split("|"),o=i[0],s=i[1];this.read(o,s,"read",void 0,void 0,(function(e,i){e&&n.logger.warn("".concat(r,"loading namespace ").concat(s," for language ").concat(o," failed"),e),!e&&i&&n.logger.log("".concat(r,"loaded namespace ").concat(s," for language ").concat(o),i),n.loaded(t,e,i)}))}},{key:"saveMissing",value:function e(t,n,r,o,s){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)?this.logger.warn('did not save key "'.concat(r,'" as the namespace "').concat(n,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=r&&""!==r&&(this.backend&&this.backend.create&&this.backend.create(t,n,r,o,null,i({},a,{isUpdate:s})),t&&t[0]&&this.store.addResource(t[0],n,r,o))}}]),t}(p);function U(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function e(t){var n={};if("object"===r(t[1])&&(n=t[1]),"string"==typeof t[1]&&(n.defaultValue=t[1]),"string"==typeof t[2]&&(n.tDescription=t[2]),"object"===r(t[2])||"object"===r(t[3])){var i=t[3]||t[2];Object.keys(i).forEach((function(e){n[e]=i[e]}))}return n},interpolation:{escapeValue:!0,format:function e(t,n,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function q(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function $(){}var H,W=new(function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(o(this,t),e=a(this,u(t).call(this)),E&&p.call(f(e)),e.options=q(n),e.services={},e.logger=d,e.modules={external:[]},r&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,r),a(e,f(e));setTimeout((function(){e.init(n,r)}),0)}return e}return c(t,e),s(t,[{key:"init",value:function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;function o(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof n&&(r=n,n={}),n.whitelist&&!n.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),n.nonExplicitWhitelist&&!n.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=i({},U(),this.options,q(n)),this.format=this.options.interpolation.format,r||(r=$),!this.options.isClone){this.modules.logger?d.init(o(this.modules.logger),this.options):d.init(null,this.options);var s=new B(this.options);this.store=new A(this.options.resources,this.options);var a=this.services;a.logger=d,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new P(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),a.interpolator=new N(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new z(o(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1?n-1:0),i=1;i0&&"dev"!==u[0]&&(this.options.lng=u[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var f=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];f.forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments)}}));var c=["addResource","addResources","addResourceBundle","removeResourceBundle"];c.forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments),t}}));var l=g(),h=function e(){var n=function e(n,i){t.isInitialized&&t.logger.warn("init: i18next is already initialized. You should call init just once!"),t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),l.resolve(i),r(n,i)};if(t.languages&&"v1"!==t.options.compatibilityAPI&&!t.isInitialized)return n(null,t.t.bind(t));t.changeLanguage(t.options.lng,n)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),l}},{key:"loadResources",value:function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$,i=r,o="string"==typeof t?t:this.language;if("function"==typeof t&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return i();var s=[],a=function e(t){var r;t&&n.services.languageUtils.toResolveHierarchy(t).forEach((function(e){s.indexOf(e)<0&&s.push(e)}))};if(o)a(o);else{var u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.forEach((function(e){return a(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return a(e)})),this.services.backendConnector.load(s,this.options.ns,i)}else i(null)}},{key:"reloadResources",value:function e(t,n,r){var i=g();return t||(t=this.languages),n||(n=this.options.ns),r||(r=$),this.services.backendConnector.reload(t,n,(function(e){i.resolve(),r(e)})),i}},{key:"use",value:function e(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&C.addPostProcessor(t),"3rdParty"===t.type&&this.modules.external.push(t),this}},{key:"changeLanguage",value:function e(t,n){var r=this;this.isLanguageChangingTo=t;var i=g();this.emit("languageChanging",t);var o=function e(t,o){o?(r.language=o,r.languages=r.services.languageUtils.toResolveHierarchy(o),r.translator.changeLanguage(o),r.isLanguageChangingTo=void 0,r.emit("languageChanged",o),r.logger.log("languageChanged",o)):r.isLanguageChangingTo=void 0,i.resolve((function(){return r.t.apply(r,arguments)})),n&&n(t,(function(){return r.t.apply(r,arguments)}))},s=function e(t){var n="string"==typeof t?t:r.services.languageUtils.getBestMatchFromCodes(t);n&&(r.language||(r.language=n,r.languages=r.services.languageUtils.toResolveHierarchy(n)),r.translator.language||r.translator.changeLanguage(n),r.services.languageDetector&&r.services.languageDetector.cacheUserLanguage(n)),r.loadResources(n,(function(e){o(e,n)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(s):s(t):s(this.services.languageDetector.detect()),i}},{key:"getFixedT",value:function e(t,n){var o=this,s=function e(t,n){var s;if("object"!==r(n)){for(var a=arguments.length,u=new Array(a>2?a-2:0),f=2;f1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var i=this.languages[0],o=!!this.options&&this.options.fallbackLng,s=this.languages[this.languages.length-1];if("cimode"===i.toLowerCase())return!0;var a=function e(t,r){var i=n.services.backendConnector.state["".concat(t,"|").concat(r)];return-1===i||2===i};if(r.precheck){var u=r.precheck(this,a);if(void 0!==u)return u}return!!this.hasResourceBundle(i,t)||(!this.services.backendConnector.backend||!(!a(i,t)||o&&!a(s,t)))}},{key:"loadNamespaces",value:function e(t,n){var r=this,i=g();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((function(e){r.options.ns.indexOf(e)<0&&r.options.ns.push(e)})),this.loadResources((function(e){i.resolve(),n&&n(e)})),i):(n&&n(),Promise.resolve())}},{key:"loadLanguages",value:function e(t,n){var r=g();"string"==typeof t&&(t=[t]);var i=this.options.preload||[],o=t.filter((function(e){return i.indexOf(e)<0}));return o.length?(this.options.preload=i.concat(o),this.loadResources((function(e){r.resolve(),n&&n(e)})),r):(n&&n(),Promise.resolve())}},{key:"dir",value:function e(t){return t||(t=this.languages&&this.languages.length>0?this.languages[0]:this.language),t?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr":"rtl";var n}},{key:"createInstance",value:function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new t(n,r)}},{key:"cloneInstance",value:function e(){var n=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$,s=i({},this.options,r,{isClone:!0}),a=new t(s),u=["store","services","language"];return u.forEach((function(e){a[e]=n[e]})),a.services=i({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new O(a.services,a.options),a.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;rr,root:()=>i,ArrayProto:()=>o,ObjProto:()=>s,SymbolProto:()=>a,push:()=>u,slice:()=>f,toString:()=>c,hasOwnProperty:()=>l,supportsArrayBuffer:()=>h,supportsDataView:()=>d,nativeIsArray:()=>p,nativeKeys:()=>g,nativeCreate:()=>b,nativeIsView:()=>m,_isNaN:()=>v,_isFinite:()=>y,hasEnumBug:()=>_,nonEnumerableProps:()=>w,MAX_ARRAY_INDEX:()=>k});var r="1.13.4",i="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},o=Array.prototype,s=Object.prototype,a="undefined"!=typeof Symbol?Symbol.prototype:null,u=o.push,f=o.slice,c=s.toString,l=s.hasOwnProperty,h="undefined"!=typeof ArrayBuffer,d="undefined"!=typeof DataView,p=Array.isArray,g=Object.keys,b=Object.create,m=h&&ArrayBuffer.isView,v=isNaN,y=isFinite,_=!{toString:null}.propertyIsEnumerable("toString"),w=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],k=Math.pow(2,53)-1},"restArguments.js":function e(t,n,e){function r(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;ir})},"isObject.js":function e(t,n,e){function r(e){var t=typeof e;return"function"===t||"object"===t&&!!e}e.export({default:()=>r})},"isNull.js":function e(t,n,e){function r(e){return null===e}e.export({default:()=>r})},"isUndefined.js":function e(t,n,e){function r(e){return void 0===e}e.export({default:()=>r})},"isBoolean.js":function e(t,n,e){let r;function i(e){return!0===e||!1===e||"[object Boolean]"===r.call(e)}e.export({default:()=>i}),e.link("./_setup.js",{toString(e){r=e}},0)},"isElement.js":function e(t,n,e){function r(e){return!(!e||1!==e.nodeType)}e.export({default:()=>r})},"isString.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("String"))},"_tagTester.js":function e(t,n,e){let r;function i(e){var t="[object "+e+"]";return function(e){return r.call(e)===t}}e.export({default:()=>i}),e.link("./_setup.js",{toString(e){r=e}},0)},"isNumber.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("Number"))},"isDate.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("Date"))},"isRegExp.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("RegExp"))},"isError.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("Error"))},"isSymbol.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("Symbol"))},"isArrayBuffer.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("ArrayBuffer"))},"isDataView.js":function e(t,n,e){let r,i,o,s;e.link("./_tagTester.js",{default(e){r=e}},0),e.link("./isFunction.js",{default(e){i=e}},1),e.link("./isArrayBuffer.js",{default(e){o=e}},2),e.link("./_stringTagBug.js",{hasStringTagBug(e){s=e}},3);var a=r("DataView");function u(e){return null!=e&&i(e.getInt8)&&o(e.buffer)}e.exportDefault(s?u:a)},"isFunction.js":function e(t,n,e){let r,i;e.link("./_tagTester.js",{default(e){r=e}},0),e.link("./_setup.js",{root(e){i=e}},1);var o=r("Function"),s=i.document&&i.document.childNodes;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof s&&(o=function(e){return"function"==typeof e||!1}),e.exportDefault(o)},"_stringTagBug.js":function e(t,n,e){let r,i;e.export({hasStringTagBug:()=>o,isIE11:()=>s}),e.link("./_setup.js",{supportsDataView(e){r=e}},0),e.link("./_hasObjectTag.js",{default(e){i=e}},1);var o=r&&i(new DataView(new ArrayBuffer(8))),s="undefined"!=typeof Map&&i(new Map)},"_hasObjectTag.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("Object"))},"isArray.js":function e(t,n,e){let r,i;e.link("./_setup.js",{nativeIsArray(e){r=e}},0),e.link("./_tagTester.js",{default(e){i=e}},1),e.exportDefault(r||i("Array"))},"isArguments.js":function e(t,n,e){let r,i;e.link("./_tagTester.js",{default(e){r=e}},0),e.link("./_has.js",{default(e){i=e}},1);var o=r("Arguments");!function(){o(arguments)||(o=function(e){return i(e,"callee")})}(),e.exportDefault(o)},"_has.js":function e(t,n,e){let r;function i(e,t){return null!=e&&r.call(e,t)}e.export({default:()=>i}),e.link("./_setup.js",{hasOwnProperty(e){r=e}},0)},"isFinite.js":function e(t,n,e){let r,i;function o(e){return!i(e)&&r(e)&&!isNaN(parseFloat(e))}e.export({default:()=>o}),e.link("./_setup.js",{_isFinite(e){r=e}},0),e.link("./isSymbol.js",{default(e){i=e}},1)},"isNaN.js":function e(t,n,e){let r,i;function o(e){return i(e)&&r(e)}e.export({default:()=>o}),e.link("./_setup.js",{_isNaN(e){r=e}},0),e.link("./isNumber.js",{default(e){i=e}},1)},"isTypedArray.js":function e(t,n,e){let r,i,o,s,a,u;e.link("./_setup.js",{supportsArrayBuffer(e){r=e},nativeIsView(e){i=e},toString(e){o=e}},0),e.link("./isDataView.js",{default(e){s=e}},1),e.link("./constant.js",{default(e){a=e}},2),e.link("./_isBufferLike.js",{default(e){u=e}},3);var f=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function c(e){return i?i(e)&&!s(e):u(e)&&f.test(o.call(e))}e.exportDefault(r?c:a(!1))},"constant.js":function e(t,n,e){function r(e){return function(){return e}}e.export({default:()=>r})},"_isBufferLike.js":function e(t,n,e){let r,i;e.link("./_createSizePropertyCheck.js",{default(e){r=e}},0),e.link("./_getByteLength.js",{default(e){i=e}},1),e.exportDefault(r(i))},"_createSizePropertyCheck.js":function e(t,n,e){let r;function i(e){return function(t){var n=e(t);return"number"==typeof n&&n>=0&&n<=r}}e.export({default:()=>i}),e.link("./_setup.js",{MAX_ARRAY_INDEX(e){r=e}},0)},"_getByteLength.js":function e(t,n,e){let r;e.link("./_shallowProperty.js",{default(e){r=e}},0),e.exportDefault(r("byteLength"))},"_shallowProperty.js":function e(t,n,e){function r(e){return function(t){return null==t?void 0:t[e]}}e.export({default:()=>r})},"isEmpty.js":function e(t,n,e){let r,i,o,s,a;function u(e){if(null==e)return!0;var t=r(e);return"number"==typeof t&&(i(e)||o(e)||s(e))?0===t:0===r(a(e))}e.export({default:()=>u}),e.link("./_getLength.js",{default(e){r=e}},0),e.link("./isArray.js",{default(e){i=e}},1),e.link("./isString.js",{default(e){o=e}},2),e.link("./isArguments.js",{default(e){s=e}},3),e.link("./keys.js",{default(e){a=e}},4)},"_getLength.js":function e(t,n,e){let r;e.link("./_shallowProperty.js",{default(e){r=e}},0),e.exportDefault(r("length"))},"keys.js":function e(t,n,e){let r,i,o,s,a;function u(e){if(!r(e))return[];if(i)return i(e);var t=[];for(var n in e)s(e,n)&&t.push(n);return o&&a(e,t),t}e.export({default:()=>u}),e.link("./isObject.js",{default(e){r=e}},0),e.link("./_setup.js",{nativeKeys(e){i=e},hasEnumBug(e){o=e}},1),e.link("./_has.js",{default(e){s=e}},2),e.link("./_collectNonEnumProps.js",{default(e){a=e}},3)},"_collectNonEnumProps.js":function e(t,n,e){let r,i,o,s;function a(e){for(var t={},n=e.length,r=0;ru}),e.link("./_setup.js",{nonEnumerableProps(e){r=e},ObjProto(e){i=e}},0),e.link("./isFunction.js",{default(e){o=e}},1),e.link("./_has.js",{default(e){s=e}},2)},"isMatch.js":function e(t,n,e){let r;function i(e,t){var n=r(t),i=n.length;if(null==e)return!i;for(var o=Object(e),s=0;si}),e.link("./keys.js",{default(e){r=e}},0)},"isEqual.js":function e(t,n,e){let r,i,o,s,a,u,f,c,l,h,d;e.export({default:()=>m}),e.link("./underscore.js",{default(e){r=e}},0),e.link("./_setup.js",{toString(e){i=e},SymbolProto(e){o=e}},1),e.link("./_getByteLength.js",{default(e){s=e}},2),e.link("./isTypedArray.js",{default(e){a=e}},3),e.link("./isFunction.js",{default(e){u=e}},4),e.link("./_stringTagBug.js",{hasStringTagBug(e){f=e}},5),e.link("./isDataView.js",{default(e){c=e}},6),e.link("./keys.js",{default(e){l=e}},7),e.link("./_has.js",{default(e){h=e}},8),e.link("./_toBufferView.js",{default(e){d=e}},9);var p="[object DataView]";function g(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var i=typeof e;return("function"===i||"object"===i||"object"==typeof t)&&b(e,t,n,r)}function b(e,t,n,m){e instanceof r&&(e=e._wrapped),t instanceof r&&(t=t._wrapped);var v=i.call(e);if(v!==i.call(t))return!1;if(f&&"[object Object]"==v&&c(e)){if(!c(t))return!1;v=p}switch(v){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return o.valueOf.call(e)===o.valueOf.call(t);case"[object ArrayBuffer]":case p:return b(d(e),d(t),n,m)}var y="[object Array]"===v;if(!y&&a(e)){var _;if(s(e)!==s(t))return!1;if(e.buffer===t.buffer&&e.byteOffset===t.byteOffset)return!0;y=!0}if(!y){if("object"!=typeof e||"object"!=typeof t)return!1;var w=e.constructor,k=t.constructor;if(w!==k&&!(u(w)&&w instanceof w&&u(k)&&k instanceof k)&&"constructor"in e&&"constructor"in t)return!1}m=m||[];for(var j=(n=n||[]).length;j--;)if(n[j]===e)return m[j]===t;if(n.push(e),m.push(t),y){if((j=e.length)!==t.length)return!1;for(;j--;)if(!g(e[j],t[j],n,m))return!1}else{var x=l(e),S;if(j=x.length,l(t).length!==j)return!1;for(;j--;)if(S=x[j],!h(t,S)||!g(e[S],t[S],n,m))return!1}return n.pop(),m.pop(),!0}function m(e,t){return g(e,t)}},"underscore.js":function e(t,n,e){let r;function i(e){return e instanceof i?e:this instanceof i?void(this._wrapped=e):new i(e)}e.export({default:()=>i}),e.link("./_setup.js",{VERSION(e){r=e}},0),i.VERSION=r,i.prototype.value=function(){return this._wrapped},i.prototype.valueOf=i.prototype.toJSON=i.prototype.value,i.prototype.toString=function(){return String(this._wrapped)}},"_toBufferView.js":function e(t,n,e){let r;function i(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,r(e))}e.export({default:()=>i}),e.link("./_getByteLength.js",{default(e){r=e}},0)},"isMap.js":function e(t,n,e){let r,i,o,s;e.link("./_tagTester.js",{default(e){r=e}},0),e.link("./_stringTagBug.js",{isIE11(e){i=e}},1),e.link("./_methodFingerprint.js",{ie11fingerprint(e){o=e},mapMethods(e){s=e}},2),e.exportDefault(i?o(s):r("Map"))},"_methodFingerprint.js":function e(t,n,e){let r,i,o;function s(e){var t=r(e);return function(n){if(null==n)return!1;var s=o(n);if(r(s))return!1;for(var u=0;us,mapMethods:()=>l,weakMapMethods:()=>h,setMethods:()=>d}),e.link("./_getLength.js",{default(e){r=e}},0),e.link("./isFunction.js",{default(e){i=e}},1),e.link("./allKeys.js",{default(e){o=e}},2);var a="forEach",u="has",f=["clear","delete"],c=["get","has","set"],l=f.concat(a,c),h=f.concat(c),d=["add"].concat(f,a,"has")},"allKeys.js":function e(t,n,e){let r,i,o;function s(e){if(!r(e))return[];var t=[];for(var n in e)t.push(n);return i&&o(e,t),t}e.export({default:()=>s}),e.link("./isObject.js",{default(e){r=e}},0),e.link("./_setup.js",{hasEnumBug(e){i=e}},1),e.link("./_collectNonEnumProps.js",{default(e){o=e}},2)},"isWeakMap.js":function e(t,n,e){let r,i,o,s;e.link("./_tagTester.js",{default(e){r=e}},0),e.link("./_stringTagBug.js",{isIE11(e){i=e}},1),e.link("./_methodFingerprint.js",{ie11fingerprint(e){o=e},weakMapMethods(e){s=e}},2),e.exportDefault(i?o(s):r("WeakMap"))},"isSet.js":function e(t,n,e){let r,i,o,s;e.link("./_tagTester.js",{default(e){r=e}},0),e.link("./_stringTagBug.js",{isIE11(e){i=e}},1),e.link("./_methodFingerprint.js",{ie11fingerprint(e){o=e},setMethods(e){s=e}},2),e.exportDefault(i?o(s):r("Set"))},"isWeakSet.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("WeakSet"))},"values.js":function e(t,n,e){let r;function i(e){for(var t=r(e),n=t.length,i=Array(n),o=0;oi}),e.link("./keys.js",{default(e){r=e}},0)},"pairs.js":function e(t,n,e){let r;function i(e){for(var t=r(e),n=t.length,i=Array(n),o=0;oi}),e.link("./keys.js",{default(e){r=e}},0)},"invert.js":function e(t,n,e){let r;function i(e){for(var t={},n=r(e),i=0,o=n.length;ii}),e.link("./keys.js",{default(e){r=e}},0)},"functions.js":function e(t,n,e){let r;function i(e){var t=[];for(var n in e)r(e[n])&&t.push(n);return t.sort()}e.export({default:()=>i}),e.link("./isFunction.js",{default(e){r=e}},0)},"extend.js":function e(t,n,e){let r,i;e.link("./_createAssigner.js",{default(e){r=e}},0),e.link("./allKeys.js",{default(e){i=e}},1),e.exportDefault(r(i))},"_createAssigner.js":function e(t,n,e){function r(e,t){return function(n){var r=arguments.length;if(t&&(n=Object(n)),r<2||null==n)return n;for(var i=1;ir})},"extendOwn.js":function e(t,n,e){let r,i;e.link("./_createAssigner.js",{default(e){r=e}},0),e.link("./keys.js",{default(e){i=e}},1),e.exportDefault(r(i))},"defaults.js":function e(t,n,e){let r,i;e.link("./_createAssigner.js",{default(e){r=e}},0),e.link("./allKeys.js",{default(e){i=e}},1),e.exportDefault(r(i,!0))},"create.js":function e(t,n,e){let r,i;function o(e,t){var n=r(e);return t&&i(n,t),n}e.export({default:()=>o}),e.link("./_baseCreate.js",{default(e){r=e}},0),e.link("./extendOwn.js",{default(e){i=e}},1)},"_baseCreate.js":function e(t,n,e){let r,i;function o(){return function(){}}function s(e){if(!r(e))return{};if(i)return i(e);var t=function(){};t.prototype=e;var n=new t;return t.prototype=null,n}e.export({default:()=>s}),e.link("./isObject.js",{default(e){r=e}},0),e.link("./_setup.js",{nativeCreate(e){i=e}},1)},"clone.js":function e(t,n,e){let r,i,o;function s(e){return r(e)?i(e)?e.slice():o({},e):e}e.export({default:()=>s}),e.link("./isObject.js",{default(e){r=e}},0),e.link("./isArray.js",{default(e){i=e}},1),e.link("./extend.js",{default(e){o=e}},2)},"tap.js":function e(t,n,e){function r(e,t){return t(e),e}e.export({default:()=>r})},"get.js":function e(t,n,e){let r,i,o;function s(e,t,n){var s=i(e,r(t));return o(s)?n:s}e.export({default:()=>s}),e.link("./_toPath.js",{default(e){r=e}},0),e.link("./_deepGet.js",{default(e){i=e}},1),e.link("./isUndefined.js",{default(e){o=e}},2)},"_toPath.js":function e(t,n,e){let r;function i(e){return r.toPath(e)}e.export({default:()=>i}),e.link("./underscore.js",{default(e){r=e}},0),e.link("./toPath.js")},"toPath.js":function e(t,n,e){let r,i;function o(e){return i(e)?e:[e]}e.export({default:()=>o}),e.link("./underscore.js",{default(e){r=e}},0),e.link("./isArray.js",{default(e){i=e}},1),r.toPath=o},"_deepGet.js":function e(t,n,e){function r(e,t){for(var n=t.length,r=0;rr})},"has.js":function e(t,n,e){let r,i;function o(e,t){for(var n=(t=i(t)).length,o=0;oo}),e.link("./_has.js",{default(e){r=e}},0),e.link("./_toPath.js",{default(e){i=e}},1)},"mapObject.js":function e(t,n,e){let r,i;function o(e,t,n){t=r(t,n);for(var o=i(e),s=o.length,a={},u=0;uo}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./keys.js",{default(e){i=e}},1)},"_cb.js":function e(t,n,e){let r,i,o;function s(e,t,n){return r.iteratee!==o?r.iteratee(e,t):i(e,t,n)}e.export({default:()=>s}),e.link("./underscore.js",{default(e){r=e}},0),e.link("./_baseIteratee.js",{default(e){i=e}},1),e.link("./iteratee.js",{default(e){o=e}},2)},"_baseIteratee.js":function e(t,n,e){let r,i,o,s,a,u,f;function c(e,t,n){return null==e?r:i(e)?f(e,t,n):o(e)&&!s(e)?a(e):u(e)}e.export({default:()=>c}),e.link("./identity.js",{default(e){r=e}},0),e.link("./isFunction.js",{default(e){i=e}},1),e.link("./isObject.js",{default(e){o=e}},2),e.link("./isArray.js",{default(e){s=e}},3),e.link("./matcher.js",{default(e){a=e}},4),e.link("./property.js",{default(e){u=e}},5),e.link("./_optimizeCb.js",{default(e){f=e}},6)},"identity.js":function e(t,n,e){function r(e){return e}e.export({default:()=>r})},"matcher.js":function e(t,n,e){let r,i;function o(e){return e=r({},e),function(t){return i(t,e)}}e.export({default:()=>o}),e.link("./extendOwn.js",{default(e){r=e}},0),e.link("./isMatch.js",{default(e){i=e}},1)},"property.js":function e(t,n,e){let r,i;function o(e){return e=i(e),function(t){return r(t,e)}}e.export({default:()=>o}),e.link("./_deepGet.js",{default(e){r=e}},0),e.link("./_toPath.js",{default(e){i=e}},1)},"_optimizeCb.js":function e(t,n,e){function r(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)}}return function(){return e.apply(t,arguments)}}e.export({default:()=>r})},"iteratee.js":function e(t,n,e){let r,i;function o(e,t){return i(e,t,1/0)}e.export({default:()=>o}),e.link("./underscore.js",{default(e){r=e}},0),e.link("./_baseIteratee.js",{default(e){i=e}},1),r.iteratee=o},"noop.js":function e(t,n,e){function r(){}e.export({default:()=>r})},"propertyOf.js":function e(t,n,e){let r,i;function o(e){return null==e?r:function(t){return i(e,t)}}e.export({default:()=>o}),e.link("./noop.js",{default(e){r=e}},0),e.link("./get.js",{default(e){i=e}},1)},"times.js":function e(t,n,e){let r;function i(e,t,n){var i=Array(Math.max(0,e));t=r(t,n,1);for(var o=0;oi}),e.link("./_optimizeCb.js",{default(e){r=e}},0)},"random.js":function e(t,n,e){function r(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}e.export({default:()=>r})},"now.js":function e(t,n,e){e.exportDefault(Date.now||function(){return(new Date).getTime()})},"escape.js":function e(t,n,e){let r,i;e.link("./_createEscaper.js",{default(e){r=e}},0),e.link("./_escapeMap.js",{default(e){i=e}},1),e.exportDefault(r(i))},"_createEscaper.js":function e(t,n,e){let r;function i(e){var t=function(t){return e[t]},n="(?:"+r(e).join("|")+")",i=RegExp(n),o=RegExp(n,"g");return function(e){return e=null==e?"":""+e,i.test(e)?e.replace(o,t):e}}e.export({default:()=>i}),e.link("./keys.js",{default(e){r=e}},0)},"_escapeMap.js":function e(t,n,e){e.exportDefault({"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"})},"unescape.js":function e(t,n,e){let r,i;e.link("./_createEscaper.js",{default(e){r=e}},0),e.link("./_unescapeMap.js",{default(e){i=e}},1),e.exportDefault(r(i))},"_unescapeMap.js":function e(t,n,e){let r,i;e.link("./invert.js",{default(e){r=e}},0),e.link("./_escapeMap.js",{default(e){i=e}},1),e.exportDefault(r(i))},"templateSettings.js":function e(t,n,e){let r;e.link("./underscore.js",{default(e){r=e}},0),e.exportDefault(r.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g})},"template.js":function e(t,n,e){let r,i;e.export({default:()=>c}),e.link("./defaults.js",{default(e){r=e}},0),e.link("./underscore.js",{default(e){i=e}},1),e.link("./templateSettings.js");var o=/(.)^/,s={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},a=/\\|'|\r|\n|\u2028|\u2029/g;function u(e){return"\\"+s[e]}var f=/^\s*(\w|\$)+\s*$/;function c(e,t,n){!t&&n&&(t=n),t=r({},t,i.templateSettings);var s=RegExp([(t.escape||o).source,(t.interpolate||o).source,(t.evaluate||o).source].join("|")+"|$","g"),c=0,l="__p+='";e.replace(s,(function(t,n,r,i,o){return l+=e.slice(c,o).replace(a,u),c=o+t.length,n?l+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?l+="'+\n((__t=("+r+"))==null?'':__t)+\n'":i&&(l+="';\n"+i+"\n__p+='"),t})),l+="';\n";var h=t.variable,d;if(h){if(!f.test(h))throw new Error("variable is not a bare identifier: "+h)}else l="with(obj||{}){\n"+l+"}\n",h="obj";l="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+l+"return __p;\n";try{d=new Function(h,"_",l)}catch(g){throw g.source=l,g}var p=function(e){return d.call(this,e,i)};return p.source="function("+h+"){\n"+l+"}",p}},"result.js":function e(t,n,e){let r,i;function o(e,t,n){var o=(t=i(t)).length;if(!o)return r(n)?n.call(e):n;for(var s=0;so}),e.link("./isFunction.js",{default(e){r=e}},0),e.link("./_toPath.js",{default(e){i=e}},1)},"uniqueId.js":function e(t,n,e){e.export({default:()=>i});var r=0;function i(e){var t=++r+"";return e?e+t:t}},"chain.js":function e(t,n,e){let r;function i(e){var t=r(e);return t._chain=!0,t}e.export({default:()=>i}),e.link("./underscore.js",{default(e){r=e}},0)},"partial.js":function e(t,n,e){let r,i,o;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./_executeBound.js",{default(e){i=e}},1),e.link("./underscore.js",{default(e){o=e}},2);var s=r((function(e,t){var n=s.placeholder,r=function(){for(var o=0,s=t.length,a=Array(s),u=0;uo}),e.link("./_baseCreate.js",{default(e){r=e}},0),e.link("./isObject.js",{default(e){i=e}},1)},"bind.js":function e(t,n,e){let r,i,o;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./isFunction.js",{default(e){i=e}},1),e.link("./_executeBound.js",{default(e){o=e}},2),e.exportDefault(r((function(e,t,n){if(!i(e))throw new TypeError("Bind must be called on a function");var s=r((function(r){return o(e,s,t,this,n.concat(r))}));return s})))},"bindAll.js":function e(t,n,e){let r,i,o;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./_flatten.js",{default(e){i=e}},1),e.link("./bind.js",{default(e){o=e}},2),e.exportDefault(r((function(e,t){var n=(t=i(t,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=t[n];e[r]=o(e[r],e)}return e})))},"_flatten.js":function e(t,n,e){let r,i,o,s;function a(e,t,n,u){if(u=u||[],t||0===t){if(t<=0)return u.concat(e)}else t=1/0;for(var f=u.length,c=0,l=r(e);c1)a(h,t-1,n,u),f=u.length;else for(var d=0,p=h.length;da}),e.link("./_getLength.js",{default(e){r=e}},0),e.link("./_isArrayLike.js",{default(e){i=e}},1),e.link("./isArray.js",{default(e){o=e}},2),e.link("./isArguments.js",{default(e){s=e}},3)},"_isArrayLike.js":function e(t,n,e){let r,i;e.link("./_createSizePropertyCheck.js",{default(e){r=e}},0),e.link("./_getLength.js",{default(e){i=e}},1),e.exportDefault(r(i))},"memoize.js":function e(t,n,e){let r;function i(e,t){var n=function(i){var o=n.cache,s=""+(t?t.apply(this,arguments):i);return r(o,s)||(o[s]=e.apply(this,arguments)),o[s]};return n.cache={},n}e.export({default:()=>i}),e.link("./_has.js",{default(e){r=e}},0)},"delay.js":function e(t,n,e){let r;e.link("./restArguments.js",{default(e){r=e}},0),e.exportDefault(r((function(e,t,n){return setTimeout((function(){return e.apply(null,n)}),t)})))},"defer.js":function e(t,n,e){let r,i,o;e.link("./partial.js",{default(e){r=e}},0),e.link("./delay.js",{default(e){i=e}},1),e.link("./underscore.js",{default(e){o=e}},2),e.exportDefault(r(i,o,1))},"throttle.js":function e(t,n,e){let r;function i(e,t,n){var i,o,s,a,u=0;n||(n={});var f=function(){u=!1===n.leading?0:r(),i=null,a=e.apply(o,s),i||(o=s=null)},c=function(){var c=r();u||!1!==n.leading||(u=c);var l=t-(c-u);return o=this,s=arguments,l<=0||l>t?(i&&(clearTimeout(i),i=null),u=c,a=e.apply(o,s),i||(o=s=null)):i||!1===n.trailing||(i=setTimeout(f,l)),a};return c.cancel=function(){clearTimeout(i),u=0,i=o=s=null},c}e.export({default:()=>i}),e.link("./now.js",{default(e){r=e}},0)},"debounce.js":function e(t,n,e){let r,i;function o(e,t,n){var o,s,a,u,f,c=function(){var r=i()-s;t>r?o=setTimeout(c,t-r):(o=null,n||(u=e.apply(f,a)),o||(a=f=null))},l=r((function(r){return f=this,a=r,s=i(),o||(o=setTimeout(c,t),n&&(u=e.apply(f,a))),u}));return l.cancel=function(){clearTimeout(o),o=a=f=null},l}e.export({default:()=>o}),e.link("./restArguments.js",{default(e){r=e}},0),e.link("./now.js",{default(e){i=e}},1)},"wrap.js":function e(t,n,e){let r;function i(e,t){return r(t,e)}e.export({default:()=>i}),e.link("./partial.js",{default(e){r=e}},0)},"negate.js":function e(t,n,e){function r(e){return function(){return!e.apply(this,arguments)}}e.export({default:()=>r})},"compose.js":function e(t,n,e){function r(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}}e.export({default:()=>r})},"after.js":function e(t,n,e){function r(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}e.export({default:()=>r})},"before.js":function e(t,n,e){function r(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}e.export({default:()=>r})},"once.js":function e(t,n,e){let r,i;e.link("./partial.js",{default(e){r=e}},0),e.link("./before.js",{default(e){i=e}},1),e.exportDefault(r(i,2))},"findKey.js":function e(t,n,e){let r,i;function o(e,t,n){t=r(t,n);for(var o=i(e),s,a=0,u=o.length;ao}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./keys.js",{default(e){i=e}},1)},"findIndex.js":function e(t,n,e){let r;e.link("./_createPredicateIndexFinder.js",{default(e){r=e}},0),e.exportDefault(r(1))},"_createPredicateIndexFinder.js":function e(t,n,e){let r,i;function o(e){return function(t,n,o){n=r(n,o);for(var s=i(t),a=e>0?0:s-1;a>=0&&ao}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./_getLength.js",{default(e){i=e}},1)},"findLastIndex.js":function e(t,n,e){let r;e.link("./_createPredicateIndexFinder.js",{default(e){r=e}},0),e.exportDefault(r(-1))},"sortedIndex.js":function e(t,n,e){let r,i;function o(e,t,n,o){for(var s=(n=r(n,o,1))(t),a=0,u=i(e);ao}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./_getLength.js",{default(e){i=e}},1)},"indexOf.js":function e(t,n,e){let r,i,o;e.link("./sortedIndex.js",{default(e){r=e}},0),e.link("./findIndex.js",{default(e){i=e}},1),e.link("./_createIndexFinder.js",{default(e){o=e}},2),e.exportDefault(o(1,i,r))},"_createIndexFinder.js":function e(t,n,e){let r,i,o;function s(e,t,n){return function(s,a,u){var f=0,c=r(s);if("number"==typeof u)e>0?f=u>=0?u:Math.max(u+c,f):c=u>=0?Math.min(u+1,c):u+c+1;else if(n&&u&&c)return s[u=n(s,a)]===a?u:-1;if(a!=a)return(u=t(i.call(s,f,c),o))>=0?u+f:-1;for(u=e>0?f:c-1;u>=0&&us}),e.link("./_getLength.js",{default(e){r=e}},0),e.link("./_setup.js",{slice(e){i=e}},1),e.link("./isNaN.js",{default(e){o=e}},2)},"lastIndexOf.js":function e(t,n,e){let r,i;e.link("./findLastIndex.js",{default(e){r=e}},0),e.link("./_createIndexFinder.js",{default(e){i=e}},1),e.exportDefault(i(-1,r))},"find.js":function e(t,n,e){let r,i,o;function s(e,t,n){var s,a=(r(e)?i:o)(e,t,n);if(void 0!==a&&-1!==a)return e[a]}e.export({default:()=>s}),e.link("./_isArrayLike.js",{default(e){r=e}},0),e.link("./findIndex.js",{default(e){i=e}},1),e.link("./findKey.js",{default(e){o=e}},2)},"findWhere.js":function e(t,n,e){let r,i;function o(e,t){return r(e,i(t))}e.export({default:()=>o}),e.link("./find.js",{default(e){r=e}},0),e.link("./matcher.js",{default(e){i=e}},1)},"each.js":function e(t,n,e){let r,i,o;function s(e,t,n){var s,a;if(t=r(t,n),i(e))for(s=0,a=e.length;ss}),e.link("./_optimizeCb.js",{default(e){r=e}},0),e.link("./_isArrayLike.js",{default(e){i=e}},1),e.link("./keys.js",{default(e){o=e}},2)},"map.js":function e(t,n,e){let r,i,o;function s(e,t,n){t=r(t,n);for(var s=!i(e)&&o(e),a=(s||e).length,u=Array(a),f=0;fs}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./_isArrayLike.js",{default(e){i=e}},1),e.link("./keys.js",{default(e){o=e}},2)},"reduce.js":function e(t,n,e){let r;e.link("./_createReduce.js",{default(e){r=e}},0),e.exportDefault(r(1))},"_createReduce.js":function e(t,n,e){let r,i,o;function s(e){var t=function(t,n,o,s){var a=!r(t)&&i(t),u=(a||t).length,f=e>0?0:u-1;for(s||(o=t[a?a[f]:f],f+=e);f>=0&&f=3;return t(e,o(n,i,4),r,s)}}e.export({default:()=>s}),e.link("./_isArrayLike.js",{default(e){r=e}},0),e.link("./keys.js",{default(e){i=e}},1),e.link("./_optimizeCb.js",{default(e){o=e}},2)},"reduceRight.js":function e(t,n,e){let r;e.link("./_createReduce.js",{default(e){r=e}},0),e.exportDefault(r(-1))},"filter.js":function e(t,n,e){let r,i;function o(e,t,n){var o=[];return t=r(t,n),i(e,(function(e,n,r){t(e,n,r)&&o.push(e)})),o}e.export({default:()=>o}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./each.js",{default(e){i=e}},1)},"reject.js":function e(t,n,e){let r,i,o;function s(e,t,n){return r(e,i(o(t)),n)}e.export({default:()=>s}),e.link("./filter.js",{default(e){r=e}},0),e.link("./negate.js",{default(e){i=e}},1),e.link("./_cb.js",{default(e){o=e}},2)},"every.js":function e(t,n,e){let r,i,o;function s(e,t,n){t=r(t,n);for(var s=!i(e)&&o(e),a=(s||e).length,u=0;us}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./_isArrayLike.js",{default(e){i=e}},1),e.link("./keys.js",{default(e){o=e}},2)},"some.js":function e(t,n,e){let r,i,o;function s(e,t,n){t=r(t,n);for(var s=!i(e)&&o(e),a=(s||e).length,u=0;us}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./_isArrayLike.js",{default(e){i=e}},1),e.link("./keys.js",{default(e){o=e}},2)},"contains.js":function e(t,n,e){let r,i,o;function s(e,t,n,s){return r(e)||(e=i(e)),("number"!=typeof n||s)&&(n=0),o(e,t,n)>=0}e.export({default:()=>s}),e.link("./_isArrayLike.js",{default(e){r=e}},0),e.link("./values.js",{default(e){i=e}},1),e.link("./indexOf.js",{default(e){o=e}},2)},"invoke.js":function e(t,n,e){let r,i,o,s,a;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./isFunction.js",{default(e){i=e}},1),e.link("./map.js",{default(e){o=e}},2),e.link("./_deepGet.js",{default(e){s=e}},3),e.link("./_toPath.js",{default(e){a=e}},4),e.exportDefault(r((function(e,t,n){var r,u;return i(t)?u=t:(t=a(t),r=t.slice(0,-1),t=t[t.length-1]),o(e,(function(e){var i=u;if(!i){if(r&&r.length&&(e=s(e,r)),null==e)return;i=e[t]}return null==i?i:i.apply(e,n)}))})))},"pluck.js":function e(t,n,e){let r,i;function o(e,t){return r(e,i(t))}e.export({default:()=>o}),e.link("./map.js",{default(e){r=e}},0),e.link("./property.js",{default(e){i=e}},1)},"where.js":function e(t,n,e){let r,i;function o(e,t){return r(e,i(t))}e.export({default:()=>o}),e.link("./filter.js",{default(e){r=e}},0),e.link("./matcher.js",{default(e){i=e}},1)},"max.js":function e(t,n,e){let r,i,o,s;function a(e,t,n){var a=-1/0,u=-1/0,f,c;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var l=0,h=(e=r(e)?e:i(e)).length;la&&(a=f);else t=o(t,n),s(e,(function(e,n,r){((c=t(e,n,r))>u||c===-1/0&&a===-1/0)&&(a=e,u=c)}));return a}e.export({default:()=>a}),e.link("./_isArrayLike.js",{default(e){r=e}},0),e.link("./values.js",{default(e){i=e}},1),e.link("./_cb.js",{default(e){o=e}},2),e.link("./each.js",{default(e){s=e}},3)},"min.js":function e(t,n,e){let r,i,o,s;function a(e,t,n){var a=1/0,u=1/0,f,c;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var l=0,h=(e=r(e)?e:i(e)).length;la}),e.link("./_isArrayLike.js",{default(e){r=e}},0),e.link("./values.js",{default(e){i=e}},1),e.link("./_cb.js",{default(e){o=e}},2),e.link("./each.js",{default(e){s=e}},3)},"shuffle.js":function e(t,n,e){let r;function i(e){return r(e,1/0)}e.export({default:()=>i}),e.link("./sample.js",{default(e){r=e}},0)},"sample.js":function e(t,n,e){let r,i,o,s,a;function u(e,t,n){if(null==t||n)return r(e)||(e=i(e)),e[s(e.length-1)];var u=a(e),f=o(u);t=Math.max(Math.min(t,f),0);for(var c=f-1,l=0;lu}),e.link("./_isArrayLike.js",{default(e){r=e}},0),e.link("./values.js",{default(e){i=e}},1),e.link("./_getLength.js",{default(e){o=e}},2),e.link("./random.js",{default(e){s=e}},3),e.link("./toArray.js",{default(e){a=e}},4)},"toArray.js":function e(t,n,e){let r,i,o,s,a,u,f;e.export({default:()=>l}),e.link("./isArray.js",{default(e){r=e}},0),e.link("./_setup.js",{slice(e){i=e}},1),e.link("./isString.js",{default(e){o=e}},2),e.link("./_isArrayLike.js",{default(e){s=e}},3),e.link("./map.js",{default(e){a=e}},4),e.link("./identity.js",{default(e){u=e}},5),e.link("./values.js",{default(e){f=e}},6);var c=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function l(e){return e?r(e)?i.call(e):o(e)?e.match(c):s(e)?a(e,u):f(e):[]}},"sortBy.js":function e(t,n,e){let r,i,o;function s(e,t,n){var s=0;return t=r(t,n),i(o(e,(function(e,n,r){return{value:e,index:s++,criteria:t(e,n,r)}})).sort((function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(ns}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./pluck.js",{default(e){i=e}},1),e.link("./map.js",{default(e){o=e}},2)},"groupBy.js":function e(t,n,e){let r,i;e.link("./_group.js",{default(e){r=e}},0),e.link("./_has.js",{default(e){i=e}},1),e.exportDefault(r((function(e,t,n){i(e,n)?e[n].push(t):e[n]=[t]})))},"_group.js":function e(t,n,e){let r,i;function o(e,t){return function(n,o,s){var a=t?[[],[]]:{};return o=r(o,s),i(n,(function(t,r){var i=o(t,r,n);e(a,t,i)})),a}}e.export({default:()=>o}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./each.js",{default(e){i=e}},1)},"indexBy.js":function e(t,n,e){let r;e.link("./_group.js",{default(e){r=e}},0),e.exportDefault(r((function(e,t,n){e[n]=t})))},"countBy.js":function e(t,n,e){let r,i;e.link("./_group.js",{default(e){r=e}},0),e.link("./_has.js",{default(e){i=e}},1),e.exportDefault(r((function(e,t,n){i(e,n)?e[n]++:e[n]=1})))},"partition.js":function e(t,n,e){let r;e.link("./_group.js",{default(e){r=e}},0),e.exportDefault(r((function(e,t,n){e[n?0:1].push(t)}),!0))},"size.js":function e(t,n,e){let r,i;function o(e){return null==e?0:r(e)?e.length:i(e).length}e.export({default:()=>o}),e.link("./_isArrayLike.js",{default(e){r=e}},0),e.link("./keys.js",{default(e){i=e}},1)},"pick.js":function e(t,n,e){let r,i,o,s,a,u;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./isFunction.js",{default(e){i=e}},1),e.link("./_optimizeCb.js",{default(e){o=e}},2),e.link("./allKeys.js",{default(e){s=e}},3),e.link("./_keyInObj.js",{default(e){a=e}},4),e.link("./_flatten.js",{default(e){u=e}},5),e.exportDefault(r((function(e,t){var n={},r=t[0];if(null==e)return n;i(r)?(t.length>1&&(r=o(r,t[1])),t=s(e)):(r=a,t=u(t,!1,!1),e=Object(e));for(var f=0,c=t.length;fr})},"omit.js":function e(t,n,e){let r,i,o,s,a,u,f;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./isFunction.js",{default(e){i=e}},1),e.link("./negate.js",{default(e){o=e}},2),e.link("./map.js",{default(e){s=e}},3),e.link("./_flatten.js",{default(e){a=e}},4),e.link("./contains.js",{default(e){u=e}},5),e.link("./pick.js",{default(e){f=e}},6),e.exportDefault(r((function(e,t){var n=t[0],r;return i(n)?(n=o(n),t.length>1&&(r=t[1])):(t=s(a(t,!1,!1),String),n=function(e,n){return!u(t,n)}),f(e,n,r)})))},"first.js":function e(t,n,e){let r;function i(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[0]:r(e,e.length-t)}e.export({default:()=>i}),e.link("./initial.js",{default(e){r=e}},0)},"initial.js":function e(t,n,e){let r;function i(e,t,n){return r.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))}e.export({default:()=>i}),e.link("./_setup.js",{slice(e){r=e}},0)},"last.js":function e(t,n,e){let r;function i(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[e.length-1]:r(e,Math.max(0,e.length-t))}e.export({default:()=>i}),e.link("./rest.js",{default(e){r=e}},0)},"rest.js":function e(t,n,e){let r;function i(e,t,n){return r.call(e,null==t||n?1:t)}e.export({default:()=>i}),e.link("./_setup.js",{slice(e){r=e}},0)},"compact.js":function e(t,n,e){let r;function i(e){return r(e,Boolean)}e.export({default:()=>i}),e.link("./filter.js",{default(e){r=e}},0)},"flatten.js":function e(t,n,e){let r;function i(e,t){return r(e,t,!1)}e.export({default:()=>i}),e.link("./_flatten.js",{default(e){r=e}},0)},"without.js":function e(t,n,e){let r,i;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./difference.js",{default(e){i=e}},1),e.exportDefault(r((function(e,t){return i(e,t)})))},"difference.js":function e(t,n,e){let r,i,o,s;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./_flatten.js",{default(e){i=e}},1),e.link("./filter.js",{default(e){o=e}},2),e.link("./contains.js",{default(e){s=e}},3),e.exportDefault(r((function(e,t){return t=i(t,!0,!0),o(e,(function(e){return!s(t,e)}))})))},"uniq.js":function e(t,n,e){let r,i,o,s;function a(e,t,n,a){r(t)||(a=n,n=t,t=!1),null!=n&&(n=i(n,a));for(var u=[],f=[],c=0,l=o(e);ca}),e.link("./isBoolean.js",{default(e){r=e}},0),e.link("./_cb.js",{default(e){i=e}},1),e.link("./_getLength.js",{default(e){o=e}},2),e.link("./contains.js",{default(e){s=e}},3)},"union.js":function e(t,n,e){let r,i,o;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./uniq.js",{default(e){i=e}},1),e.link("./_flatten.js",{default(e){o=e}},2),e.exportDefault(r((function(e){return i(o(e,!0,!0))})))},"intersection.js":function e(t,n,e){let r,i;function o(e){for(var t=[],n=arguments.length,o=0,s=r(e);oo}),e.link("./_getLength.js",{default(e){r=e}},0),e.link("./contains.js",{default(e){i=e}},1)},"unzip.js":function e(t,n,e){let r,i,o;function s(e){for(var t=e&&r(e,i).length||0,n=Array(t),s=0;ss}),e.link("./max.js",{default(e){r=e}},0),e.link("./_getLength.js",{default(e){i=e}},1),e.link("./pluck.js",{default(e){o=e}},2)},"zip.js":function e(t,n,e){let r,i;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./unzip.js",{default(e){i=e}},1),e.exportDefault(r(i))},"object.js":function e(t,n,e){let r;function i(e,t){for(var n={},i=0,o=r(e);ii}),e.link("./_getLength.js",{default(e){r=e}},0)},"range.js":function e(t,n,e){function r(e,t,n){null==t&&(t=e||0,e=0),n||(n=tr})},"chunk.js":function e(t,n,e){let r;function i(e,t){if(null==t||t<1)return[];for(var n=[],i=0,o=e.length;ii}),e.link("./_setup.js",{slice(e){r=e}},0)},"mixin.js":function e(t,n,e){let r,i,o,s,a;function u(e){return i(o(e),(function(t){var n=r[t]=e[t];r.prototype[t]=function(){var e=[this._wrapped];return s.apply(e,arguments),a(this,n.apply(r,e))}})),r}e.export({default:()=>u}),e.link("./underscore.js",{default(e){r=e}},0),e.link("./each.js",{default(e){i=e}},1),e.link("./functions.js",{default(e){o=e}},2),e.link("./_setup.js",{push(e){s=e}},3),e.link("./_chainResult.js",{default(e){a=e}},4)},"_chainResult.js":function e(t,n,e){let r;function i(e,t){return e._chain?r(t).chain():t}e.export({default:()=>i}),e.link("./underscore.js",{default(e){r=e}},0)},"underscore-array-methods.js":function e(t,n,e){let r,i,o,s;e.link("./underscore.js",{default(e){r=e}},0),e.link("./each.js",{default(e){i=e}},1),e.link("./_setup.js",{ArrayProto(e){o=e}},2),e.link("./_chainResult.js",{default(e){s=e}},3),i(["pop","push","reverse","shift","sort","splice","unshift"],(function(e){var t=o[e];r.prototype[e]=function(){var n=this._wrapped;return null!=n&&(t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0]),s(this,n)}})),i(["concat","join","slice"],(function(e){var t=o[e];r.prototype[e]=function(){var e=this._wrapped;return null!=e&&(e=t.apply(e,arguments)),s(this,e)}})),e.exportDefault(r)}}}}},cachers:{"package.json":function e(t,n,e){e.exports={name:"@steedos/cachers",version:"2.7.1-beta.2",main:"lib/index.js"}},lib:{"index.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getCacherNames=n.clearCacher=n.getCacher=void 0;var r={},i=t("./memory"),o=t("./memory-lru"),s=function(e,t){return r[e]||(e.startsWith("lru.")?r[e]=new o.MemoryLRUCacher(t):r[e]=new i.MemoryCacher),r[e]};n.getCacher=s;var a=function(e){r[e]&&r[e].clear()};n.clearCacher=a;var u=function(){return Object.keys(r)};n.getCacherNames=u},"memory.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MemoryCacher=void 0;var r=t("lodash"),i=function(){function e(){this.cache={}}return e.prototype.get=function(e){return this.cache[e]},e.prototype.delete=function(e){delete this.cache[e]},e.prototype.set=function(e,t){this.cache[e]=t},e.prototype.clear=function(){this.cache={}},e.prototype.keys=function(){return(0,r.keys)(this.cache)},e.prototype.values=function(){return(0,r.values)(this.cache)},e}();n.MemoryCacher=i},"memory-lru.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MemoryLRUCacher=void 0;var r=t("lodash"),i=t("lru-cache"),o={max:5e3,ttl:null,keygen:null,maxParamsLength:null},s=function(){function e(e){this.opts=(0,r.defaultsDeep)(e,o),this.cache=new i({max:this.opts.max,maxAge:this.opts.ttl?1e3*this.opts.ttl:null,updateAgeOnGet:!!this.opts.ttl})}return e.prototype.get=function(e){return this.cache.get(e)},e.prototype.set=function(e,t,n){return this.cache.set(e,t,n)},e.prototype.delete=function(e){return this.cache.delete(e)},e.prototype.clear=function(){return this.cache.clear()},e.prototype.keys=function(){return this.cache.keys()},e.prototype.values=function(){return this.cache.values()},e}();n.MemoryLRUCacher=s}},node_modules:{"lru-cache":{"package.json":function e(t,n,e){e.exports={name:"lru-cache",version:"7.14.1",main:"index.js"}},"index.js":function e(t,n,e){const r="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,i="function"==typeof AbortController,o=i?AbortController:class e{constructor(){this.signal=new u}abort(){this.signal.dispatchEvent("abort")}},s="function"==typeof AbortSignal,a="function"==typeof o.AbortSignal,u=s?AbortSignal:a?o.AbortController:class e{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(e){if("abort"===e){this.aborted=!0;const t={type:e,target:this};this.onabort(t),this._listeners.forEach(e=>e(t),this)}}onabort(){}addEventListener(e,t){"abort"===e&&this._listeners.push(t)}removeEventListener(e,t){"abort"===e&&(this._listeners=this._listeners.filter(e=>e!==t))}},f=new Set,c=(e,t)=>{const n=`LRU_CACHE_OPTION_${e}`;p(n)&&g(n,`${e} option`,`options.${t}`,_)},l=(e,t)=>{const n=`LRU_CACHE_METHOD_${e}`;if(p(n)){const{prototype:r}=_,{get:i}=Object.getOwnPropertyDescriptor(r,e);g(n,`${e} method`,`cache.${t}()`,i)}},h=(e,t)=>{const n=`LRU_CACHE_PROPERTY_${e}`;if(p(n)){const{prototype:r}=_,{get:i}=Object.getOwnPropertyDescriptor(r,e);g(n,`${e} property`,`cache.${t}`,i)}},d=(...e)=>{"object"==typeof process&&process&&"function"==typeof process.emitWarning?process.emitWarning(...e):console.error(...e)},p=e=>!f.has(e),g=(e,t,n,r)=>{f.add(e);const i=`The ${t} is deprecated. Please use ${n} instead.`;d(i,"DeprecationWarning",e,r)},b=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),m=e=>b(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?v:null:null;class v extends Array{constructor(e){super(e),this.fill(0)}}class y{constructor(e){if(0===e)return[];const t=m(e);this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class _{constructor(e={}){const{max:t=0,ttl:n,ttlResolution:r=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:u,disposeAfter:l,noDisposeOnSet:h,noUpdateTTL:g,maxSize:v=0,maxEntrySize:w=0,sizeCalculation:k,fetchMethod:j,fetchContext:x,noDeleteOnFetchRejection:S,noDeleteOnStaleGet:D}=e,{length:E,maxAge:A,stale:C}=e instanceof _?{}:e;if(0!==t&&!b(t))throw new TypeError("max option must be a nonnegative integer");const M=t?m(t):Array;if(!M)throw new Error("invalid max value: "+t);if(this.max=t,this.maxSize=v,this.maxEntrySize=w||this.maxSize,this.sizeCalculation=k||E,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=j||null,this.fetchMethod&&"function"!=typeof this.fetchMethod)throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=x,!this.fetchMethod&&void 0!==x)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(t).fill(null),this.valList=new Array(t).fill(null),this.next=new M(t),this.prev=new M(t),this.head=0,this.tail=0,this.free=new y(t),this.initialFill=1,this.size=0,"function"==typeof u&&(this.dispose=u),"function"==typeof l?(this.disposeAfter=l,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!S,0!==this.maxEntrySize){if(0!==this.maxSize&&!b(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!b(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!a||!!C,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=b(r)||0===r?r:1,this.ttlAutopurge=!!i,this.ttl=n||A||0,this.ttl){if(!b(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(0===this.max&&0===this.ttl&&0===this.maxSize)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const e="LRU_CACHE_UNBOUNDED";if(p(e)){f.add(e);const t="TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.";d(t,"UnboundedCacheWarning",e,_)}}C&&c("stale","allowStale"),A&&c("maxAge","ttl"),E&&c("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new v(this.max),this.starts=new v(this.max),this.setItemTTL=(e,t,n=r.now())=>{if(this.starts[e]=0!==t?n:0,this.ttls[e]=t,0!==t&&this.ttlAutopurge){const n=setTimeout(()=>{this.isStale(e)&&this.delete(this.keyList[e])},t+1);n.unref&&n.unref()}},this.updateItemAge=e=>{this.starts[e]=0!==this.ttls[e]?r.now():0};let e=0;const t=()=>{const t=r.now();if(this.ttlResolution>0){e=t;const n=setTimeout(()=>e=0,this.ttlResolution);n.unref&&n.unref()}return t};this.getRemainingTTL=n=>{const r=this.keyMap.get(n);return void 0===r?0:0===this.ttls[r]||0===this.starts[r]?1/0:this.starts[r]+this.ttls[r]-(e||t())},this.isStale=n=>0!==this.ttls[n]&&0!==this.starts[n]&&(e||t())-this.starts[n]>this.ttls[n]}updateItemAge(e){}setItemTTL(e,t,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new v(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,t,n,r)=>{if(this.isBackgroundFetch(t))return 0;if(!b(n)){if(!r)throw new TypeError("invalid size value (must be positive integer)");if("function"!=typeof r)throw new TypeError("sizeCalculation must be a function");if(n=r(t,e),!b(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return n},this.addItemSize=(e,t)=>{if(this.sizes[e]=t,this.maxSize){const t=this.maxSize-this.sizes[e];for(;this.calculatedSize>t;)this.evict(!0)}this.calculatedSize+=this.sizes[e]}}removeItemSize(e){}addItemSize(e,t){}requireSize(e,t,n,r){if(n||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.tail;this.isValidIndex(t)&&(!e&&this.isStale(t)||(yield t),t!==this.head);)t=this.prev[t]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.head;this.isValidIndex(t)&&(!e&&this.isStale(t)||(yield t),t!==this.tail);)t=this.next[t]}isValidIndex(e){return this.keyMap.get(this.keyList[e])===e}*entries(){for(const e of this.indexes())yield[this.keyList[e],this.valList[e]]}*rentries(){for(const e of this.rindexes())yield[this.keyList[e],this.valList[e]]}*keys(){for(const e of this.indexes())yield this.keyList[e]}*rkeys(){for(const e of this.rindexes())yield this.keyList[e]}*values(){for(const e of this.indexes())yield this.valList[e]}*rvalues(){for(const e of this.rindexes())yield this.valList[e]}[Symbol.iterator](){return this.entries()}find(e,t={}){for(const n of this.indexes())if(e(this.valList[n],this.keyList[n],this))return this.get(this.keyList[n],t)}forEach(e,t=this){for(const n of this.indexes())e.call(t,this.valList[n],this.keyList[n],this)}rforEach(e,t=this){for(const n of this.rindexes())e.call(t,this.valList[n],this.keyList[n],this)}get prune(){return l("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(const t of this.rindexes({allowStale:!0}))this.isStale(t)&&(this.delete(this.keyList[t]),e=!0);return e}dump(){const e=[];for(const t of this.indexes({allowStale:!0})){const n=this.keyList[t],i=this.valList[t],o=this.isBackgroundFetch(i)?i.__staleWhileFetching:i,s={value:o};if(this.ttls){s.ttl=this.ttls[t];const e=r.now()-this.starts[t];s.start=Math.floor(Date.now()-e)}this.sizes&&(s.size=this.sizes[t]),e.unshift([n,s])}return e}load(e){this.clear();for(const[t,n]of e){if(n.start){const e=Date.now()-n.start;n.start=r.now()-e}this.set(t,n.value,n)}}dispose(e,t,n){}set(e,t,{ttl:n=this.ttl,start:r,noDisposeOnSet:i=this.noDisposeOnSet,size:o=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:a=this.noUpdateTTL}={}){if(o=this.requireSize(e,t,o,s),this.maxEntrySize&&o>this.maxEntrySize)return this.delete(e),this;let u=0===this.size?void 0:this.keyMap.get(e);if(void 0===u)u=this.newIndex(),this.keyList[u]=e,this.valList[u]=t,this.keyMap.set(e,u),this.next[this.tail]=u,this.prev[u]=this.tail,this.tail=u,this.size++,this.addItemSize(u,o),a=!1;else{const n=this.valList[u];t!==n&&(this.isBackgroundFetch(n)?n.__abortController.abort():i||(this.dispose(n,e,"set"),this.disposeAfter&&this.disposed.push([n,e,"set"])),this.removeItemSize(u),this.valList[u]=t,this.addItemSize(u,o)),this.moveToTail(u)}if(0===n||0!==this.ttl||this.ttls||this.initializeTTLTracking(),a||this.setItemTTL(u,n,r),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return 0===this.size?this.tail:this.size===this.max&&0!==this.max?this.evict(!1):0!==this.free.length?this.free.pop():this.initialFill++}pop(){if(this.size){const e=this.valList[this.head];return this.evict(!0),e}}evict(e){const t=this.head,n=this.keyList[t],r=this.valList[t];return this.isBackgroundFetch(r)?r.__abortController.abort():(this.dispose(r,n,"evict"),this.disposeAfter&&this.disposed.push([r,n,"evict"])),this.removeItemSize(t),e&&(this.keyList[t]=null,this.valList[t]=null,this.free.push(t)),this.head=this.next[t],this.keyMap.delete(n),this.size--,t}has(e,{updateAgeOnHas:t=this.updateAgeOnHas}={}){const n=this.keyMap.get(e);return void 0!==n&&!this.isStale(n)&&(t&&this.updateItemAge(n),!0)}peek(e,{allowStale:t=this.allowStale}={}){const n=this.keyMap.get(e);if(void 0!==n&&(t||!this.isStale(n))){const e=this.valList[n];return this.isBackgroundFetch(e)?e.__staleWhileFetching:e}}backgroundFetch(e,t,n,r){const i=void 0===t?void 0:this.valList[t];if(this.isBackgroundFetch(i))return i;const s=new o,a={signal:s.signal,options:n,context:r},u=t=>(s.signal.aborted||this.set(e,t,a.options),t),f=r=>{if(this.valList[t]===l){const r=!n.noDeleteOnFetchRejection||void 0===l.__staleWhileFetching;r?this.delete(e):this.valList[t]=l.__staleWhileFetching}if(l.__returned===l)throw r},c=t=>t(this.fetchMethod(e,i,a)),l=new Promise(c).then(u,f);return l.__abortController=s,l.__staleWhileFetching=i,l.__returned=null,void 0===t?(this.set(e,l,a.options),t=this.keyMap.get(e)):this.valList[t]=l,l}isBackgroundFetch(e){return e&&"object"==typeof e&&"function"==typeof e.then&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||null===e.__returned)}async fetch(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,fetchContext:c=this.fetchContext,forceRefresh:l=!1}={}){if(!this.fetchMethod)return this.get(e,{allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r});const h={allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:i,noDisposeOnSet:o,size:s,sizeCalculation:a,noUpdateTTL:u,noDeleteOnFetchRejection:f};let d=this.keyMap.get(e);if(void 0===d){const t=this.backgroundFetch(e,d,h,c);return t.__returned=t}{const r=this.valList[d];if(this.isBackgroundFetch(r))return t&&void 0!==r.__staleWhileFetching?r.__staleWhileFetching:r.__returned=r;if(!l&&!this.isStale(d))return this.moveToTail(d),n&&this.updateItemAge(d),r;const i=this.backgroundFetch(e,d,h,c);return t&&void 0!==i.__staleWhileFetching?i.__staleWhileFetching:i.__returned=i}}get(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet}={}){const i=this.keyMap.get(e);if(void 0!==i){const o=this.valList[i],s=this.isBackgroundFetch(o);if(this.isStale(i))return s?t?o.__staleWhileFetching:void 0:(r||this.delete(e),t?o:void 0);if(s)return;return this.moveToTail(i),n&&this.updateItemAge(i),o}}connect(e,t){this.prev[t]=e,this.next[e]=t}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return l("del","delete"),this.delete}delete(e){let t=!1;if(0!==this.size){const n=this.keyMap.get(e);if(void 0!==n)if(t=!0,1===this.size)this.clear();else{this.removeItemSize(n);const t=this.valList[n];this.isBackgroundFetch(t)?t.__abortController.abort():(this.dispose(t,e,"delete"),this.disposeAfter&&this.disposed.push([t,e,"delete"])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return t}clear(){for(const e of this.rindexes({allowStale:!0})){const t=this.valList[e];if(this.isBackgroundFetch(t))t.__abortController.abort();else{const n=this.keyList[e];this.dispose(t,n,"delete"),this.disposeAfter&&this.disposed.push([t,n,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return l("reset","clear"),this.clear}get length(){return h("length","size"),this.size}static get AbortController(){return o}static get AbortSignal(){return u}}e.exports=_}}}},"form-builder":{"package.json":function e(t,n,e){e.exports={name:"@steedos/form-builder",version:"3.6.2-patch.5",private:!1,publishConfig:{access:"public"},main:"dist/form-builder.min.js",homepage:"https://formbuilder.online/",repository:{url:"https://github.com/kevinchappell/formBuilder.git",type:"git"},files:["dist/**/*","docs/**/*","src/**/*"],author:"Kevin Chappell ",contributors:[],bugs:"https://github.com/kevinchappell/formBuilder/issues",description:"A jQuery plugin for drag and drop form building",keywords:["jquery-plugin","forms","drag and drop","form builder","form create"],license:"MIT",ignore:["**/*","node_modules","test"],config:{files:{test:["test/**/*.spec.js"],pluginsDir:"src/js/control_plugins/",fonts:"src/fonts",sass:"src/sass",formBuilder:{js:"src/js/form-builder.js",sass:["src/sass/form-builder.scss"]},formRender:{js:"src/js/form-render.js",sass:["src/sass/form-render.scss"]},site:["demo/assets/sass/site.scss"]},fontServer:"http://fontello.com",fontelloToken:"09d648f01d6c57cb9f9b8cc55043e0c0"},babel:{presets:[["@babel/preset-env",{targets:{browsers:["> 1%"]},loose:!0}]],comments:!1,plugins:["@babel/plugin-proposal-object-rest-spread","@babel/plugin-proposal-class-properties"]},scripts:{"build:analyze":"webpack --mode production -p --progress --config tools/webpack.config --analyze","build:plugins":"webpack --mode production -p --display-entrypoints --progress --config tools/webpack.plugins.config","build:vendor":"babel-node tools/build-vendor",build:"webpack --mode production -p --progress --config tools/webpack.config","build:all":"npm-run-all build:plugins build:vendor build copy",copy:"cp -a dist/* demo/assets/js/ && cp CONTRIBUTING.md docs/contributing.md && cp LICENSE docs/license.md && npm run copy:lang","copy:lang":"babel-node tools/copy-language-files","deploy:all":"npm-run-all deploy:demo deploy:site","deploy:demo":"node tools/deploy-demo.js","deploy:site":"node tools/deploy-site.js",docs:"mkdocs build",font:"babel-node tools/icon-font",lint:"eslint ./src --ext .js || true","semantic-release":"semantic-release","start:devServer":"webpack-dev-server --mode development --config tools/webpack.config",prestart:"npm-run-all -p build:vendor copy:lang",start:"npm run start:devServer",test:"npm run-script build"},dependencies:{jquery:">=3.4.1","jquery-ui-sortable":"*"},devDependencies:{"@babel/cli":"^7.10.5","@babel/core":"^7.11.4","@babel/node":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.11.0","@babel/plugin-syntax-object-rest-spread":"^7.8.3","@babel/plugin-transform-destructuring":"^7.10.4","@babel/preset-env":"^7.11.0","@semantic-release/changelog":"^5.0.1","@semantic-release/git":"^9.0.0","@semantic-release/npm":"^7.0.5",autoprefixer:"^9.8.6","babel-eslint":"^10.1.0","babel-loader":"^8.1.0","clean-webpack-plugin":"^3.0.0",clui:"^0.3.6","compression-webpack-plugin":"^5.0.1","concat-files":"^0.1.1","cross-env":"^7.0.2","css-loader":"^4.2.1",eslint:"^7.7.0","eslint-loader":"^4.0.2","formbuilder-languages":"latest","fs-extra":"^9.0.1","html-webpack-harddisk-plugin":"^1.0.2","html-webpack-plugin":"^4.3.0",inquirer:"^7.3.3",mi18n:"^0.4.8","node-sass":"6.0.1","npm-run-all":"^4.1.5",opener:"^1.5.1","postcss-loader":"^3.0.0","replace-in-file":"^6.1.0",request:"^2.88.2","sass-loader":"10.5.2","semantic-release":"^17.1.1",semver:"^7.3.2","style-loader":"^1.2.1",unzipper:"^0.10.11",webpack:"^4.44.1","webpack-bundle-analyzer":"^3.8.0","webpack-cli":"^3.3.12","webpack-dev-server":"^3.11.0","wrapper-webpack-plugin":"^2.1.0"},prettier:{singleQuote:!0,trailingComma:"all",printWidth:120,semi:!1,arrowParens:"avoid",spaceAfterFunction:!1},engines:{},release:{branch:"master",verifyConditions:["@semantic-release/changelog","@semantic-release/npm","@semantic-release/git"],prepare:["@semantic-release/changelog","@semantic-release/npm","@semantic-release/git"]},browserslist:["> 1%"]}},dist:{"form-builder.min.js":[]}}},tslib:{"package.json":function e(t,n,e){e.exports={name:"tslib",version:"2.3.1",module:"tslib.es6.js",main:"tslib.js"}},"tslib.es6.js":function e(t,n,e){e.export({__extends:()=>i,__assign:()=>o,__rest:()=>s,__decorate:()=>a,__param:()=>u,__metadata:()=>f,__awaiter:()=>c,__generator:()=>l,__createBinding:()=>h,__exportStar:()=>d,__values:()=>p,__read:()=>g,__spread:()=>b,__spreadArrays:()=>m,__spreadArray:()=>v,__await:()=>y,__asyncGenerator:()=>_,__asyncDelegator:()=>w,__asyncValues:()=>k,__makeTemplateObject:()=>j,__importStar:()=>S,__importDefault:()=>D,__classPrivateFieldGet:()=>E,__classPrivateFieldSet:()=>A}); +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(e){"use strict";var t=e.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1==t[0]&&9==t[1]&&t[2]<1||t[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),function(e){"use strict";function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(void 0!==e.style[n])return{end:t[n]};return!1}e.fn.emulateTransitionEnd=function(t){var n=!1,r=this,i;return e(this).one("bsTransitionEnd",(function(){n=!0})),setTimeout((function(){n||e(r).trigger(e.support.transition.end)}),t),this},e((function(){e.support.transition=t(),e.support.transition&&(e.event.special.bsTransitionEnd={bindType:e.support.transition.end,delegateType:e.support.transition.end,handle:function(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})}))}(jQuery),function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};function r(t){return this.each((function(){var r=e(this),i=r.data("bs.alert");i||r.data("bs.alert",i=new n(this)),"string"==typeof t&&i[t].call(r)}))}n.VERSION="3.4.1",n.TRANSITION_DURATION=150,n.prototype.close=function(t){var r=e(this),i=r.attr("data-target");i||(i=(i=r.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),i="#"===i?[]:i;var o=e(document).find(i);function s(){o.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),o.length||(o=r.closest(".alert")),o.trigger(t=e.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),e.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",s).emulateTransitionEnd(n.TRANSITION_DURATION):s())};var i=e.fn.alert;e.fn.alert=r,e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=i,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}(jQuery),function(e){"use strict";var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r),this.isLoading=!1};function n(n){return this.each((function(){var r=e(this),i=r.data("bs.button"),o="object"==typeof n&&n;i||r.data("bs.button",i=new t(this,o)),"toggle"==n?i.toggle():n&&i.setState(n)}))}t.VERSION="3.4.1",t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(t){var n="disabled",r=this.$element,i=r.is("input")?"val":"html",o=r.data();t+="Text",null==o.resetText&&r.data("resetText",r[i]()),setTimeout(e.proxy((function(){r[i](null==o[t]?this.options[t]:o[t]),"loadingText"==t?(this.isLoading=!0,r.addClass(n).attr(n,n).prop(n,!0)):this.isLoading&&(this.isLoading=!1,r.removeClass(n).removeAttr(n).prop(n,!1))}),this),0)},t.prototype.toggle=function(){var e=!0,t=this.$element.closest('[data-toggle="buttons"]');if(t.length){var n=this.$element.find("input");"radio"==n.prop("type")?(n.prop("checked")&&(e=!1),t.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(e=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),e&&n.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var r=e.fn.button;e.fn.button=n,e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=r,this},e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(t){var r=e(t.target).closest(".btn");n.call(r,"toggle"),e(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),r.is("input,button")?r.trigger("focus"):r.find("input:visible,button:visible").first().trigger("focus"))})).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',(function(t){e(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))}))}(jQuery),function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",e.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",e.proxy(this.pause,this)).on("mouseleave.bs.carousel",e.proxy(this.cycle,this))};function n(n){return this.each((function(){var r=e(this),i=r.data("bs.carousel"),o=e.extend({},t.DEFAULTS,r.data(),"object"==typeof n&&n),s="string"==typeof n?n:o.slide;i||r.data("bs.carousel",i=new t(this,o)),"number"==typeof n?i.to(n):s?i[s]():o.interval&&i.pause().cycle()}))}t.VERSION="3.4.1",t.TRANSITION_DURATION=600,t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},t.prototype.keydown=function(e){if(!/input|textarea/i.test(e.target.tagName)){switch(e.which){case 37:this.prev();break;case 39:this.next();break;default:return}e.preventDefault()}},t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},t.prototype.getItemIndex=function(e){return this.$items=e.parent().children(".item"),this.$items.index(e||this.$active)},t.prototype.getItemForDirection=function(e,t){var n=this.getItemIndex(t),r;if(("prev"==e&&0===n||"next"==e&&n==this.$items.length-1)&&!this.options.wrap)return t;var i,o=(n+("prev"==e?-1:1))%this.$items.length;return this.$items.eq(o)},t.prototype.to=function(e){var t=this,n=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(e>this.$items.length-1||e<0))return this.sliding?this.$element.one("slid.bs.carousel",(function(){t.to(e)})):n==e?this.pause().cycle():this.slide(e>n?"next":"prev",this.$items.eq(e))},t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},t.prototype.next=function(){if(!this.sliding)return this.slide("next")},t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},t.prototype.slide=function(n,r){var i=this.$element.find(".item.active"),o=r||this.getItemForDirection(n,i),s=this.interval,a="next"==n?"left":"right",u=this;if(o.hasClass("active"))return this.sliding=!1;var f=o[0],c=e.Event("slide.bs.carousel",{relatedTarget:f,direction:a});if(this.$element.trigger(c),!c.isDefaultPrevented()){if(this.sliding=!0,s&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=e(this.$indicators.children()[this.getItemIndex(o)]);l&&l.addClass("active")}var h=e.Event("slid.bs.carousel",{relatedTarget:f,direction:a});return e.support.transition&&this.$element.hasClass("slide")?(o.addClass(n),"object"==typeof o&&o.length&&o[0].offsetWidth,i.addClass(a),o.addClass(a),i.one("bsTransitionEnd",(function(){o.removeClass([n,a].join(" ")).addClass("active"),i.removeClass(["active",a].join(" ")),u.sliding=!1,setTimeout((function(){u.$element.trigger(h)}),0)})).emulateTransitionEnd(t.TRANSITION_DURATION)):(i.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(h)),s&&this.cycle(),this}};var r=e.fn.carousel;e.fn.carousel=n,e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=r,this};var i=function(t){var r=e(this),i=r.attr("href");i&&(i=i.replace(/.*(?=#[^\s]+$)/,""));var o=r.attr("data-target")||i,s=e(document).find(o);if(s.hasClass("carousel")){var a=e.extend({},s.data(),r.data()),u=r.attr("data-slide-to");u&&(a.interval=!1),n.call(s,a),u&&s.data("bs.carousel").to(u),t.preventDefault()}};e(document).on("click.bs.carousel.data-api","[data-slide]",i).on("click.bs.carousel.data-api","[data-slide-to]",i),e(window).on("load",(function(){e('[data-ride="carousel"]').each((function(){var t=e(this);n.call(t,t.data())}))}))}(jQuery),function(e){"use strict";var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r),this.$trigger=e('[data-toggle="collapse"][href="#'+n.id+'"],[data-toggle="collapse"][data-target="#'+n.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function n(t){var n,r=t.attr("data-target")||(n=t.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"");return e(document).find(r)}function r(n){return this.each((function(){var r=e(this),i=r.data("bs.collapse"),o=e.extend({},t.DEFAULTS,r.data(),"object"==typeof n&&n);!i&&o.toggle&&/show|hide/.test(n)&&(o.toggle=!1),i||r.data("bs.collapse",i=new t(this,o)),"string"==typeof n&&i[n]()}))}t.VERSION="3.4.1",t.TRANSITION_DURATION=350,t.DEFAULTS={toggle:!0},t.prototype.dimension=function(){var e;return this.$element.hasClass("width")?"width":"height"},t.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var n,i=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(i&&i.length&&(n=i.data("bs.collapse"))&&n.transitioning)){var o=e.Event("show.bs.collapse");if(this.$element.trigger(o),!o.isDefaultPrevented()){i&&i.length&&(r.call(i,"hide"),n||i.data("bs.collapse",null));var s=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[s](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[s](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return a.call(this);var u=e.camelCase(["scroll",s].join("-"));this.$element.one("bsTransitionEnd",e.proxy(a,this)).emulateTransitionEnd(t.TRANSITION_DURATION)[s](this.$element[0][u])}}}},t.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var n=e.Event("hide.bs.collapse");if(this.$element.trigger(n),!n.isDefaultPrevented()){var r=this.dimension();this.$element[r](this.$element[r]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!e.support.transition)return i.call(this);this.$element[r](0).one("bsTransitionEnd",e.proxy(i,this)).emulateTransitionEnd(t.TRANSITION_DURATION)}}},t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},t.prototype.getParent=function(){return e(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(e.proxy((function(t,r){var i=e(r);this.addAriaAndCollapsedClass(n(i),i)}),this)).end()},t.prototype.addAriaAndCollapsedClass=function(e,t){var n=e.hasClass("in");e.attr("aria-expanded",n),t.toggleClass("collapsed",!n).attr("aria-expanded",n)};var i=e.fn.collapse;e.fn.collapse=r,e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=i,this},e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',(function(t){var i=e(this);i.attr("data-target")||t.preventDefault();var o=n(i),s,a=o.data("bs.collapse")?"toggle":i.data();r.call(o,a)}))}(jQuery),function(e){"use strict";var t=".dropdown-backdrop",n='[data-toggle="dropdown"]',r=function(t){e(t).on("click.bs.dropdown",this.toggle)};function i(t){var n=t.attr("data-target");n||(n=(n=t.attr("href"))&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r="#"!==n?e(document).find(n):null;return r&&r.length?r:t.parent()}function o(r){r&&3===r.which||(e(t).remove(),e(n).each((function(){var t=e(this),n=i(t),o={relatedTarget:this};n.hasClass("open")&&(r&&"click"==r.type&&/input|textarea/i.test(r.target.tagName)&&e.contains(n[0],r.target)||(n.trigger(r=e.Event("hide.bs.dropdown",o)),r.isDefaultPrevented()||(t.attr("aria-expanded","false"),n.removeClass("open").trigger(e.Event("hidden.bs.dropdown",o)))))})))}function s(t){return this.each((function(){var n=e(this),i=n.data("bs.dropdown");i||n.data("bs.dropdown",i=new r(this)),"string"==typeof t&&i[t].call(n)}))}r.VERSION="3.4.1",r.prototype.toggle=function(t){var n=e(this);if(!n.is(".disabled, :disabled")){var r=i(n),s=r.hasClass("open");if(o(),!s){"ontouchstart"in document.documentElement&&!r.closest(".navbar-nav").length&&e(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(e(this)).on("click",o);var a={relatedTarget:this};if(r.trigger(t=e.Event("show.bs.dropdown",a)),t.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),r.toggleClass("open").trigger(e.Event("shown.bs.dropdown",a))}return!1}},r.prototype.keydown=function(t){if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)){var r=e(this);if(t.preventDefault(),t.stopPropagation(),!r.is(".disabled, :disabled")){var o=i(r),s=o.hasClass("open");if(!s&&27!=t.which||s&&27==t.which)return 27==t.which&&o.find(n).trigger("focus"),r.trigger("click");var a=" li:not(.disabled):visible a",u=o.find(".dropdown-menu"+a);if(u.length){var f=u.index(t.target);38==t.which&&f>0&&f--,40==t.which&&fdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&e?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!e?this.scrollbarWidth:""})},t.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},t.prototype.checkScrollbar=function(){var e=window.innerWidth;if(!e){var t=document.documentElement.getBoundingClientRect();e=t.right-Math.abs(t.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:i},f.prototype.init=function(t,n,r){if(this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&e(document).find(e.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var i=this.options.trigger.split(" "),o=i.length;o--;){var s=i[o];if("click"==s)this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",u="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(u+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},f.prototype.getDefaults=function(){return f.DEFAULTS},f.prototype.getOptions=function(n){var r=this.$element.data();for(var i in r)r.hasOwnProperty(i)&&-1!==e.inArray(i,t)&&delete r[i];return(n=e.extend({},this.getDefaults(),r,n)).delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),n.sanitize&&(n.template=u(n.template,n.whiteList,n.sanitizeFn)),n},f.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,(function(e,r){n[e]!=r&&(t[e]=r)})),t},f.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusin"==t.type?"focus":"hover"]=!0),n.tip().hasClass("in")||"in"==n.hoverState)n.hoverState="in";else{if(clearTimeout(n.timeout),n.hoverState="in",!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout((function(){"in"==n.hoverState&&n.show()}),n.options.delay.show)}},f.prototype.isInStateTrue=function(){for(var e in this.inState)if(this.inState[e])return!0;return!1},f.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusout"==t.type?"focus":"hover"]=!1),!n.isInStateTrue()){if(clearTimeout(n.timeout),n.hoverState="out",!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout((function(){"out"==n.hoverState&&n.hide()}),n.options.delay.hide)}},f.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var n=e.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!n)return;var r=this,i=this.tip(),o=this.getUID(this.type);this.setContent(),i.attr("id",o),this.$element.attr("aria-describedby",o),this.options.animation&&i.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,u=a.test(s);u&&(s=s.replace(a,"")||"top"),i.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?i.appendTo(e(document).find(this.options.container)):i.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var c=this.getPosition(),l=i[0].offsetWidth,h=i[0].offsetHeight;if(u){var d=s,p=this.getPosition(this.$viewport);s="bottom"==s&&c.bottom+h>p.bottom?"top":"top"==s&&c.top-hp.width?"left":"left"==s&&c.left-ls.top+s.height&&(i.top=s.top+s.height-u)}else{var f=t.left-o,c=t.left+o+n;fs.right&&(i.left=s.left+s.width-c)}return i},f.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)},f.prototype.getUID=function(e){do{e+=~~(1e6*Math.random())}while(document.getElementById(e));return e},f.prototype.tip=function(){if(!this.$tip&&(this.$tip=e(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},f.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},f.prototype.enable=function(){this.enabled=!0},f.prototype.disable=function(){this.enabled=!1},f.prototype.toggleEnabled=function(){this.enabled=!this.enabled},f.prototype.toggle=function(t){var n=this;t&&((n=e(t.currentTarget).data("bs."+this.type))||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n))),t?(n.inState.click=!n.inState.click,n.isInStateTrue()?n.enter(n):n.leave(n)):n.tip().hasClass("in")?n.leave(n):n.enter(n)},f.prototype.destroy=function(){var e=this;clearTimeout(this.timeout),this.hide((function(){e.$element.off("."+e.type).removeData("bs."+e.type),e.$tip&&e.$tip.detach(),e.$tip=null,e.$arrow=null,e.$viewport=null,e.$element=null}))},f.prototype.sanitizeHtml=function(e){return u(e,this.options.whiteList,this.options.sanitizeFn)};var l=e.fn.tooltip;e.fn.tooltip=c,e.fn.tooltip.Constructor=f,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=l,this}}(jQuery),function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");function n(n){return this.each((function(){var r=e(this),i=r.data("bs.popover"),o="object"==typeof n&&n;!i&&/destroy|hide/.test(n)||(i||r.data("bs.popover",i=new t(this,o)),"string"==typeof n&&i[n]())}))}t.VERSION="3.4.1",t.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();if(this.options.html){var r=typeof n;this.options.sanitize&&(t=this.sanitizeHtml(t),"string"===r&&(n=this.sanitizeHtml(n))),e.find(".popover-title").html(t),e.find(".popover-content").children().detach().end()["string"===r?"html":"append"](n)}else e.find(".popover-title").text(t),e.find(".popover-content").children().detach().end().text(n);e.removeClass("fade top bottom left right in"),e.find(".popover-title").html()||e.find(".popover-title").hide()},t.prototype.hasContent=function(){return this.getTitle()||this.getContent()},t.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||("function"==typeof t.content?t.content.call(e[0]):t.content)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var r=e.fn.popover;e.fn.popover=n,e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=r,this}}(jQuery),function(e){"use strict";function t(n,r){this.$body=e(document.body),this.$scrollElement=e(n).is(document.body)?e(window):e(n),this.options=e.extend({},t.DEFAULTS,r),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e.proxy(this.process,this)),this.refresh(),this.process()}function n(n){return this.each((function(){var r=e(this),i=r.data("bs.scrollspy"),o="object"==typeof n&&n;i||r.data("bs.scrollspy",i=new t(this,o)),"string"==typeof n&&i[n]()}))}t.VERSION="3.4.1",t.DEFAULTS={offset:10},t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},t.prototype.refresh=function(){var t=this,n="offset",r=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),e.isWindow(this.$scrollElement[0])||(n="position",r=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map((function(){var t=e(this),i=t.data("target")||t.attr("href"),o=/^#./.test(i)&&e(i);return o&&o.length&&o.is(":visible")&&[[o[n]().top+r,i]]||null})).sort((function(e,t){return e[0]-t[0]})).each((function(){t.offsets.push(this[0]),t.targets.push(this[1])}))},t.prototype.process=function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.getScrollHeight(),n=this.options.offset+t-this.$scrollElement.height(),r=this.offsets,i=this.targets,o=this.activeTarget,s;if(this.scrollHeight!=t&&this.refresh(),e>=n)return o!=(s=i[i.length-1])&&this.activate(s);if(o&&e=r[s]&&(void 0===r[s+1]||e .active"),s=i&&e.support.transition&&(o.length&&o.hasClass("fade")||!!r.find("> .fade").length);function a(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),n.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),s?(n[0].offsetWidth,n.addClass("in")):n.removeClass("fade"),n.parent(".dropdown-menu").length&&n.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}o.length&&s?o.one("bsTransitionEnd",a).emulateTransitionEnd(t.TRANSITION_DURATION):a(),o.removeClass("in")};var r=e.fn.tab;e.fn.tab=n,e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=r,this};var i=function(t){t.preventDefault(),n.call(e(this),"show")};e(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),function(e){"use strict";var t=function(n,r){this.options=e.extend({},t.DEFAULTS,r);var i=this.options.target===t.DEFAULTS.target?e(this.options.target):e(document).find(this.options.target);this.$target=i.on("scroll.bs.affix.data-api",e.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",e.proxy(this.checkPositionWithEventLoop,this)),this.$element=e(n),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function n(n){return this.each((function(){var r=e(this),i=r.data("bs.affix"),o="object"==typeof n&&n;i||r.data("bs.affix",i=new t(this,o)),"string"==typeof n&&i[n]()}))}t.VERSION="3.4.1",t.RESET="affix affix-top affix-bottom",t.DEFAULTS={offset:0,target:window},t.prototype.getState=function(e,t,n,r){var i=this.$target.scrollTop(),o=this.$element.offset(),s=this.$target.height();if(null!=n&&"top"==this.affixed)return i=e-r&&"bottom"},t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var e=this.$target.scrollTop(),n=this.$element.offset();return this.pinnedOffset=n.top-e},t.prototype.checkPositionWithEventLoop=function(){setTimeout(e.proxy(this.checkPosition,this),1)},t.prototype.checkPosition=function(){if(this.$element.is(":visible")){var n=this.$element.height(),r=this.options.offset,i=r.top,o=r.bottom,s=Math.max(e(document).height(),e(document.body).height());"object"!=typeof r&&(o=i=r),"function"==typeof i&&(i=r.top(this.$element)),"function"==typeof o&&(o=r.bottom(this.$element));var a=this.getState(s,n,i,o);if(this.affixed!=a){null!=this.unpin&&this.$element.css("top","");var u="affix"+(a?"-"+a:""),f=e.Event(u+".bs.affix");if(this.$element.trigger(f),f.isDefaultPrevented())return;this.affixed=a,this.unpin="bottom"==a?this.getPinnedOffset():null,this.$element.removeClass(t.RESET).addClass(u).trigger(u.replace("affix","affixed")+".bs.affix")}"bottom"==a&&this.$element.offset({top:s-n-o})}};var r=e.fn.affix;e.fn.affix=n,e.fn.affix.Constructor=t,e.fn.affix.noConflict=function(){return e.fn.affix=r,this},e(window).on("load",(function(){e('[data-spy="affix"]').each((function(){var t=e(this),r=t.data();r.offset=r.offset||{},null!=r.offsetBottom&&(r.offset.bottom=r.offsetBottom),null!=r.offsetTop&&(r.offset.top=r.offsetTop),n.call(t,r)}))}))}(jQuery)}}}},fibers:{"package.json":function e(t,n,e){e.exports={name:"fibers",version:"5.0.3",main:"fibers"}},"fibers.js":function e(t,n,e,r,i){if(process.fiberLib)e.exports=process.fiberLib;else{var o=t("fs"),s=t("path"),a=t("detect-libc");Math.random();var u=s.join(i,"bin",process.platform+"-"+process.arch+"-"+process.versions.modules+("linux"===process.platform?"-"+a.family:""),"fibers");try{process.fiberLib=e.exports=t(u).Fiber}catch(c){throw console.error("## There is an issue with `node-fibers` ##\n`"+u+".node` is missing.\n\nTry running this to fix the issue: "+process.execPath+" "+i.replace(" ","\\ ")+"/build"),console.error(c.stack||c.message||c),new Error("Missing binary. See message above.")}f(e.exports)}function f(e){try{var t=process.binding("async_wrap"),n;if(t.asyncIdStackSize instanceof Function)n=t.asyncIdStackSize;else{if(void 0===t.constants.kStackLength)throw new Error("Couldn't figure out how to get async stack size");l=t.constants.kStackLength,n=function(){return t.async_hook_fields[l]}}var r=t.popAsyncContext||t.popAsyncIds,i=t.pushAsyncContext||t.pushAsyncIds,o,s;if(!r||!i)throw new Error("Push/pop do not exist");o=void 0===t.constants.kExecutionAsyncId?t.constants.kCurrentAsyncId:t.constants.kExecutionAsyncId,s=void 0===t.constants.kTriggerAsyncId?t.constants.kCurrentTriggerId:t.constants.kTriggerAsyncId;var a=t.async_id_fields||t.async_uid_fields;function u(){for(var e=n(),t=new Array(e);e>0;--e){var i=a[o];t[e-1]={asyncId:i,triggerId:a[s]},r(i)}return t}function f(e){for(var t=0;t0)i.changeLanguage(e,r);else if(0!=a[u]){a[u]=0;var f=new XMLHttpRequest;f.overrideMimeType("application/json"),f.open("GET",u,!1),f.send(null),200===f.status?a[u]=1:a[u]=-1,n.addResourceBundle(e,s,JSON.parse(f.response)||{}),i.changeLanguage(e,r)}};n.changeLanguage=p;var g=function(e,t,n){return i.format(e,t,n)};n.format=g;var b=function(){return i.languages};n.getLanguages=b;var m=function(e,t){return i.loadLanguages(e,t)};n.loadLanguages=m;var v=function(e,t){return i.loadNamespaces(e,t)};n.loadNamespaces=v;var y=function(e,t){return i.on(e,t)};n.on=y;var _=function(e,t){return i.off(e,t)};n.off=_,r.__exportStar(t("./i18n/i18n"),n),r.__exportStar(t("./i18n/i18n.app"),n),r.__exportStar(t("./translations"),n)},i18n:{"i18n.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.fallbackKeys=n.getObjectI18nTemplate=n.translationI18nObjects=n.addObjectsI18n=n.translationI18nObject=void 0;var r=t("../index"),i=t("underscore"),o=t("clone"),s="_",a="base",u="core",f="translation",c=function(e,t){var n={lng:t,ns:f};if((0,r.exists)(e,n))return(0,r._t)(e,n)},l=function(e){return"".concat(e,"__object")},h=function(e,t){return t&&(t=t.replace(/\./g,"_")),"".concat(e).concat("_","field").concat("_").concat(t)},d=function(e,t){var n=h(e,t);return"".concat(n).concat("_","inlineHelpText")},p=function(e,t){var n=t.toLocaleLowerCase().replace(/\%/g,"_").replace(/\./g,"_").replace(/\ /g,"_");return"".concat(e).concat("_","group").concat("_").concat(n)},g=function(e,t,n){return t&&(t=t.replace(/\./g,"_")),"".concat(e).concat("_","field").concat("_").concat(t).concat("_","options").concat("_").concat(n)},b=function(e,t){return"".concat(e).concat("_","action").concat("_").concat(t)},m=function(e,t){return"".concat(e).concat("_","listview").concat("_").concat(t)},v=function(e){if(!e)return"";var t="core";return"default"!==e&&"meteor"!==e||(t="base"),t},y=function(e,t,n){var r=l(t);return c(r,e)||n||""},_=function(e,t,n,r,i){var o=h(t,n),s=c(o,e);if(!s){var a=v(i);a&&"base"!=t&&"core"!=t&&(s=_(e,a,n,r,i))}return s||r||""},w=function(e,t,n,r,i){var o=d(t,n),s=c(o,e);if(!s){var a=v(i);a&&"base"!=t&&"core"!=t&&(s=w(e,a,n,r,i))}return s||r||""},k=function(e,t,n,r){var i=p(t,n);return c(i,e)||r||""},j=function(e,t,n,r,i,o){var s=g(t,n,r),a=c(s,e);if(!a){var u=v(o);u&&"base"!=t&&"core"!=t&&(a=j(e,u,n,r,i,o))}return a||i||""},x=function(e,t,n,r,i){var o=b(t,n),s=c(o,e);if(!s){var a=v(i);a&&"base"!=t&&"core"!=t&&(s=x(e,a,n,r,i))}return s||r||""},S=function(e,t,n,r,i){var o=m(t,n),s=c(o,e);if(!s){var a=v(i);a&&"base"!=t&&"core"!=t&&(s=S(e,a,n,r,i))}return s||r||""},D=function(e){var t;return(t=e.split(":")).length>1?{label:t[0],value:t[1]}:{label:t[0],value:t[0]}},E=function(e){i.forEach(e.fields,(function(e,t){var n=[];if(e.options&&i.isString(e.options))try{i.forEach(e.options.split("\n"),(function(e){var t;return e.indexOf(",")?(t=e.split(","),i.forEach(t,(function(e){return n.push(D(e))}))):n.push(D(e))})),e.options=n}catch(r){console.error("convertFieldsOptions error: ",e.options,r)}else e.options&&!i.isFunction(e.options)&&!i.isArray(e.options)&&i.isObject(e.options)&&(i.each(e.options,(function(e,t){return n.push({label:e,value:t})})),e.options=n)}))},A=function(e,t,n){n.label=y(e,t,n.label),i.each(n.fields,(function(r,o){if(r.label=_(e,t,o,r.label,n.datasource),r.inlineHelpText&&(r.inlineHelpText=w(e,t,o,r.inlineHelpText,n.datasource)),r.group&&(r.group=k(e,t,r.group,r.group)),r.options){var s=[];i.each(r.options,(function(r){if(i.has(r,"value")){var a=j(e,t,o,r.value,r.label,n.datasource);s.push(i.extend({},r,{label:a}))}else s.push(r)})),r.options=s}})),i.each(n.actions,(function(r,i){r.label=x(e,t,i,r.label,n.datasource)})),i.each(n.list_views,(function(r,i){r.label=S(e,t,i,r.label,n.datasource)}))};n.translationI18nObject=A;var C=function(e){i.each(e,(function(e){(0,r.addResourceBundle)(e.lng,f,e.data,!0,!0)}))};n.addObjectsI18n=C;var M=function(e,t){i.each(t,(function(t,r){(0,n.translationI18nObject)(e,r,t)}))};n.translationI18nObjects=M;var O=function(e,t,n){var r=o(n);E(r);var s={};return s[l(t)]=y(e,t,r.label),i.each(r.fields,(function(n,o){s[h(t,o)]=_(e,t,o,n.label),n.inlineHelpText&&(s[d(t,o)]=w(e,t,o,n.inlineHelpText,r.datasource)),n.group&&(s[p(t,n.group)]=k(e,t,n.group,n.group)),n.options&&i.each(n.options,(function(n){i.has(n,"value")&&(s[g(t,o,n.value)]=j(e,t,o,n.value,n.label))}))})),i.each(r.actions,(function(n,r){s[b(t,r)]=x(e,t,r,n.label)})),i.each(r.list_views,(function(n,r){s[m(t,r)]=S(e,t,r,n.label)})),s};n.getObjectI18nTemplate=O,n.fallbackKeys={getObjectLabelKey:l,getObjectFieldLabelKey:h,getObjectFieldInlineHelpTextLabelKey:d,getObjectFieldGroupKey:p,getObjectFieldOptionsLabelKey:g,getObjectActionLabelKey:b,getObjectListviewLabelKey:m}},"i18n.app.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.appFallbackKeys=n.getAppI18nTemplate=n.translationI18nApps=n.translationI18nMenus=void 0;var r=t("../index"),i=t("underscore"),o=t("clone"),s="translation",a="_",u=function(e,t){var n={lng:t,ns:s};if((0,r.exists)(e,n))return(0,r._t)(e,n)},f=function(e){return"app".concat("_").concat(e).concat("_","name")},c=function(e){return"app".concat("_").concat(e).concat("_","description")},l=function(e,t){var n=t.toLocaleLowerCase().replace(/\%/g,"_").replace(/\./g,"_").replace(/\ /g,"_");return"".concat(e).concat("_","tab_group").concat("_").concat(n)},h=function(e){return"menu".concat("_").concat(e)},d=function(e){return"tab".concat("_").concat(e)},p=function(e,t,n){var r=f(t);return u(r,e)||n||""},g=function(e,t,n){var r=c(t);return u(r,e)||n||""},b=function(e,t,n){var r=h(t);return u(r,e)||n||""},m=function(e,t,r){r.label=p(e,t,r.label||r.name),r.description=g(e,t,r.description),(0,n.translationI18nMenus)(e,r.admin_menus)},v=function(e,t){i.each(t,(function(t){var n=b(e,t._id,t.label||t.name);t.label=n,t.name=n}))};n.translationI18nMenus=v;var y=function(e,t){i.each(t,(function(t,n){m(e,n,t)}))};n.translationI18nApps=y;var _=function(e,t,n){var r=o(n),s={};return s[f(t)]=p(e,t,r.label||r.name),s[c(t)]=g(e,t,r.description),i.each(r.admin_menus,(function(t){s[h(t._id)]=b(e,t._id,t.label||t.name)})),s};n.getAppI18nTemplate=_,n.appFallbackKeys={getAppLabelKey:f,getAppDescriptionKey:c,getAppGroupKey:l,getMenuLabelKey:h,getTabKey:d}}},translations:{"index.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.SteedosTranslationPrefixKeys=n.convertObject=void 0;var r=t("tslib"),i=t("underscore");r.__exportStar(t("./objectTranslation"),n),r.__exportStar(t("./translation"),n),r.__exportStar(t("./templates/objectTranslation"),n),r.__exportStar(t("./templates/translation"),n);var o=function(e){var t;return(t=e.split(":")).length>1?{label:t[0],value:t[1]}:{label:t[0],value:t[0]}},s=function(e){i.forEach(e.fields,(function(e,t){var n=[];if(e.options&&i.isString(e.options))try{i.forEach(e.options.split("\n"),(function(e){var t;e.indexOf(",")?(t=e.split(","),i.forEach(t,(function(e){return n.push(o(e))}))):n.push(o(e))})),e.options=n}catch(r){console.error("convertFieldsOptions error: ",e.options,r)}else if(e.options&&i.isArray(e.options))try{i.forEach(e.options,(function(e){i.isString(e)?n.push(o(e)):n.push(e)})),e.options=n}catch(r){console.error("Creator.convertFieldsOptions",e.options,r)}else e.options&&!i.isFunction(e.options)&&!i.isArray(e.options)&&i.isObject(e.options)&&(i.each(e.options,(function(e,t){return n.push({label:e,value:t})})),e.options=n)}))},a;n.convertObject=s,function(e){e.Object="CustomObject",e.Field="CustomField",e.Action="CustomAction",e.Listview="CustomListview",e.Permission="CustomPermission",e.ValidationRule="CustomValidationRule",e.Application="CustomApplication",e.Tab="CustomTabs",e.Permissionset="CustomPermissionset",e.Profile="CustomProfile",e.Report="CustomReport",e.Workflow="Workflow",e.Layout="Layout",e.Client="Client",e.Server="Server",e.Function="Function",e.Router="Router",e.Trigger="Trigger"}(a=n.SteedosTranslationPrefixKeys||(n.SteedosTranslationPrefixKeys={}))},"objectTranslation.js":function e(t,n,e,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.addObjectsTranslation=n.getObjectTranslationTemplate=n.translationObjects=n.translationObject=n.translationObjectLabel=void 0;var i=t("underscore"),o=t("./"),s=t("../index"),a=t("./index"),u=t("../i18n/i18n"),f=t("lodash"),c=t("crypto"),l,h=(0,t("@steedos/cachers").getCacher)("lru.translations.objects");function d(e){var t;return c.createHash("md5").update(e).digest("hex")}var p=function(e,t){return"".concat(e,"_").concat(t.name,"_").concat(d(JSON.stringify(t)))},g=t("clone"),b=".",m="base",v="core",y="translation",_="object",w="field",k="listview",j="action",x=function(e,t){var n={lng:t,ns:y,keySeparator:!1};if((0,s.exists)(e,n))return(0,s._t)(e,n)},S=function(e){if(!e)return"";var t="core";return"default"!==e&&"meteor"!==e||(t="base"),t},D=function(e){switch(e){case"object":return o.SteedosTranslationPrefixKeys.Object;case"field":return o.SteedosTranslationPrefixKeys.Field;case"listview":return o.SteedosTranslationPrefixKeys.Listview;case"action":return o.SteedosTranslationPrefixKeys.Action;default:return"CustomLabels"}},E=function(e){var t;return[D(),e].join(".")},A=function(e){var t;return[D("object"),e,"label"].join(".")},C=function(e){var t;return[D("object"),e,"description"].join(".")},M=function(e,t){var n;return t&&(t=t.replace(/\./g,"_")),[D("field"),e,t,"label"].join(".")},O=function(e,t){var n;return t&&(t=t.replace(/\./g,"_")),[D("field"),e,t,"help"].join(".")},T=function(e,t){var n;return t&&(t=t.replace(/\./g,"_")),[D("field"),e,t,"description"].join(".")},B=function(e,t){var n=t.toLocaleLowerCase().replace(/\%/g,"_").replace(/\./g,"_").replace(/\ /g,"_"),r;return[D("field"),e,"group",n].join(".")},I=function(e,t,n){var r;return t&&(t=t.replace(/\./g,"_")),[D("field"),e,t,"options",n].join(".")},R=function(e,t){var n;return[D("action"),e,t].join(".")},F=function(e,t){var n;return[D("listview"),e,t].join(".")},P=function(e,t,n){var r,i=[A(t)],o=u.fallbackKeys.getObjectLabelKey(t);return o&&i.push(o),x(i,e)||n||""};n.translationObjectLabel=P;var N=function(e,t,n){var r=C(t);return x(r,e)||n||""},L=function(e,t,n,r,i,o){var s,a=[M(t,n)],f=u.fallbackKeys.getObjectFieldLabelKey(t,n);f&&a.push(f);var c=x(a,e);if(1!=o&&!c){var l=S(i);l&&"base"!=t&&"core"!=t&&(c=L(e,l,n,r,i))}return c||r||""},z=function(e,t,n,r,i,o){var s,a=[O(t,n)],f=u.fallbackKeys.getObjectFieldInlineHelpTextLabelKey(t,n);f&&a.push(f);var c=x(a,e);if(1!=o&&!c){var l=S(i);l&&"base"!=t&&"core"!=t&&(c=z(e,l,n,r,i))}return c||r||""},U=function(e,t,n,r,i,o){var s=T(t,n),a,u=x([s],e);if(1!=o&&!u){var f=S(i);f&&"base"!=t&&"core"!=t&&(u=U(e,f,n,r,i))}return u||r||""},q=function(e,t,n,r,i,o){var s,a=[B(t,n)],f=u.fallbackKeys.getObjectFieldGroupKey(t,n);f&&a.push(f);var c=x(a,e);if(1!=o&&!c){var l=S(i);l&&"base"!=t&&"core"!=t&&(c=q(e,l,n,r,i))}return c||r||""},$=function(e,t,n,r,i,o,s){var a,f=[I(t,n,r)],c=u.fallbackKeys.getObjectFieldOptionsLabelKey(t,n,r);c&&f.push(c);var l=x(f,e);if(1!=s&&!l){var h=S(o);h&&"base"!=t&&"core"!=t&&(l=$(e,h,n,r,i,o))}return l||i||""},H=function(e,t,n,r,i,o){var s,a=[R(t,n)],f=u.fallbackKeys.getObjectActionLabelKey(t,n);f&&a.push(f);var c=x(a,e);if(1!=o&&!c){var l=S(i);l&&"base"!=t&&"core"!=t&&(c=H(e,l,n,r,i))}return c||r||""},W=function(e,t,n,r,i,o){var s,a=[F(t,n)],f=u.fallbackKeys.getObjectListviewLabelKey(t,n);f&&a.push(f);var c=x(a,e);if(1!=o&&!c){var l=S(i);l&&"base"!=t&&"core"!=t&&(c=W(e,l,n,r,i))}return c||r||""},Y=function(e,t,r,o,s){void 0===s&&(s=!1);var u=p(e,r);"test_obj_layout1"===t&&console.log("translationObject",t,u);var c=h.get(u);if(c)return Object.assign(r,(0,f.cloneDeep)(c));o&&(0,a.convertObject)(r),r.label=(0,n.translationObjectLabel)(e,t,r.label),r.description=N(e,t,r.description),i.each(r.fields,(function(n,o){if(n.label=L(e,t,o,n.label,r.datasource,s),n.inlineHelpText&&(n.inlineHelpText=z(e,t,o,n.inlineHelpText,r.datasource,s)),n.group&&(n.group=q(e,t,n.group,n.group,r.datasource,s)),n.options){var a=[];i.each(n.options,(function(n){if(i.has(n,"value")){var u=$(e,t,o,n.value,n.label,r.datasource,s);a.push(i.extend({},n,{label:u}))}else a.push(n)})),n.options=a}})),i.each(r.actions,(function(n,i){n.label=H(e,t,i,n.label,r.datasource,s)})),i.each(r.list_views,(function(n,i){n.label=W(e,t,i,n.label,r.datasource,s)})),h.set(u,(0,f.cloneDeep)(r))};n.translationObject=Y;var V=function(e,t){i.each(t,(function(t,r){(0,n.translationObject)(e,r,t)}))};n.translationObjects=V;var K=function(e,t,r){var o=g(r);(0,a.convertObject)(o);var s={};return s[A(t)]=(0,n.translationObjectLabel)(e,t,o.label),s[C(t)]=N(e,t,o.description),i.each(o.fields,(function(n,r){s[M(t,r)]=L(e,t,r,n.label),n.inlineHelpText&&(s[O(t,r)]=z(e,t,r,n.inlineHelpText,o.datasource)),n.description&&(s[T(t,r)]=U(e,t,r,n.description,o.datasource)),n.group&&(s[B(t,n.group)]=q(e,t,n.group,n.group,o.datasource)),n.options&&i.each(n.options,(function(n){i.has(n,"value")&&(s[I(t,r,n.value)]=$(e,t,r,n.value,n.label))}))})),i.each(o.actions,(function(n,r){s[R(t,r)]=H(e,t,r,n.label)})),i.each(o.list_views,(function(n,r){s[F(t,r)]=W(e,t,r,n.label)})),s};function G(e,t){var n=g(e);(0,a.convertObject)(n);var r={},o=n.name;return o||console.error("Error: Invalid objectTranslation:"+t),r[A(o)]=n.label,r[C(o)]=n.description,i.each(n.fields,(function(e,t){r[M(o,t)]=e.label,e.help&&(r[O(o,t)]=e.help),e.description&&(r[T(o,t)]=e.description),e.options&&i.each(e.options,(function(e){i.has(e,"value")&&(r[I(o,t,e.value)]=e.label)}))})),i.each(n.groups,(function(e,t){r[B(o,t)]=e})),i.each(n.actions,(function(e,t){r[R(o,t)]=e.label})),i.each(n.listviews,(function(e,t){r[F(o,t)]=e.label})),i.each(n.CustomLabels,(function(e,t){r[E(t)]=e})),r}n.getObjectTranslationTemplate=K;var X=function(e){i.each(e,(function(e){var t=G(e.data,e.__filename);(0,s.addResourceBundle)(e.lng,y,t,!0,!0)}))};n.addObjectsTranslation=X},"translation.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.addTranslations=n.convertTranslation=n.convertTranslationData=n.getAppTranslationTemplate=n.translationApps=n.translationMenus=n.translationApp=n.translationTabLabel=n.translationTabGroup=void 0;var r=t("../index"),i=t("underscore"),o=t("./"),s=t("../i18n/i18n.app"),a=t("clone"),u="translation",f=".",c="app",l="menu",h="tab",d=function(e){switch(e){case"app":return o.SteedosTranslationPrefixKeys.Application;case"tab":return o.SteedosTranslationPrefixKeys.Tab;default:return"CustomLabels"}},p=function(e){var t;return[d(),e].join(".")},g=function(e,t){var n={lng:t,ns:u,keySeparator:!1};if((0,r.exists)(e,n))return(0,r._t)(e,n)},b=function(e){var t;return[d("app"),e,"name"].join(".")},m=function(e){var t;return[d("app"),e,"description"].join(".")},v=function(e,t){var n,r;return[d("app"),e,"groups",t.toLocaleLowerCase().replace(/\%/g,"_").replace(/\./g,"_").replace(/\ /g,"_")].join(".")},y=function(e){var t;return[d("menu"),"menu_".concat(e)].join(".")},_=function(e){var t;return[d("tab"),e].join(".")},w=function(e,t,n){var r,i=[b(t)],o=s.appFallbackKeys.getAppLabelKey(t);return o&&i.push(o),g(i,e)||n||""},k=function(e,t,n){var r,i=[m(t)],o=s.appFallbackKeys.getAppDescriptionKey(t);return o&&i.push(o),g(i,e)||n||""},j=function(e,t,n,r){var i,o=[v(t,n)],a=s.appFallbackKeys.getAppGroupKey(t,n);return a&&o.push(a),g(o,e)||r||""};n.translationTabGroup=j;var x=function(e,t,n){var r,i=[y(t)],o=s.appFallbackKeys.getMenuLabelKey(t);return o&&i.push(o),g(i,e)||n||""},S=function(e,t,n){var r,i=[_(t)],o=s.appFallbackKeys.getTabKey(t);return o&&i.push(o),g(i,e)||n||""};n.translationTabLabel=S;var D=function(e,t,r){r.label=w(e,t,r.label||r.name),r.description=k(e,t,r.description),i.each(r.tab_groups,(function(i,o){r.tab_groups[o].id=i.id||i.group_name,r.tab_groups[o].group_name=(0,n.translationTabGroup)(e,t,i.group_name,i.group_name)})),(0,n.translationMenus)(e,r.admin_menus)};n.translationApp=D;var E=function(e,t){i.each(t,(function(t){var n=x(e,t._id,t.label||t.name);t.label=n,t.name=n}))};n.translationMenus=E;var A=function(e,t){i.each(t,(function(t,r){(0,n.translationApp)(e,r,t)}))};n.translationApps=A;var C=function(e,t,n){var r=a(n),o={};return o[b(t)]=w(e,t,r.label||r.name),o[m(t)]=k(e,t,r.description),i.each(r.admin_menus,(function(t){o[y(t._id)]=x(e,t._id,t.label||t.name)})),o};n.getAppTranslationTemplate=C;var M=function(e,t,n){i.isArray(n)?i.each(n,(function(e){M(e,"",e)})):n&&i.each(i.keys(n),(function(r){var o=t?"".concat(t,".").concat(r):r,s=n[r];"object"==typeof s?i.isArray(s)?i.each(s,(function(e){M(e,o,s)})):M(e,o,s):e[o]=s}))};function O(e){for(var t in e)"object"==typeof e[t]&&M(e,t,e[t]);return e}n.convertTranslationData=O;var T=function(e){var t=a(e),n={};return i.each(t.CustomApplications,(function(e,t){n[b(t)]=e.name,n[m(t)]=e.description,i.each(e.groups,(function(e,r){n[v(t,r)]=e}))})),i.each(t.CustomTabs,(function(e,t){n[_(t)]=e})),i.each(t.CustomLabels,(function(e,t){var r;if("simpleschema"!=t&&i.isObject(e)){var o=O(((r={})[t]=e,r));i.each(o,(function(e,t){i.isObject(e)||(n[p(t)]=e)}))}else n[p(t)]=e})),n};n.convertTranslation=T;var B=function(e){i.each(e,(function(e){var t=(0,n.convertTranslation)(e.data);(0,r.addResourceBundle)(e.lng,u,t,!0,!0)}))};n.addTranslations=B},templates:{"objectTranslation.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getObjectMetadataTranslationTemplate=void 0;var r=t("underscore"),i=t("../index"),o=t("clone");function s(e,t){var n={};return r.each(e,(function(e){n[e]="help"===e?t.inlineHelpText||"":t[e]||""})),n}function a(e){return s(["label","description"],e)}function u(e){switch(e.type){case"select":return s(["label","help","options","description"],e);default:return s(["label","help","description"],e)}}function f(e){return s(["label"],e)}function c(e){return s(["label"],e)}function l(e){var t={};return r.each(e,(function(e,n){t[n]=u(e)})),t}function h(e){var t={};return r.each(e,(function(e,n){t[n]=c(e)})),t}function d(e){var t={};return r.each(e,(function(e,n){t[n]=f(e)})),t}function p(e,t){var n={};return r.each(e,(function(e,r){if(e.group){var i=e.group.toLocaleLowerCase().replace(/\%/g,"_").replace(/\./g,"_").replace(/\ /g,"_");n[i]=t[r].group}})),n}var g=function(e,t,n,s){void 0===s&&(s=!1);var u=o(n);1!=s&&(0,i.translationObject)(e,t,u,!0,s);var f=Object.assign({},a(u));f=Object.assign({},f,{fields:l(u.fields)});var c=p(n.fields,u.fields);r.isEmpty(c)||(f=Object.assign({},f,{groups:c}));var g=d(u.list_views);r.isEmpty(g)||(f=Object.assign({},f,{listviews:g}));var b=h(u.actions);return r.isEmpty(b)||(f=Object.assign({},f,{actions:b})),Object.assign({name:t},f)};n.getObjectMetadataTranslationTemplate=g},"translation.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getAppMetadataTranslationTemplate=void 0;var r=t("underscore"),i=t("../index"),o=t("clone");function s(e,t){var n={};return r.each(e,(function(e){n[e]=t[e]||""})),n}function a(e){var t={groups:{}};return e?(r.each(e,(function(e){var n=e.group_name.toLocaleLowerCase().replace(/\%/g,"_").replace(/\./g,"_").replace(/\ /g,"_");t.groups[n]=e.group_name})),t):{}}var u=function(e){return Object.assign({},s(["name","description"],e),a(e.tab_groups))},f=function(e){var t={};return r.each(e,(function(e,n){t[n]=n})),t},c=function(e){var t={};return r.each(e,(function(e){var n=e.toLocaleLowerCase().replace(/\%/g,"_").replace(/\./g,"_").replace(/\ /g,"_");t[n]=e})),t},l=function(e,t,n){var r,s=o(n);(0,i.translationApp)(e,t,s);var a={},l;return s.tab_items?a=f(s.tab_items):s.tabs&&(a=c(s.tabs)),Object.assign({},{CustomApplications:(r={},r[t]=u(s),r)},{CustomTabs:a})};n.getAppMetadataTranslationTemplate=l}}}},node_modules:{i18next:{"package.json":function e(t,n,e){e.exports={name:"i18next",version:"19.9.2",module:"./dist/esm/i18next.js",main:"./dist/cjs/i18next.js"}},dist:{esm:{"i18next.js":function e(t,n,e){let r,i,o,s,a,u,f,c;e.link("@babel/runtime/helpers/esm/typeof",{default(e){r=e}},0),e.link("@babel/runtime/helpers/esm/objectSpread",{default(e){i=e}},1),e.link("@babel/runtime/helpers/esm/classCallCheck",{default(e){o=e}},2),e.link("@babel/runtime/helpers/esm/createClass",{default(e){s=e}},3),e.link("@babel/runtime/helpers/esm/possibleConstructorReturn",{default(e){a=e}},4),e.link("@babel/runtime/helpers/esm/getPrototypeOf",{default(e){u=e}},5),e.link("@babel/runtime/helpers/esm/assertThisInitialized",{default(e){f=e}},6),e.link("@babel/runtime/helpers/esm/inherits",{default(e){c=e}},7);var l={type:"logger",log:function e(t){this.output("log",t)},warn:function e(t){this.output("warn",t)},error:function e(t){this.output("error",t)},output:function e(t,n){console&&console[t]&&console[t].apply(console,n)}},h,d=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this.init(t,n)}return s(e,[{key:"init",value:function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||l,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function e(t){this.debug=t}},{key:"log",value:function e(){for(var t=arguments.length,n=new Array(t),r=0;r1?n-1:0),i=1;i-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function y(e,t,n){var r=v(e,t,Object),i,o;r.obj[r.k]=n}function _(e,t,n,r){var i=v(e,t,Object),o=i.obj,s=i.k;o[s]=o[s]||[],r&&(o[s]=o[s].concat(n)),r||o[s].push(n)}function w(e,t){var n=v(e,t),r=n.obj,i=n.k;if(r)return r[i]}function k(e,t,n){var r=w(e,n);return void 0!==r?r:w(t,n)}function j(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):j(e[r],t[r],n):e[r]=t[r]);return e}function x(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var S={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function D(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return S[e]})):e}var E="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,A=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return o(this,t),n=a(this,u(t).call(this)),E&&p.call(f(n)),n.data=e||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return c(t,e),s(t,[{key:"addNamespaces",value:function e(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function e(t){var n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}},{key:"getResource",value:function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,s=[t,n];return r&&"string"!=typeof r&&(s=s.concat(r)),r&&"string"==typeof r&&(s=s.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(s=t.split(".")),w(this.data,s)}},{key:"addResource",value:function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},s=this.options.keySeparator;void 0===s&&(s=".");var a=[t,n];r&&(a=a.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(i=n,n=(a=t.split("."))[1]),this.addNamespaces(n),y(this.data,a,i),o.silent||this.emit("added",t,n,r,i)}},{key:"addResources",value:function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in r)"string"!=typeof r[o]&&"[object Array]"!==Object.prototype.toString.apply(r[o])||this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}},{key:"addResourceBundle",value:function e(t,n,r,o,s){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},u=[t,n];t.indexOf(".")>-1&&(o=r,r=n,n=(u=t.split("."))[1]),this.addNamespaces(n);var f=w(this.data,u)||{};o?j(f,r,s):f=i({},f,r),y(this.data,u,f),a.silent||this.emit("added",t,n,r)}},{key:"removeResourceBundle",value:function e(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}},{key:"hasResourceBundle",value:function e(t,n){return void 0!==this.getResource(t,n)}},{key:"getResourceBundle",value:function e(t,n){return n||(n=this.options.defaultNS),"v1"===this.options.compatibilityAPI?i({},{},this.getResource(t,n)):this.getResource(t,n)}},{key:"getDataByLanguage",value:function e(t){return this.data[t]}},{key:"toJSON",value:function e(){return this.data}}]),t}(p),C={processors:{},addPostProcessor:function e(t){this.processors[t.name]=t},handle:function e(t,n,r,i,o){var s=this;return t.forEach((function(e){s.processors[e]&&(n=s.processors[e].process(n,r,i,o))})),n}},M={},O=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o(this,t),n=a(this,u(t).call(this)),E&&p.call(f(n)),m(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,f(n)),n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=d.create("translator"),n}return c(t,e),s(t,[{key:"changeLanguage",value:function e(t){t&&(this.language=t)}},{key:"exists",value:function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},r=this.resolve(t,n);return r&&void 0!==r.res}},{key:"extractFromKey",value:function e(t,n){var r=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");var i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=n.ns||this.options.defaultNS;if(r&&t.indexOf(r)>-1){var s=t.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:t,namespaces:o};var a=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(a[0])>-1)&&(o=a.shift()),t=a.join(i)}return"string"==typeof o&&(o=[o]),{key:t,namespaces:o}}},{key:"translate",value:function e(n,o,s){var a=this;if("object"!==r(o)&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),null==n)return"";Array.isArray(n)||(n=[String(n)]);var u=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,f=this.extractFromKey(n[n.length-1],o),c=f.key,l=f.namespaces,h=l[l.length-1],d=o.lng||this.language,p=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(p){var g=o.nsSeparator||this.options.nsSeparator;return h+g+c}return c}var b=this.resolve(n,o),m=b&&b.res,v=b&&b.usedKey||c,y=b&&b.exactUsedKey||c,_=Object.prototype.toString.apply(m),w=["[object Number]","[object Function]","[object RegExp]"],k=void 0!==o.joinArrays?o.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject,x="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(j&&m&&x&&w.indexOf(_)<0&&("string"!=typeof k||"[object Array]"!==_)){if(!o.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,m,o):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");if(u){var S="[object Array]"===_,D=S?[]:{},E=S?y:v;for(var A in m)if(Object.prototype.hasOwnProperty.call(m,A)){var C="".concat(E).concat(u).concat(A);D[A]=this.translate(C,i({},o,{joinArrays:!1,ns:l})),D[A]===C&&(D[A]=m[A])}m=D}}else if(j&&"string"==typeof k&&"[object Array]"===_)(m=m.join(k))&&(m=this.extendTranslation(m,n,o,s));else{var M=!1,O=!1,T=void 0!==o.count&&"string"!=typeof o.count,B=t.hasDefaultValue(o),I=T?this.pluralResolver.getSuffix(d,o.count):"",R=o["defaultValue".concat(I)]||o.defaultValue;!this.isValidLookup(m)&&B&&(M=!0,m=R),this.isValidLookup(m)||(O=!0,m=c);var F=B&&R!==m&&this.options.updateMissing;if(O||M||F){if(this.logger.log(F?"updateKey":"missingKey",d,h,c,F?R:m),u){var P=this.resolve(c,i({},o,{keySeparator:!1}));P&&P.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var N=[],L=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if("fallback"===this.options.saveMissingTo&&L&&L[0])for(var z=0;z1&&void 0!==arguments[1]?arguments[1]:{},i,o,s,a,u;return"string"==typeof t&&(t=[t]),t.forEach((function(e){if(!n.isValidLookup(i)){var t=n.extractFromKey(e,r),f=t.key;o=f;var c=t.namespaces;n.options.fallbackNS&&(c=c.concat(n.options.fallbackNS));var l=void 0!==r.count&&"string"!=typeof r.count,h=void 0!==r.context&&"string"==typeof r.context&&""!==r.context,d=r.lngs?r.lngs:n.languageUtils.toResolveHierarchy(r.lng||n.language,r.fallbackLng);c.forEach((function(e){n.isValidLookup(i)||(u=e,!M["".concat(d[0],"-").concat(e)]&&n.utils&&n.utils.hasLoadedNamespace&&!n.utils.hasLoadedNamespace(u)&&(M["".concat(d[0],"-").concat(e)]=!0,n.logger.warn('key "'.concat(o,'" for languages "').concat(d.join(", "),'" won\'t get resolved as namespace "').concat(u,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach((function(t){if(!n.isValidLookup(i)){a=t;var o=f,u=[o],c,d;if(n.i18nFormat&&n.i18nFormat.addLookupKeys)n.i18nFormat.addLookupKeys(u,f,t,e,r);else l&&(c=n.pluralResolver.getSuffix(t,r.count)),l&&h&&u.push(o+c),h&&u.push(o+="".concat(n.options.contextSeparator).concat(r.context)),l&&u.push(o+=c);for(;d=u.pop();)n.isValidLookup(i)||(s=d,i=n.getResource(t,e,d,r))}})))}))}})),{res:i,usedKey:o,exactUsedKey:s,usedLng:a,usedNS:u}}},{key:"isValidLookup",value:function e(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}},{key:"getResource",value:function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}}],[{key:"hasDefaultValue",value:function e(t){var n="defaultValue";for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&void 0!==t[r])return!0;return!1}}]),t}(p);function T(e){return e.charAt(0).toUpperCase()+e.slice(1)}var B=function(){function e(t){o(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=d.create("languageUtils")}return s(e,[{key:"getScriptPartFromCode",value:function e(t){if(!t||t.indexOf("-")<0)return null;var n=t.split("-");return 2===n.length?null:(n.pop(),"x"===n[n.length-1].toLowerCase()?null:this.formatLanguageCode(n.join("-")))}},{key:"getLanguagePartFromCode",value:function e(t){if(!t||t.indexOf("-")<0)return t;var n=t.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function e(t){if("string"==typeof t&&t.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],r=t.split("-");return this.options.lowerCaseLng?r=r.map((function(e){return e.toLowerCase()})):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=T(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=T(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=T(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isWhitelisted",value:function e(t){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(t)}},{key:"isSupportedCode",value:function e(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function e(t){var n=this,r;return t?(t.forEach((function(e){if(!r){var t=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(t)||(r=t)}})),!r&&this.options.supportedLngs&&t.forEach((function(e){if(!r){var t=n.getLanguagePartFromCode(e);if(n.isSupportedCode(t))return r=t;r=n.options.supportedLngs.find((function(e){if(0===e.indexOf(t))return e}))}})),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r):null}},{key:"getFallbackCodes",value:function e(t,n){if(!t)return[];if("function"==typeof t&&(t=t(n)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!n)return t.default||[];var r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}},{key:"toResolveHierarchy",value:function e(t,n){var r=this,i=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],s=function e(t){t&&(r.isSupportedCode(t)?o.push(t):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&s(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&s(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&s(this.getLanguagePartFromCode(t))):"string"==typeof t&&s(this.formatLanguageCode(t)),i.forEach((function(e){o.indexOf(e)<0&&s(r.formatLanguageCode(e))})),o}}]),e}(),I=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],R={1:function e(t){return Number(t>1)},2:function e(t){return Number(1!=t)},3:function e(t){return 0},4:function e(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function e(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function e(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function e(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function e(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function e(t){return Number(t>=2)},10:function e(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function e(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function e(t){return Number(t%10!=1||t%100==11)},13:function e(t){return Number(0!==t)},14:function e(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function e(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function e(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function e(t){return Number(1==t||t%10==1&&t%100!=11?0:1)},18:function e(t){return Number(0==t?0:1==t?1:2)},19:function e(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function e(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function e(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function e(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}};function F(){var e={};return I.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:R[t.fc]}}))})),e}var P=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this.languageUtils=t,this.options=n,this.logger=d.create("pluralResolver"),this.rules=F()}return s(e,[{key:"addRule",value:function e(t,n){this.rules[t]=n}},{key:"getRule",value:function e(t){return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function e(t){var n=this.getRule(t);return n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function e(t,n){return this.getSuffixes(t).map((function(e){return n+e}))}},{key:"getSuffixes",value:function e(t){var n=this,r=this.getRule(t);return r?r.numbers.map((function(e){return n.getSuffix(t,e)})):[]}},{key:"getSuffix",value:function e(t,n){var r=this,i=this.getRule(t);if(i){var o=i.noAbs?i.plurals(n):i.plurals(Math.abs(n)),s=i.numbers[o];this.options.simplifyPluralSuffix&&2===i.numbers.length&&1===i.numbers[0]&&(2===s?s="plural":1===s&&(s=""));var a=function e(){return r.options.prepend&&s.toString()?r.options.prepend+s.toString():s.toString()};return"v1"===this.options.compatibilityJSON?1===s?"":"number"==typeof s?"_plural_".concat(s.toString()):a():"v2"===this.options.compatibilityJSON?a():this.options.simplifyPluralSuffix&&2===i.numbers.length&&1===i.numbers[0]?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: ".concat(t)),""}}]),e}(),N=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e),this.logger=d.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return s(e,[{key:"init",value:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var n=t.interpolation;this.escape=void 0!==n.escape?n.escape:D,this.escapeValue=void 0===n.escapeValue||n.escapeValue,this.useRawValueToEscape=void 0!==n.useRawValueToEscape&&n.useRawValueToEscape,this.prefix=n.prefix?x(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?x(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?x(n.nestingPrefix):n.nestingPrefixEscaped||x("$t("),this.nestingSuffix=n.nestingSuffix?x(n.nestingSuffix):n.nestingSuffixEscaped||x(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=void 0!==n.alwaysFormat&&n.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function e(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function e(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(n,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function e(t,n,r,i){var o=this,s,a,u,f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var l=function e(t){if(t.indexOf(o.formatSeparator)<0){var s=k(n,f,t);return o.alwaysFormat?o.format(s,void 0,r):s}var a=t.split(o.formatSeparator),u=a.shift().trim(),c=a.join(o.formatSeparator).trim();return o.format(k(n,f,u),c,r,i)};this.resetRegExp();var h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,d=i&&i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,p;return[{regex:this.regexpUnescape,safeValue:function e(t){return c(t)}},{regex:this.regexp,safeValue:function e(t){return o.escapeValue?c(o.escape(t)):c(t)}}].forEach((function(e){for(u=0;s=e.regex.exec(t);){if(void 0===(a=l(s[1].trim())))if("function"==typeof h){var n=h(t,s,i);a="string"==typeof n?n:""}else{if(d){a=s[0];continue}o.logger.warn("missed to pass in variable ".concat(s[1]," for interpolating ").concat(t)),a=""}else"string"==typeof a||o.useRawValueToEscape||(a=b(a));if(t=t.replace(s[0],e.safeValue(a)),e.regex.lastIndex=0,++u>=o.maxReplaces)break}})),t}},{key:"nest",value:function e(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s,a,u=i({},o);function f(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),o="{".concat(r[1]);e=r[0],o=(o=this.interpolate(o,u)).replace(/'/g,'"');try{u=JSON.parse(o),t&&(u=i({},t,u))}catch(s){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),s),"".concat(e).concat(n).concat(o)}return delete u.defaultValue,e}for(u.applyPostProcessor=!1,delete u.defaultValue;s=this.nestingRegexp.exec(t);){var c=[],l=!1;if(s[0].includes(this.formatSeparator)&&!/{.*}/.test(s[1])){var h=s[1].split(this.formatSeparator).map((function(e){return e.trim()}));s[1]=h.shift(),c=h,l=!0}if((a=n(f.call(this,s[1].trim(),u),u))&&s[0]===t&&"string"!=typeof a)return a;"string"!=typeof a&&(a=b(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(t)),a=""),l&&(a=c.reduce((function(e,t){return r.format(e,t,o.lng,o)}),a.trim())),t=t.replace(s[0],a),this.regexp.lastIndex=0}return t}}]),e}();function L(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}var z=function(e){function t(e,n,r){var i,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return o(this,t),i=a(this,u(t).call(this)),E&&p.call(f(i)),i.backend=e,i.store=n,i.services=r,i.languageUtils=r.languageUtils,i.options=s,i.logger=d.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,s.backend,s),i}return c(t,e),s(t,[{key:"queueLoad",value:function e(t,n,r,i){var o=this,s=[],a=[],u=[],f=[];return t.forEach((function(e){var t=!0;n.forEach((function(n){var i="".concat(e,"|").concat(n);!r.reload&&o.store.hasResourceBundle(e,n)?o.state[i]=2:o.state[i]<0||(1===o.state[i]?a.indexOf(i)<0&&a.push(i):(o.state[i]=1,t=!1,a.indexOf(i)<0&&a.push(i),s.indexOf(i)<0&&s.push(i),f.indexOf(n)<0&&f.push(n)))})),t||u.push(e)})),(s.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:i}),{toLoad:s,pending:a,toLoadLanguages:u,toLoadNamespaces:f}}},{key:"loaded",value:function e(t,n,r){var i=t.split("|"),o=i[0],s=i[1];n&&this.emit("failedLoading",o,s,n),r&&this.store.addResourceBundle(o,s,r),this.state[t]=n?-1:2;var e={};this.queue.forEach((function(r){_(r.loaded,[o],s),L(r.pending,t),n&&r.errors.push(n),0!==r.pending.length||r.done||(Object.keys(r.loaded).forEach((function(t){e[t]||(e[t]=[]),r.loaded[t].length&&r.loaded[t].forEach((function(n){e[t].indexOf(n)<0&&e[t].push(n)}))})),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())})),this.emit("loaded",e),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function e(t,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return t.length?this.backend[r](t,n,(function(e,u){e&&u&&o<5?setTimeout((function(){i.read.call(i,t,n,r,o+1,2*s,a)}),s):a(e,u)})):a(null,{})}},{key:"prepareLoading",value:function e(t,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof n&&(n=[n]);var s=this.queueLoad(t,n,i,o);if(!s.toLoad.length)return s.pending.length||o(),null;s.toLoad.forEach((function(e){r.loadOne(e)}))}},{key:"load",value:function e(t,n,r){this.prepareLoading(t,n,{},r)}},{key:"reload",value:function e(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}},{key:"loadOne",value:function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=t.split("|"),o=i[0],s=i[1];this.read(o,s,"read",void 0,void 0,(function(e,i){e&&n.logger.warn("".concat(r,"loading namespace ").concat(s," for language ").concat(o," failed"),e),!e&&i&&n.logger.log("".concat(r,"loaded namespace ").concat(s," for language ").concat(o),i),n.loaded(t,e,i)}))}},{key:"saveMissing",value:function e(t,n,r,o,s){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)?this.logger.warn('did not save key "'.concat(r,'" as the namespace "').concat(n,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=r&&""!==r&&(this.backend&&this.backend.create&&this.backend.create(t,n,r,o,null,i({},a,{isUpdate:s})),t&&t[0]&&this.store.addResource(t[0],n,r,o))}}]),t}(p);function U(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function e(t){var n={};if("object"===r(t[1])&&(n=t[1]),"string"==typeof t[1]&&(n.defaultValue=t[1]),"string"==typeof t[2]&&(n.tDescription=t[2]),"object"===r(t[2])||"object"===r(t[3])){var i=t[3]||t[2];Object.keys(i).forEach((function(e){n[e]=i[e]}))}return n},interpolation:{escapeValue:!0,format:function e(t,n,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function q(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function $(){}var H,W=new(function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(o(this,t),e=a(this,u(t).call(this)),E&&p.call(f(e)),e.options=q(n),e.services={},e.logger=d,e.modules={external:[]},r&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,r),a(e,f(e));setTimeout((function(){e.init(n,r)}),0)}return e}return c(t,e),s(t,[{key:"init",value:function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;function o(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof n&&(r=n,n={}),n.whitelist&&!n.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),n.nonExplicitWhitelist&&!n.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=i({},U(),this.options,q(n)),this.format=this.options.interpolation.format,r||(r=$),!this.options.isClone){this.modules.logger?d.init(o(this.modules.logger),this.options):d.init(null,this.options);var s=new B(this.options);this.store=new A(this.options.resources,this.options);var a=this.services;a.logger=d,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new P(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),a.interpolator=new N(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new z(o(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1?n-1:0),i=1;i0&&"dev"!==u[0]&&(this.options.lng=u[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var f=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];f.forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments)}}));var c=["addResource","addResources","addResourceBundle","removeResourceBundle"];c.forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments),t}}));var l=g(),h=function e(){var n=function e(n,i){t.isInitialized&&t.logger.warn("init: i18next is already initialized. You should call init just once!"),t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),l.resolve(i),r(n,i)};if(t.languages&&"v1"!==t.options.compatibilityAPI&&!t.isInitialized)return n(null,t.t.bind(t));t.changeLanguage(t.options.lng,n)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),l}},{key:"loadResources",value:function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$,i=r,o="string"==typeof t?t:this.language;if("function"==typeof t&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return i();var s=[],a=function e(t){var r;t&&n.services.languageUtils.toResolveHierarchy(t).forEach((function(e){s.indexOf(e)<0&&s.push(e)}))};if(o)a(o);else{var u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.forEach((function(e){return a(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return a(e)})),this.services.backendConnector.load(s,this.options.ns,i)}else i(null)}},{key:"reloadResources",value:function e(t,n,r){var i=g();return t||(t=this.languages),n||(n=this.options.ns),r||(r=$),this.services.backendConnector.reload(t,n,(function(e){i.resolve(),r(e)})),i}},{key:"use",value:function e(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&C.addPostProcessor(t),"3rdParty"===t.type&&this.modules.external.push(t),this}},{key:"changeLanguage",value:function e(t,n){var r=this;this.isLanguageChangingTo=t;var i=g();this.emit("languageChanging",t);var o=function e(t,o){o?(r.language=o,r.languages=r.services.languageUtils.toResolveHierarchy(o),r.translator.changeLanguage(o),r.isLanguageChangingTo=void 0,r.emit("languageChanged",o),r.logger.log("languageChanged",o)):r.isLanguageChangingTo=void 0,i.resolve((function(){return r.t.apply(r,arguments)})),n&&n(t,(function(){return r.t.apply(r,arguments)}))},s=function e(t){var n="string"==typeof t?t:r.services.languageUtils.getBestMatchFromCodes(t);n&&(r.language||(r.language=n,r.languages=r.services.languageUtils.toResolveHierarchy(n)),r.translator.language||r.translator.changeLanguage(n),r.services.languageDetector&&r.services.languageDetector.cacheUserLanguage(n)),r.loadResources(n,(function(e){o(e,n)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(s):s(t):s(this.services.languageDetector.detect()),i}},{key:"getFixedT",value:function e(t,n){var o=this,s=function e(t,n){var s;if("object"!==r(n)){for(var a=arguments.length,u=new Array(a>2?a-2:0),f=2;f1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var i=this.languages[0],o=!!this.options&&this.options.fallbackLng,s=this.languages[this.languages.length-1];if("cimode"===i.toLowerCase())return!0;var a=function e(t,r){var i=n.services.backendConnector.state["".concat(t,"|").concat(r)];return-1===i||2===i};if(r.precheck){var u=r.precheck(this,a);if(void 0!==u)return u}return!!this.hasResourceBundle(i,t)||(!this.services.backendConnector.backend||!(!a(i,t)||o&&!a(s,t)))}},{key:"loadNamespaces",value:function e(t,n){var r=this,i=g();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((function(e){r.options.ns.indexOf(e)<0&&r.options.ns.push(e)})),this.loadResources((function(e){i.resolve(),n&&n(e)})),i):(n&&n(),Promise.resolve())}},{key:"loadLanguages",value:function e(t,n){var r=g();"string"==typeof t&&(t=[t]);var i=this.options.preload||[],o=t.filter((function(e){return i.indexOf(e)<0}));return o.length?(this.options.preload=i.concat(o),this.loadResources((function(e){r.resolve(),n&&n(e)})),r):(n&&n(),Promise.resolve())}},{key:"dir",value:function e(t){return t||(t=this.languages&&this.languages.length>0?this.languages[0]:this.language),t?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr":"rtl";var n}},{key:"createInstance",value:function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new t(n,r)}},{key:"cloneInstance",value:function e(){var n=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$,s=i({},this.options,r,{isClone:!0}),a=new t(s),u=["store","services","language"];return u.forEach((function(e){a[e]=n[e]})),a.services=i({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new O(a.services,a.options),a.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;rr,root:()=>i,ArrayProto:()=>o,ObjProto:()=>s,SymbolProto:()=>a,push:()=>u,slice:()=>f,toString:()=>c,hasOwnProperty:()=>l,supportsArrayBuffer:()=>h,supportsDataView:()=>d,nativeIsArray:()=>p,nativeKeys:()=>g,nativeCreate:()=>b,nativeIsView:()=>m,_isNaN:()=>v,_isFinite:()=>y,hasEnumBug:()=>_,nonEnumerableProps:()=>w,MAX_ARRAY_INDEX:()=>k});var r="1.13.4",i="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},o=Array.prototype,s=Object.prototype,a="undefined"!=typeof Symbol?Symbol.prototype:null,u=o.push,f=o.slice,c=s.toString,l=s.hasOwnProperty,h="undefined"!=typeof ArrayBuffer,d="undefined"!=typeof DataView,p=Array.isArray,g=Object.keys,b=Object.create,m=h&&ArrayBuffer.isView,v=isNaN,y=isFinite,_=!{toString:null}.propertyIsEnumerable("toString"),w=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],k=Math.pow(2,53)-1},"restArguments.js":function e(t,n,e){function r(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;ir})},"isObject.js":function e(t,n,e){function r(e){var t=typeof e;return"function"===t||"object"===t&&!!e}e.export({default:()=>r})},"isNull.js":function e(t,n,e){function r(e){return null===e}e.export({default:()=>r})},"isUndefined.js":function e(t,n,e){function r(e){return void 0===e}e.export({default:()=>r})},"isBoolean.js":function e(t,n,e){let r;function i(e){return!0===e||!1===e||"[object Boolean]"===r.call(e)}e.export({default:()=>i}),e.link("./_setup.js",{toString(e){r=e}},0)},"isElement.js":function e(t,n,e){function r(e){return!(!e||1!==e.nodeType)}e.export({default:()=>r})},"isString.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("String"))},"_tagTester.js":function e(t,n,e){let r;function i(e){var t="[object "+e+"]";return function(e){return r.call(e)===t}}e.export({default:()=>i}),e.link("./_setup.js",{toString(e){r=e}},0)},"isNumber.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("Number"))},"isDate.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("Date"))},"isRegExp.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("RegExp"))},"isError.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("Error"))},"isSymbol.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("Symbol"))},"isArrayBuffer.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("ArrayBuffer"))},"isDataView.js":function e(t,n,e){let r,i,o,s;e.link("./_tagTester.js",{default(e){r=e}},0),e.link("./isFunction.js",{default(e){i=e}},1),e.link("./isArrayBuffer.js",{default(e){o=e}},2),e.link("./_stringTagBug.js",{hasStringTagBug(e){s=e}},3);var a=r("DataView");function u(e){return null!=e&&i(e.getInt8)&&o(e.buffer)}e.exportDefault(s?u:a)},"isFunction.js":function e(t,n,e){let r,i;e.link("./_tagTester.js",{default(e){r=e}},0),e.link("./_setup.js",{root(e){i=e}},1);var o=r("Function"),s=i.document&&i.document.childNodes;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof s&&(o=function(e){return"function"==typeof e||!1}),e.exportDefault(o)},"_stringTagBug.js":function e(t,n,e){let r,i;e.export({hasStringTagBug:()=>o,isIE11:()=>s}),e.link("./_setup.js",{supportsDataView(e){r=e}},0),e.link("./_hasObjectTag.js",{default(e){i=e}},1);var o=r&&i(new DataView(new ArrayBuffer(8))),s="undefined"!=typeof Map&&i(new Map)},"_hasObjectTag.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("Object"))},"isArray.js":function e(t,n,e){let r,i;e.link("./_setup.js",{nativeIsArray(e){r=e}},0),e.link("./_tagTester.js",{default(e){i=e}},1),e.exportDefault(r||i("Array"))},"isArguments.js":function e(t,n,e){let r,i;e.link("./_tagTester.js",{default(e){r=e}},0),e.link("./_has.js",{default(e){i=e}},1);var o=r("Arguments");!function(){o(arguments)||(o=function(e){return i(e,"callee")})}(),e.exportDefault(o)},"_has.js":function e(t,n,e){let r;function i(e,t){return null!=e&&r.call(e,t)}e.export({default:()=>i}),e.link("./_setup.js",{hasOwnProperty(e){r=e}},0)},"isFinite.js":function e(t,n,e){let r,i;function o(e){return!i(e)&&r(e)&&!isNaN(parseFloat(e))}e.export({default:()=>o}),e.link("./_setup.js",{_isFinite(e){r=e}},0),e.link("./isSymbol.js",{default(e){i=e}},1)},"isNaN.js":function e(t,n,e){let r,i;function o(e){return i(e)&&r(e)}e.export({default:()=>o}),e.link("./_setup.js",{_isNaN(e){r=e}},0),e.link("./isNumber.js",{default(e){i=e}},1)},"isTypedArray.js":function e(t,n,e){let r,i,o,s,a,u;e.link("./_setup.js",{supportsArrayBuffer(e){r=e},nativeIsView(e){i=e},toString(e){o=e}},0),e.link("./isDataView.js",{default(e){s=e}},1),e.link("./constant.js",{default(e){a=e}},2),e.link("./_isBufferLike.js",{default(e){u=e}},3);var f=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function c(e){return i?i(e)&&!s(e):u(e)&&f.test(o.call(e))}e.exportDefault(r?c:a(!1))},"constant.js":function e(t,n,e){function r(e){return function(){return e}}e.export({default:()=>r})},"_isBufferLike.js":function e(t,n,e){let r,i;e.link("./_createSizePropertyCheck.js",{default(e){r=e}},0),e.link("./_getByteLength.js",{default(e){i=e}},1),e.exportDefault(r(i))},"_createSizePropertyCheck.js":function e(t,n,e){let r;function i(e){return function(t){var n=e(t);return"number"==typeof n&&n>=0&&n<=r}}e.export({default:()=>i}),e.link("./_setup.js",{MAX_ARRAY_INDEX(e){r=e}},0)},"_getByteLength.js":function e(t,n,e){let r;e.link("./_shallowProperty.js",{default(e){r=e}},0),e.exportDefault(r("byteLength"))},"_shallowProperty.js":function e(t,n,e){function r(e){return function(t){return null==t?void 0:t[e]}}e.export({default:()=>r})},"isEmpty.js":function e(t,n,e){let r,i,o,s,a;function u(e){if(null==e)return!0;var t=r(e);return"number"==typeof t&&(i(e)||o(e)||s(e))?0===t:0===r(a(e))}e.export({default:()=>u}),e.link("./_getLength.js",{default(e){r=e}},0),e.link("./isArray.js",{default(e){i=e}},1),e.link("./isString.js",{default(e){o=e}},2),e.link("./isArguments.js",{default(e){s=e}},3),e.link("./keys.js",{default(e){a=e}},4)},"_getLength.js":function e(t,n,e){let r;e.link("./_shallowProperty.js",{default(e){r=e}},0),e.exportDefault(r("length"))},"keys.js":function e(t,n,e){let r,i,o,s,a;function u(e){if(!r(e))return[];if(i)return i(e);var t=[];for(var n in e)s(e,n)&&t.push(n);return o&&a(e,t),t}e.export({default:()=>u}),e.link("./isObject.js",{default(e){r=e}},0),e.link("./_setup.js",{nativeKeys(e){i=e},hasEnumBug(e){o=e}},1),e.link("./_has.js",{default(e){s=e}},2),e.link("./_collectNonEnumProps.js",{default(e){a=e}},3)},"_collectNonEnumProps.js":function e(t,n,e){let r,i,o,s;function a(e){for(var t={},n=e.length,r=0;ru}),e.link("./_setup.js",{nonEnumerableProps(e){r=e},ObjProto(e){i=e}},0),e.link("./isFunction.js",{default(e){o=e}},1),e.link("./_has.js",{default(e){s=e}},2)},"isMatch.js":function e(t,n,e){let r;function i(e,t){var n=r(t),i=n.length;if(null==e)return!i;for(var o=Object(e),s=0;si}),e.link("./keys.js",{default(e){r=e}},0)},"isEqual.js":function e(t,n,e){let r,i,o,s,a,u,f,c,l,h,d;e.export({default:()=>m}),e.link("./underscore.js",{default(e){r=e}},0),e.link("./_setup.js",{toString(e){i=e},SymbolProto(e){o=e}},1),e.link("./_getByteLength.js",{default(e){s=e}},2),e.link("./isTypedArray.js",{default(e){a=e}},3),e.link("./isFunction.js",{default(e){u=e}},4),e.link("./_stringTagBug.js",{hasStringTagBug(e){f=e}},5),e.link("./isDataView.js",{default(e){c=e}},6),e.link("./keys.js",{default(e){l=e}},7),e.link("./_has.js",{default(e){h=e}},8),e.link("./_toBufferView.js",{default(e){d=e}},9);var p="[object DataView]";function g(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var i=typeof e;return("function"===i||"object"===i||"object"==typeof t)&&b(e,t,n,r)}function b(e,t,n,m){e instanceof r&&(e=e._wrapped),t instanceof r&&(t=t._wrapped);var v=i.call(e);if(v!==i.call(t))return!1;if(f&&"[object Object]"==v&&c(e)){if(!c(t))return!1;v=p}switch(v){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return o.valueOf.call(e)===o.valueOf.call(t);case"[object ArrayBuffer]":case p:return b(d(e),d(t),n,m)}var y="[object Array]"===v;if(!y&&a(e)){var _;if(s(e)!==s(t))return!1;if(e.buffer===t.buffer&&e.byteOffset===t.byteOffset)return!0;y=!0}if(!y){if("object"!=typeof e||"object"!=typeof t)return!1;var w=e.constructor,k=t.constructor;if(w!==k&&!(u(w)&&w instanceof w&&u(k)&&k instanceof k)&&"constructor"in e&&"constructor"in t)return!1}m=m||[];for(var j=(n=n||[]).length;j--;)if(n[j]===e)return m[j]===t;if(n.push(e),m.push(t),y){if((j=e.length)!==t.length)return!1;for(;j--;)if(!g(e[j],t[j],n,m))return!1}else{var x=l(e),S;if(j=x.length,l(t).length!==j)return!1;for(;j--;)if(S=x[j],!h(t,S)||!g(e[S],t[S],n,m))return!1}return n.pop(),m.pop(),!0}function m(e,t){return g(e,t)}},"underscore.js":function e(t,n,e){let r;function i(e){return e instanceof i?e:this instanceof i?void(this._wrapped=e):new i(e)}e.export({default:()=>i}),e.link("./_setup.js",{VERSION(e){r=e}},0),i.VERSION=r,i.prototype.value=function(){return this._wrapped},i.prototype.valueOf=i.prototype.toJSON=i.prototype.value,i.prototype.toString=function(){return String(this._wrapped)}},"_toBufferView.js":function e(t,n,e){let r;function i(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,r(e))}e.export({default:()=>i}),e.link("./_getByteLength.js",{default(e){r=e}},0)},"isMap.js":function e(t,n,e){let r,i,o,s;e.link("./_tagTester.js",{default(e){r=e}},0),e.link("./_stringTagBug.js",{isIE11(e){i=e}},1),e.link("./_methodFingerprint.js",{ie11fingerprint(e){o=e},mapMethods(e){s=e}},2),e.exportDefault(i?o(s):r("Map"))},"_methodFingerprint.js":function e(t,n,e){let r,i,o;function s(e){var t=r(e);return function(n){if(null==n)return!1;var s=o(n);if(r(s))return!1;for(var u=0;us,mapMethods:()=>l,weakMapMethods:()=>h,setMethods:()=>d}),e.link("./_getLength.js",{default(e){r=e}},0),e.link("./isFunction.js",{default(e){i=e}},1),e.link("./allKeys.js",{default(e){o=e}},2);var a="forEach",u="has",f=["clear","delete"],c=["get","has","set"],l=f.concat(a,c),h=f.concat(c),d=["add"].concat(f,a,"has")},"allKeys.js":function e(t,n,e){let r,i,o;function s(e){if(!r(e))return[];var t=[];for(var n in e)t.push(n);return i&&o(e,t),t}e.export({default:()=>s}),e.link("./isObject.js",{default(e){r=e}},0),e.link("./_setup.js",{hasEnumBug(e){i=e}},1),e.link("./_collectNonEnumProps.js",{default(e){o=e}},2)},"isWeakMap.js":function e(t,n,e){let r,i,o,s;e.link("./_tagTester.js",{default(e){r=e}},0),e.link("./_stringTagBug.js",{isIE11(e){i=e}},1),e.link("./_methodFingerprint.js",{ie11fingerprint(e){o=e},weakMapMethods(e){s=e}},2),e.exportDefault(i?o(s):r("WeakMap"))},"isSet.js":function e(t,n,e){let r,i,o,s;e.link("./_tagTester.js",{default(e){r=e}},0),e.link("./_stringTagBug.js",{isIE11(e){i=e}},1),e.link("./_methodFingerprint.js",{ie11fingerprint(e){o=e},setMethods(e){s=e}},2),e.exportDefault(i?o(s):r("Set"))},"isWeakSet.js":function e(t,n,e){let r;e.link("./_tagTester.js",{default(e){r=e}},0),e.exportDefault(r("WeakSet"))},"values.js":function e(t,n,e){let r;function i(e){for(var t=r(e),n=t.length,i=Array(n),o=0;oi}),e.link("./keys.js",{default(e){r=e}},0)},"pairs.js":function e(t,n,e){let r;function i(e){for(var t=r(e),n=t.length,i=Array(n),o=0;oi}),e.link("./keys.js",{default(e){r=e}},0)},"invert.js":function e(t,n,e){let r;function i(e){for(var t={},n=r(e),i=0,o=n.length;ii}),e.link("./keys.js",{default(e){r=e}},0)},"functions.js":function e(t,n,e){let r;function i(e){var t=[];for(var n in e)r(e[n])&&t.push(n);return t.sort()}e.export({default:()=>i}),e.link("./isFunction.js",{default(e){r=e}},0)},"extend.js":function e(t,n,e){let r,i;e.link("./_createAssigner.js",{default(e){r=e}},0),e.link("./allKeys.js",{default(e){i=e}},1),e.exportDefault(r(i))},"_createAssigner.js":function e(t,n,e){function r(e,t){return function(n){var r=arguments.length;if(t&&(n=Object(n)),r<2||null==n)return n;for(var i=1;ir})},"extendOwn.js":function e(t,n,e){let r,i;e.link("./_createAssigner.js",{default(e){r=e}},0),e.link("./keys.js",{default(e){i=e}},1),e.exportDefault(r(i))},"defaults.js":function e(t,n,e){let r,i;e.link("./_createAssigner.js",{default(e){r=e}},0),e.link("./allKeys.js",{default(e){i=e}},1),e.exportDefault(r(i,!0))},"create.js":function e(t,n,e){let r,i;function o(e,t){var n=r(e);return t&&i(n,t),n}e.export({default:()=>o}),e.link("./_baseCreate.js",{default(e){r=e}},0),e.link("./extendOwn.js",{default(e){i=e}},1)},"_baseCreate.js":function e(t,n,e){let r,i;function o(){return function(){}}function s(e){if(!r(e))return{};if(i)return i(e);var t=function(){};t.prototype=e;var n=new t;return t.prototype=null,n}e.export({default:()=>s}),e.link("./isObject.js",{default(e){r=e}},0),e.link("./_setup.js",{nativeCreate(e){i=e}},1)},"clone.js":function e(t,n,e){let r,i,o;function s(e){return r(e)?i(e)?e.slice():o({},e):e}e.export({default:()=>s}),e.link("./isObject.js",{default(e){r=e}},0),e.link("./isArray.js",{default(e){i=e}},1),e.link("./extend.js",{default(e){o=e}},2)},"tap.js":function e(t,n,e){function r(e,t){return t(e),e}e.export({default:()=>r})},"get.js":function e(t,n,e){let r,i,o;function s(e,t,n){var s=i(e,r(t));return o(s)?n:s}e.export({default:()=>s}),e.link("./_toPath.js",{default(e){r=e}},0),e.link("./_deepGet.js",{default(e){i=e}},1),e.link("./isUndefined.js",{default(e){o=e}},2)},"_toPath.js":function e(t,n,e){let r;function i(e){return r.toPath(e)}e.export({default:()=>i}),e.link("./underscore.js",{default(e){r=e}},0),e.link("./toPath.js")},"toPath.js":function e(t,n,e){let r,i;function o(e){return i(e)?e:[e]}e.export({default:()=>o}),e.link("./underscore.js",{default(e){r=e}},0),e.link("./isArray.js",{default(e){i=e}},1),r.toPath=o},"_deepGet.js":function e(t,n,e){function r(e,t){for(var n=t.length,r=0;rr})},"has.js":function e(t,n,e){let r,i;function o(e,t){for(var n=(t=i(t)).length,o=0;oo}),e.link("./_has.js",{default(e){r=e}},0),e.link("./_toPath.js",{default(e){i=e}},1)},"mapObject.js":function e(t,n,e){let r,i;function o(e,t,n){t=r(t,n);for(var o=i(e),s=o.length,a={},u=0;uo}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./keys.js",{default(e){i=e}},1)},"_cb.js":function e(t,n,e){let r,i,o;function s(e,t,n){return r.iteratee!==o?r.iteratee(e,t):i(e,t,n)}e.export({default:()=>s}),e.link("./underscore.js",{default(e){r=e}},0),e.link("./_baseIteratee.js",{default(e){i=e}},1),e.link("./iteratee.js",{default(e){o=e}},2)},"_baseIteratee.js":function e(t,n,e){let r,i,o,s,a,u,f;function c(e,t,n){return null==e?r:i(e)?f(e,t,n):o(e)&&!s(e)?a(e):u(e)}e.export({default:()=>c}),e.link("./identity.js",{default(e){r=e}},0),e.link("./isFunction.js",{default(e){i=e}},1),e.link("./isObject.js",{default(e){o=e}},2),e.link("./isArray.js",{default(e){s=e}},3),e.link("./matcher.js",{default(e){a=e}},4),e.link("./property.js",{default(e){u=e}},5),e.link("./_optimizeCb.js",{default(e){f=e}},6)},"identity.js":function e(t,n,e){function r(e){return e}e.export({default:()=>r})},"matcher.js":function e(t,n,e){let r,i;function o(e){return e=r({},e),function(t){return i(t,e)}}e.export({default:()=>o}),e.link("./extendOwn.js",{default(e){r=e}},0),e.link("./isMatch.js",{default(e){i=e}},1)},"property.js":function e(t,n,e){let r,i;function o(e){return e=i(e),function(t){return r(t,e)}}e.export({default:()=>o}),e.link("./_deepGet.js",{default(e){r=e}},0),e.link("./_toPath.js",{default(e){i=e}},1)},"_optimizeCb.js":function e(t,n,e){function r(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)}}return function(){return e.apply(t,arguments)}}e.export({default:()=>r})},"iteratee.js":function e(t,n,e){let r,i;function o(e,t){return i(e,t,1/0)}e.export({default:()=>o}),e.link("./underscore.js",{default(e){r=e}},0),e.link("./_baseIteratee.js",{default(e){i=e}},1),r.iteratee=o},"noop.js":function e(t,n,e){function r(){}e.export({default:()=>r})},"propertyOf.js":function e(t,n,e){let r,i;function o(e){return null==e?r:function(t){return i(e,t)}}e.export({default:()=>o}),e.link("./noop.js",{default(e){r=e}},0),e.link("./get.js",{default(e){i=e}},1)},"times.js":function e(t,n,e){let r;function i(e,t,n){var i=Array(Math.max(0,e));t=r(t,n,1);for(var o=0;oi}),e.link("./_optimizeCb.js",{default(e){r=e}},0)},"random.js":function e(t,n,e){function r(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}e.export({default:()=>r})},"now.js":function e(t,n,e){e.exportDefault(Date.now||function(){return(new Date).getTime()})},"escape.js":function e(t,n,e){let r,i;e.link("./_createEscaper.js",{default(e){r=e}},0),e.link("./_escapeMap.js",{default(e){i=e}},1),e.exportDefault(r(i))},"_createEscaper.js":function e(t,n,e){let r;function i(e){var t=function(t){return e[t]},n="(?:"+r(e).join("|")+")",i=RegExp(n),o=RegExp(n,"g");return function(e){return e=null==e?"":""+e,i.test(e)?e.replace(o,t):e}}e.export({default:()=>i}),e.link("./keys.js",{default(e){r=e}},0)},"_escapeMap.js":function e(t,n,e){e.exportDefault({"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"})},"unescape.js":function e(t,n,e){let r,i;e.link("./_createEscaper.js",{default(e){r=e}},0),e.link("./_unescapeMap.js",{default(e){i=e}},1),e.exportDefault(r(i))},"_unescapeMap.js":function e(t,n,e){let r,i;e.link("./invert.js",{default(e){r=e}},0),e.link("./_escapeMap.js",{default(e){i=e}},1),e.exportDefault(r(i))},"templateSettings.js":function e(t,n,e){let r;e.link("./underscore.js",{default(e){r=e}},0),e.exportDefault(r.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g})},"template.js":function e(t,n,e){let r,i;e.export({default:()=>c}),e.link("./defaults.js",{default(e){r=e}},0),e.link("./underscore.js",{default(e){i=e}},1),e.link("./templateSettings.js");var o=/(.)^/,s={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},a=/\\|'|\r|\n|\u2028|\u2029/g;function u(e){return"\\"+s[e]}var f=/^\s*(\w|\$)+\s*$/;function c(e,t,n){!t&&n&&(t=n),t=r({},t,i.templateSettings);var s=RegExp([(t.escape||o).source,(t.interpolate||o).source,(t.evaluate||o).source].join("|")+"|$","g"),c=0,l="__p+='";e.replace(s,(function(t,n,r,i,o){return l+=e.slice(c,o).replace(a,u),c=o+t.length,n?l+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?l+="'+\n((__t=("+r+"))==null?'':__t)+\n'":i&&(l+="';\n"+i+"\n__p+='"),t})),l+="';\n";var h=t.variable,d;if(h){if(!f.test(h))throw new Error("variable is not a bare identifier: "+h)}else l="with(obj||{}){\n"+l+"}\n",h="obj";l="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+l+"return __p;\n";try{d=new Function(h,"_",l)}catch(g){throw g.source=l,g}var p=function(e){return d.call(this,e,i)};return p.source="function("+h+"){\n"+l+"}",p}},"result.js":function e(t,n,e){let r,i;function o(e,t,n){var o=(t=i(t)).length;if(!o)return r(n)?n.call(e):n;for(var s=0;so}),e.link("./isFunction.js",{default(e){r=e}},0),e.link("./_toPath.js",{default(e){i=e}},1)},"uniqueId.js":function e(t,n,e){e.export({default:()=>i});var r=0;function i(e){var t=++r+"";return e?e+t:t}},"chain.js":function e(t,n,e){let r;function i(e){var t=r(e);return t._chain=!0,t}e.export({default:()=>i}),e.link("./underscore.js",{default(e){r=e}},0)},"partial.js":function e(t,n,e){let r,i,o;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./_executeBound.js",{default(e){i=e}},1),e.link("./underscore.js",{default(e){o=e}},2);var s=r((function(e,t){var n=s.placeholder,r=function(){for(var o=0,s=t.length,a=Array(s),u=0;uo}),e.link("./_baseCreate.js",{default(e){r=e}},0),e.link("./isObject.js",{default(e){i=e}},1)},"bind.js":function e(t,n,e){let r,i,o;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./isFunction.js",{default(e){i=e}},1),e.link("./_executeBound.js",{default(e){o=e}},2),e.exportDefault(r((function(e,t,n){if(!i(e))throw new TypeError("Bind must be called on a function");var s=r((function(r){return o(e,s,t,this,n.concat(r))}));return s})))},"bindAll.js":function e(t,n,e){let r,i,o;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./_flatten.js",{default(e){i=e}},1),e.link("./bind.js",{default(e){o=e}},2),e.exportDefault(r((function(e,t){var n=(t=i(t,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=t[n];e[r]=o(e[r],e)}return e})))},"_flatten.js":function e(t,n,e){let r,i,o,s;function a(e,t,n,u){if(u=u||[],t||0===t){if(t<=0)return u.concat(e)}else t=1/0;for(var f=u.length,c=0,l=r(e);c1)a(h,t-1,n,u),f=u.length;else for(var d=0,p=h.length;da}),e.link("./_getLength.js",{default(e){r=e}},0),e.link("./_isArrayLike.js",{default(e){i=e}},1),e.link("./isArray.js",{default(e){o=e}},2),e.link("./isArguments.js",{default(e){s=e}},3)},"_isArrayLike.js":function e(t,n,e){let r,i;e.link("./_createSizePropertyCheck.js",{default(e){r=e}},0),e.link("./_getLength.js",{default(e){i=e}},1),e.exportDefault(r(i))},"memoize.js":function e(t,n,e){let r;function i(e,t){var n=function(i){var o=n.cache,s=""+(t?t.apply(this,arguments):i);return r(o,s)||(o[s]=e.apply(this,arguments)),o[s]};return n.cache={},n}e.export({default:()=>i}),e.link("./_has.js",{default(e){r=e}},0)},"delay.js":function e(t,n,e){let r;e.link("./restArguments.js",{default(e){r=e}},0),e.exportDefault(r((function(e,t,n){return setTimeout((function(){return e.apply(null,n)}),t)})))},"defer.js":function e(t,n,e){let r,i,o;e.link("./partial.js",{default(e){r=e}},0),e.link("./delay.js",{default(e){i=e}},1),e.link("./underscore.js",{default(e){o=e}},2),e.exportDefault(r(i,o,1))},"throttle.js":function e(t,n,e){let r;function i(e,t,n){var i,o,s,a,u=0;n||(n={});var f=function(){u=!1===n.leading?0:r(),i=null,a=e.apply(o,s),i||(o=s=null)},c=function(){var c=r();u||!1!==n.leading||(u=c);var l=t-(c-u);return o=this,s=arguments,l<=0||l>t?(i&&(clearTimeout(i),i=null),u=c,a=e.apply(o,s),i||(o=s=null)):i||!1===n.trailing||(i=setTimeout(f,l)),a};return c.cancel=function(){clearTimeout(i),u=0,i=o=s=null},c}e.export({default:()=>i}),e.link("./now.js",{default(e){r=e}},0)},"debounce.js":function e(t,n,e){let r,i;function o(e,t,n){var o,s,a,u,f,c=function(){var r=i()-s;t>r?o=setTimeout(c,t-r):(o=null,n||(u=e.apply(f,a)),o||(a=f=null))},l=r((function(r){return f=this,a=r,s=i(),o||(o=setTimeout(c,t),n&&(u=e.apply(f,a))),u}));return l.cancel=function(){clearTimeout(o),o=a=f=null},l}e.export({default:()=>o}),e.link("./restArguments.js",{default(e){r=e}},0),e.link("./now.js",{default(e){i=e}},1)},"wrap.js":function e(t,n,e){let r;function i(e,t){return r(t,e)}e.export({default:()=>i}),e.link("./partial.js",{default(e){r=e}},0)},"negate.js":function e(t,n,e){function r(e){return function(){return!e.apply(this,arguments)}}e.export({default:()=>r})},"compose.js":function e(t,n,e){function r(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}}e.export({default:()=>r})},"after.js":function e(t,n,e){function r(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}e.export({default:()=>r})},"before.js":function e(t,n,e){function r(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}e.export({default:()=>r})},"once.js":function e(t,n,e){let r,i;e.link("./partial.js",{default(e){r=e}},0),e.link("./before.js",{default(e){i=e}},1),e.exportDefault(r(i,2))},"findKey.js":function e(t,n,e){let r,i;function o(e,t,n){t=r(t,n);for(var o=i(e),s,a=0,u=o.length;ao}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./keys.js",{default(e){i=e}},1)},"findIndex.js":function e(t,n,e){let r;e.link("./_createPredicateIndexFinder.js",{default(e){r=e}},0),e.exportDefault(r(1))},"_createPredicateIndexFinder.js":function e(t,n,e){let r,i;function o(e){return function(t,n,o){n=r(n,o);for(var s=i(t),a=e>0?0:s-1;a>=0&&ao}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./_getLength.js",{default(e){i=e}},1)},"findLastIndex.js":function e(t,n,e){let r;e.link("./_createPredicateIndexFinder.js",{default(e){r=e}},0),e.exportDefault(r(-1))},"sortedIndex.js":function e(t,n,e){let r,i;function o(e,t,n,o){for(var s=(n=r(n,o,1))(t),a=0,u=i(e);ao}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./_getLength.js",{default(e){i=e}},1)},"indexOf.js":function e(t,n,e){let r,i,o;e.link("./sortedIndex.js",{default(e){r=e}},0),e.link("./findIndex.js",{default(e){i=e}},1),e.link("./_createIndexFinder.js",{default(e){o=e}},2),e.exportDefault(o(1,i,r))},"_createIndexFinder.js":function e(t,n,e){let r,i,o;function s(e,t,n){return function(s,a,u){var f=0,c=r(s);if("number"==typeof u)e>0?f=u>=0?u:Math.max(u+c,f):c=u>=0?Math.min(u+1,c):u+c+1;else if(n&&u&&c)return s[u=n(s,a)]===a?u:-1;if(a!=a)return(u=t(i.call(s,f,c),o))>=0?u+f:-1;for(u=e>0?f:c-1;u>=0&&us}),e.link("./_getLength.js",{default(e){r=e}},0),e.link("./_setup.js",{slice(e){i=e}},1),e.link("./isNaN.js",{default(e){o=e}},2)},"lastIndexOf.js":function e(t,n,e){let r,i;e.link("./findLastIndex.js",{default(e){r=e}},0),e.link("./_createIndexFinder.js",{default(e){i=e}},1),e.exportDefault(i(-1,r))},"find.js":function e(t,n,e){let r,i,o;function s(e,t,n){var s,a=(r(e)?i:o)(e,t,n);if(void 0!==a&&-1!==a)return e[a]}e.export({default:()=>s}),e.link("./_isArrayLike.js",{default(e){r=e}},0),e.link("./findIndex.js",{default(e){i=e}},1),e.link("./findKey.js",{default(e){o=e}},2)},"findWhere.js":function e(t,n,e){let r,i;function o(e,t){return r(e,i(t))}e.export({default:()=>o}),e.link("./find.js",{default(e){r=e}},0),e.link("./matcher.js",{default(e){i=e}},1)},"each.js":function e(t,n,e){let r,i,o;function s(e,t,n){var s,a;if(t=r(t,n),i(e))for(s=0,a=e.length;ss}),e.link("./_optimizeCb.js",{default(e){r=e}},0),e.link("./_isArrayLike.js",{default(e){i=e}},1),e.link("./keys.js",{default(e){o=e}},2)},"map.js":function e(t,n,e){let r,i,o;function s(e,t,n){t=r(t,n);for(var s=!i(e)&&o(e),a=(s||e).length,u=Array(a),f=0;fs}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./_isArrayLike.js",{default(e){i=e}},1),e.link("./keys.js",{default(e){o=e}},2)},"reduce.js":function e(t,n,e){let r;e.link("./_createReduce.js",{default(e){r=e}},0),e.exportDefault(r(1))},"_createReduce.js":function e(t,n,e){let r,i,o;function s(e){var t=function(t,n,o,s){var a=!r(t)&&i(t),u=(a||t).length,f=e>0?0:u-1;for(s||(o=t[a?a[f]:f],f+=e);f>=0&&f=3;return t(e,o(n,i,4),r,s)}}e.export({default:()=>s}),e.link("./_isArrayLike.js",{default(e){r=e}},0),e.link("./keys.js",{default(e){i=e}},1),e.link("./_optimizeCb.js",{default(e){o=e}},2)},"reduceRight.js":function e(t,n,e){let r;e.link("./_createReduce.js",{default(e){r=e}},0),e.exportDefault(r(-1))},"filter.js":function e(t,n,e){let r,i;function o(e,t,n){var o=[];return t=r(t,n),i(e,(function(e,n,r){t(e,n,r)&&o.push(e)})),o}e.export({default:()=>o}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./each.js",{default(e){i=e}},1)},"reject.js":function e(t,n,e){let r,i,o;function s(e,t,n){return r(e,i(o(t)),n)}e.export({default:()=>s}),e.link("./filter.js",{default(e){r=e}},0),e.link("./negate.js",{default(e){i=e}},1),e.link("./_cb.js",{default(e){o=e}},2)},"every.js":function e(t,n,e){let r,i,o;function s(e,t,n){t=r(t,n);for(var s=!i(e)&&o(e),a=(s||e).length,u=0;us}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./_isArrayLike.js",{default(e){i=e}},1),e.link("./keys.js",{default(e){o=e}},2)},"some.js":function e(t,n,e){let r,i,o;function s(e,t,n){t=r(t,n);for(var s=!i(e)&&o(e),a=(s||e).length,u=0;us}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./_isArrayLike.js",{default(e){i=e}},1),e.link("./keys.js",{default(e){o=e}},2)},"contains.js":function e(t,n,e){let r,i,o;function s(e,t,n,s){return r(e)||(e=i(e)),("number"!=typeof n||s)&&(n=0),o(e,t,n)>=0}e.export({default:()=>s}),e.link("./_isArrayLike.js",{default(e){r=e}},0),e.link("./values.js",{default(e){i=e}},1),e.link("./indexOf.js",{default(e){o=e}},2)},"invoke.js":function e(t,n,e){let r,i,o,s,a;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./isFunction.js",{default(e){i=e}},1),e.link("./map.js",{default(e){o=e}},2),e.link("./_deepGet.js",{default(e){s=e}},3),e.link("./_toPath.js",{default(e){a=e}},4),e.exportDefault(r((function(e,t,n){var r,u;return i(t)?u=t:(t=a(t),r=t.slice(0,-1),t=t[t.length-1]),o(e,(function(e){var i=u;if(!i){if(r&&r.length&&(e=s(e,r)),null==e)return;i=e[t]}return null==i?i:i.apply(e,n)}))})))},"pluck.js":function e(t,n,e){let r,i;function o(e,t){return r(e,i(t))}e.export({default:()=>o}),e.link("./map.js",{default(e){r=e}},0),e.link("./property.js",{default(e){i=e}},1)},"where.js":function e(t,n,e){let r,i;function o(e,t){return r(e,i(t))}e.export({default:()=>o}),e.link("./filter.js",{default(e){r=e}},0),e.link("./matcher.js",{default(e){i=e}},1)},"max.js":function e(t,n,e){let r,i,o,s;function a(e,t,n){var a=-1/0,u=-1/0,f,c;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var l=0,h=(e=r(e)?e:i(e)).length;la&&(a=f);else t=o(t,n),s(e,(function(e,n,r){((c=t(e,n,r))>u||c===-1/0&&a===-1/0)&&(a=e,u=c)}));return a}e.export({default:()=>a}),e.link("./_isArrayLike.js",{default(e){r=e}},0),e.link("./values.js",{default(e){i=e}},1),e.link("./_cb.js",{default(e){o=e}},2),e.link("./each.js",{default(e){s=e}},3)},"min.js":function e(t,n,e){let r,i,o,s;function a(e,t,n){var a=1/0,u=1/0,f,c;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var l=0,h=(e=r(e)?e:i(e)).length;la}),e.link("./_isArrayLike.js",{default(e){r=e}},0),e.link("./values.js",{default(e){i=e}},1),e.link("./_cb.js",{default(e){o=e}},2),e.link("./each.js",{default(e){s=e}},3)},"shuffle.js":function e(t,n,e){let r;function i(e){return r(e,1/0)}e.export({default:()=>i}),e.link("./sample.js",{default(e){r=e}},0)},"sample.js":function e(t,n,e){let r,i,o,s,a;function u(e,t,n){if(null==t||n)return r(e)||(e=i(e)),e[s(e.length-1)];var u=a(e),f=o(u);t=Math.max(Math.min(t,f),0);for(var c=f-1,l=0;lu}),e.link("./_isArrayLike.js",{default(e){r=e}},0),e.link("./values.js",{default(e){i=e}},1),e.link("./_getLength.js",{default(e){o=e}},2),e.link("./random.js",{default(e){s=e}},3),e.link("./toArray.js",{default(e){a=e}},4)},"toArray.js":function e(t,n,e){let r,i,o,s,a,u,f;e.export({default:()=>l}),e.link("./isArray.js",{default(e){r=e}},0),e.link("./_setup.js",{slice(e){i=e}},1),e.link("./isString.js",{default(e){o=e}},2),e.link("./_isArrayLike.js",{default(e){s=e}},3),e.link("./map.js",{default(e){a=e}},4),e.link("./identity.js",{default(e){u=e}},5),e.link("./values.js",{default(e){f=e}},6);var c=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function l(e){return e?r(e)?i.call(e):o(e)?e.match(c):s(e)?a(e,u):f(e):[]}},"sortBy.js":function e(t,n,e){let r,i,o;function s(e,t,n){var s=0;return t=r(t,n),i(o(e,(function(e,n,r){return{value:e,index:s++,criteria:t(e,n,r)}})).sort((function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(ns}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./pluck.js",{default(e){i=e}},1),e.link("./map.js",{default(e){o=e}},2)},"groupBy.js":function e(t,n,e){let r,i;e.link("./_group.js",{default(e){r=e}},0),e.link("./_has.js",{default(e){i=e}},1),e.exportDefault(r((function(e,t,n){i(e,n)?e[n].push(t):e[n]=[t]})))},"_group.js":function e(t,n,e){let r,i;function o(e,t){return function(n,o,s){var a=t?[[],[]]:{};return o=r(o,s),i(n,(function(t,r){var i=o(t,r,n);e(a,t,i)})),a}}e.export({default:()=>o}),e.link("./_cb.js",{default(e){r=e}},0),e.link("./each.js",{default(e){i=e}},1)},"indexBy.js":function e(t,n,e){let r;e.link("./_group.js",{default(e){r=e}},0),e.exportDefault(r((function(e,t,n){e[n]=t})))},"countBy.js":function e(t,n,e){let r,i;e.link("./_group.js",{default(e){r=e}},0),e.link("./_has.js",{default(e){i=e}},1),e.exportDefault(r((function(e,t,n){i(e,n)?e[n]++:e[n]=1})))},"partition.js":function e(t,n,e){let r;e.link("./_group.js",{default(e){r=e}},0),e.exportDefault(r((function(e,t,n){e[n?0:1].push(t)}),!0))},"size.js":function e(t,n,e){let r,i;function o(e){return null==e?0:r(e)?e.length:i(e).length}e.export({default:()=>o}),e.link("./_isArrayLike.js",{default(e){r=e}},0),e.link("./keys.js",{default(e){i=e}},1)},"pick.js":function e(t,n,e){let r,i,o,s,a,u;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./isFunction.js",{default(e){i=e}},1),e.link("./_optimizeCb.js",{default(e){o=e}},2),e.link("./allKeys.js",{default(e){s=e}},3),e.link("./_keyInObj.js",{default(e){a=e}},4),e.link("./_flatten.js",{default(e){u=e}},5),e.exportDefault(r((function(e,t){var n={},r=t[0];if(null==e)return n;i(r)?(t.length>1&&(r=o(r,t[1])),t=s(e)):(r=a,t=u(t,!1,!1),e=Object(e));for(var f=0,c=t.length;fr})},"omit.js":function e(t,n,e){let r,i,o,s,a,u,f;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./isFunction.js",{default(e){i=e}},1),e.link("./negate.js",{default(e){o=e}},2),e.link("./map.js",{default(e){s=e}},3),e.link("./_flatten.js",{default(e){a=e}},4),e.link("./contains.js",{default(e){u=e}},5),e.link("./pick.js",{default(e){f=e}},6),e.exportDefault(r((function(e,t){var n=t[0],r;return i(n)?(n=o(n),t.length>1&&(r=t[1])):(t=s(a(t,!1,!1),String),n=function(e,n){return!u(t,n)}),f(e,n,r)})))},"first.js":function e(t,n,e){let r;function i(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[0]:r(e,e.length-t)}e.export({default:()=>i}),e.link("./initial.js",{default(e){r=e}},0)},"initial.js":function e(t,n,e){let r;function i(e,t,n){return r.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))}e.export({default:()=>i}),e.link("./_setup.js",{slice(e){r=e}},0)},"last.js":function e(t,n,e){let r;function i(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[e.length-1]:r(e,Math.max(0,e.length-t))}e.export({default:()=>i}),e.link("./rest.js",{default(e){r=e}},0)},"rest.js":function e(t,n,e){let r;function i(e,t,n){return r.call(e,null==t||n?1:t)}e.export({default:()=>i}),e.link("./_setup.js",{slice(e){r=e}},0)},"compact.js":function e(t,n,e){let r;function i(e){return r(e,Boolean)}e.export({default:()=>i}),e.link("./filter.js",{default(e){r=e}},0)},"flatten.js":function e(t,n,e){let r;function i(e,t){return r(e,t,!1)}e.export({default:()=>i}),e.link("./_flatten.js",{default(e){r=e}},0)},"without.js":function e(t,n,e){let r,i;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./difference.js",{default(e){i=e}},1),e.exportDefault(r((function(e,t){return i(e,t)})))},"difference.js":function e(t,n,e){let r,i,o,s;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./_flatten.js",{default(e){i=e}},1),e.link("./filter.js",{default(e){o=e}},2),e.link("./contains.js",{default(e){s=e}},3),e.exportDefault(r((function(e,t){return t=i(t,!0,!0),o(e,(function(e){return!s(t,e)}))})))},"uniq.js":function e(t,n,e){let r,i,o,s;function a(e,t,n,a){r(t)||(a=n,n=t,t=!1),null!=n&&(n=i(n,a));for(var u=[],f=[],c=0,l=o(e);ca}),e.link("./isBoolean.js",{default(e){r=e}},0),e.link("./_cb.js",{default(e){i=e}},1),e.link("./_getLength.js",{default(e){o=e}},2),e.link("./contains.js",{default(e){s=e}},3)},"union.js":function e(t,n,e){let r,i,o;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./uniq.js",{default(e){i=e}},1),e.link("./_flatten.js",{default(e){o=e}},2),e.exportDefault(r((function(e){return i(o(e,!0,!0))})))},"intersection.js":function e(t,n,e){let r,i;function o(e){for(var t=[],n=arguments.length,o=0,s=r(e);oo}),e.link("./_getLength.js",{default(e){r=e}},0),e.link("./contains.js",{default(e){i=e}},1)},"unzip.js":function e(t,n,e){let r,i,o;function s(e){for(var t=e&&r(e,i).length||0,n=Array(t),s=0;ss}),e.link("./max.js",{default(e){r=e}},0),e.link("./_getLength.js",{default(e){i=e}},1),e.link("./pluck.js",{default(e){o=e}},2)},"zip.js":function e(t,n,e){let r,i;e.link("./restArguments.js",{default(e){r=e}},0),e.link("./unzip.js",{default(e){i=e}},1),e.exportDefault(r(i))},"object.js":function e(t,n,e){let r;function i(e,t){for(var n={},i=0,o=r(e);ii}),e.link("./_getLength.js",{default(e){r=e}},0)},"range.js":function e(t,n,e){function r(e,t,n){null==t&&(t=e||0,e=0),n||(n=tr})},"chunk.js":function e(t,n,e){let r;function i(e,t){if(null==t||t<1)return[];for(var n=[],i=0,o=e.length;ii}),e.link("./_setup.js",{slice(e){r=e}},0)},"mixin.js":function e(t,n,e){let r,i,o,s,a;function u(e){return i(o(e),(function(t){var n=r[t]=e[t];r.prototype[t]=function(){var e=[this._wrapped];return s.apply(e,arguments),a(this,n.apply(r,e))}})),r}e.export({default:()=>u}),e.link("./underscore.js",{default(e){r=e}},0),e.link("./each.js",{default(e){i=e}},1),e.link("./functions.js",{default(e){o=e}},2),e.link("./_setup.js",{push(e){s=e}},3),e.link("./_chainResult.js",{default(e){a=e}},4)},"_chainResult.js":function e(t,n,e){let r;function i(e,t){return e._chain?r(t).chain():t}e.export({default:()=>i}),e.link("./underscore.js",{default(e){r=e}},0)},"underscore-array-methods.js":function e(t,n,e){let r,i,o,s;e.link("./underscore.js",{default(e){r=e}},0),e.link("./each.js",{default(e){i=e}},1),e.link("./_setup.js",{ArrayProto(e){o=e}},2),e.link("./_chainResult.js",{default(e){s=e}},3),i(["pop","push","reverse","shift","sort","splice","unshift"],(function(e){var t=o[e];r.prototype[e]=function(){var n=this._wrapped;return null!=n&&(t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0]),s(this,n)}})),i(["concat","join","slice"],(function(e){var t=o[e];r.prototype[e]=function(){var e=this._wrapped;return null!=e&&(e=t.apply(e,arguments)),s(this,e)}})),e.exportDefault(r)}}}}},cachers:{"package.json":function e(t,n,e){e.exports={name:"@steedos/cachers",version:"2.7.1-beta.7",main:"lib/index.js"}},lib:{"index.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getCacherNames=n.clearCacher=n.getCacher=void 0;var r={},i=t("./memory"),o=t("./memory-lru"),s=function(e,t){return r[e]||(e.startsWith("lru.")?r[e]=new o.MemoryLRUCacher(t):r[e]=new i.MemoryCacher),r[e]};n.getCacher=s;var a=function(e){r[e]&&r[e].clear()};n.clearCacher=a;var u=function(){return Object.keys(r)};n.getCacherNames=u},"memory.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MemoryCacher=void 0;var r=t("lodash"),i=function(){function e(){this.cache={}}return e.prototype.get=function(e){return this.cache[e]},e.prototype.delete=function(e){delete this.cache[e]},e.prototype.set=function(e,t){this.cache[e]=t},e.prototype.clear=function(){this.cache={}},e.prototype.keys=function(){return(0,r.keys)(this.cache)},e.prototype.values=function(){return(0,r.values)(this.cache)},e}();n.MemoryCacher=i},"memory-lru.js":function e(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MemoryLRUCacher=void 0;var r=t("lodash"),i=t("lru-cache"),o={max:5e3,ttl:null,keygen:null,maxParamsLength:null},s=function(){function e(e){this.opts=(0,r.defaultsDeep)(e,o),this.cache=new i({max:this.opts.max,maxAge:this.opts.ttl?1e3*this.opts.ttl:null,updateAgeOnGet:!!this.opts.ttl})}return e.prototype.get=function(e){return this.cache.get(e)},e.prototype.set=function(e,t,n){return this.cache.set(e,t,n)},e.prototype.delete=function(e){return this.cache.delete(e)},e.prototype.clear=function(){return this.cache.clear()},e.prototype.keys=function(){return this.cache.keys()},e.prototype.values=function(){return this.cache.values()},e}();n.MemoryLRUCacher=s}},node_modules:{"lru-cache":{"package.json":function e(t,n,e){e.exports={name:"lru-cache",version:"7.14.1",main:"index.js"}},"index.js":function e(t,n,e){const r="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,i="function"==typeof AbortController,o=i?AbortController:class e{constructor(){this.signal=new u}abort(){this.signal.dispatchEvent("abort")}},s="function"==typeof AbortSignal,a="function"==typeof o.AbortSignal,u=s?AbortSignal:a?o.AbortController:class e{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(e){if("abort"===e){this.aborted=!0;const t={type:e,target:this};this.onabort(t),this._listeners.forEach(e=>e(t),this)}}onabort(){}addEventListener(e,t){"abort"===e&&this._listeners.push(t)}removeEventListener(e,t){"abort"===e&&(this._listeners=this._listeners.filter(e=>e!==t))}},f=new Set,c=(e,t)=>{const n=`LRU_CACHE_OPTION_${e}`;p(n)&&g(n,`${e} option`,`options.${t}`,_)},l=(e,t)=>{const n=`LRU_CACHE_METHOD_${e}`;if(p(n)){const{prototype:r}=_,{get:i}=Object.getOwnPropertyDescriptor(r,e);g(n,`${e} method`,`cache.${t}()`,i)}},h=(e,t)=>{const n=`LRU_CACHE_PROPERTY_${e}`;if(p(n)){const{prototype:r}=_,{get:i}=Object.getOwnPropertyDescriptor(r,e);g(n,`${e} property`,`cache.${t}`,i)}},d=(...e)=>{"object"==typeof process&&process&&"function"==typeof process.emitWarning?process.emitWarning(...e):console.error(...e)},p=e=>!f.has(e),g=(e,t,n,r)=>{f.add(e);const i=`The ${t} is deprecated. Please use ${n} instead.`;d(i,"DeprecationWarning",e,r)},b=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),m=e=>b(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?v:null:null;class v extends Array{constructor(e){super(e),this.fill(0)}}class y{constructor(e){if(0===e)return[];const t=m(e);this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class _{constructor(e={}){const{max:t=0,ttl:n,ttlResolution:r=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:u,disposeAfter:l,noDisposeOnSet:h,noUpdateTTL:g,maxSize:v=0,maxEntrySize:w=0,sizeCalculation:k,fetchMethod:j,fetchContext:x,noDeleteOnFetchRejection:S,noDeleteOnStaleGet:D}=e,{length:E,maxAge:A,stale:C}=e instanceof _?{}:e;if(0!==t&&!b(t))throw new TypeError("max option must be a nonnegative integer");const M=t?m(t):Array;if(!M)throw new Error("invalid max value: "+t);if(this.max=t,this.maxSize=v,this.maxEntrySize=w||this.maxSize,this.sizeCalculation=k||E,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=j||null,this.fetchMethod&&"function"!=typeof this.fetchMethod)throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=x,!this.fetchMethod&&void 0!==x)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(t).fill(null),this.valList=new Array(t).fill(null),this.next=new M(t),this.prev=new M(t),this.head=0,this.tail=0,this.free=new y(t),this.initialFill=1,this.size=0,"function"==typeof u&&(this.dispose=u),"function"==typeof l?(this.disposeAfter=l,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!S,0!==this.maxEntrySize){if(0!==this.maxSize&&!b(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!b(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!a||!!C,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=b(r)||0===r?r:1,this.ttlAutopurge=!!i,this.ttl=n||A||0,this.ttl){if(!b(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(0===this.max&&0===this.ttl&&0===this.maxSize)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const e="LRU_CACHE_UNBOUNDED";if(p(e)){f.add(e);const t="TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.";d(t,"UnboundedCacheWarning",e,_)}}C&&c("stale","allowStale"),A&&c("maxAge","ttl"),E&&c("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new v(this.max),this.starts=new v(this.max),this.setItemTTL=(e,t,n=r.now())=>{if(this.starts[e]=0!==t?n:0,this.ttls[e]=t,0!==t&&this.ttlAutopurge){const n=setTimeout(()=>{this.isStale(e)&&this.delete(this.keyList[e])},t+1);n.unref&&n.unref()}},this.updateItemAge=e=>{this.starts[e]=0!==this.ttls[e]?r.now():0};let e=0;const t=()=>{const t=r.now();if(this.ttlResolution>0){e=t;const n=setTimeout(()=>e=0,this.ttlResolution);n.unref&&n.unref()}return t};this.getRemainingTTL=n=>{const r=this.keyMap.get(n);return void 0===r?0:0===this.ttls[r]||0===this.starts[r]?1/0:this.starts[r]+this.ttls[r]-(e||t())},this.isStale=n=>0!==this.ttls[n]&&0!==this.starts[n]&&(e||t())-this.starts[n]>this.ttls[n]}updateItemAge(e){}setItemTTL(e,t,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new v(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,t,n,r)=>{if(this.isBackgroundFetch(t))return 0;if(!b(n)){if(!r)throw new TypeError("invalid size value (must be positive integer)");if("function"!=typeof r)throw new TypeError("sizeCalculation must be a function");if(n=r(t,e),!b(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return n},this.addItemSize=(e,t)=>{if(this.sizes[e]=t,this.maxSize){const t=this.maxSize-this.sizes[e];for(;this.calculatedSize>t;)this.evict(!0)}this.calculatedSize+=this.sizes[e]}}removeItemSize(e){}addItemSize(e,t){}requireSize(e,t,n,r){if(n||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.tail;this.isValidIndex(t)&&(!e&&this.isStale(t)||(yield t),t!==this.head);)t=this.prev[t]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.head;this.isValidIndex(t)&&(!e&&this.isStale(t)||(yield t),t!==this.tail);)t=this.next[t]}isValidIndex(e){return this.keyMap.get(this.keyList[e])===e}*entries(){for(const e of this.indexes())yield[this.keyList[e],this.valList[e]]}*rentries(){for(const e of this.rindexes())yield[this.keyList[e],this.valList[e]]}*keys(){for(const e of this.indexes())yield this.keyList[e]}*rkeys(){for(const e of this.rindexes())yield this.keyList[e]}*values(){for(const e of this.indexes())yield this.valList[e]}*rvalues(){for(const e of this.rindexes())yield this.valList[e]}[Symbol.iterator](){return this.entries()}find(e,t={}){for(const n of this.indexes())if(e(this.valList[n],this.keyList[n],this))return this.get(this.keyList[n],t)}forEach(e,t=this){for(const n of this.indexes())e.call(t,this.valList[n],this.keyList[n],this)}rforEach(e,t=this){for(const n of this.rindexes())e.call(t,this.valList[n],this.keyList[n],this)}get prune(){return l("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(const t of this.rindexes({allowStale:!0}))this.isStale(t)&&(this.delete(this.keyList[t]),e=!0);return e}dump(){const e=[];for(const t of this.indexes({allowStale:!0})){const n=this.keyList[t],i=this.valList[t],o=this.isBackgroundFetch(i)?i.__staleWhileFetching:i,s={value:o};if(this.ttls){s.ttl=this.ttls[t];const e=r.now()-this.starts[t];s.start=Math.floor(Date.now()-e)}this.sizes&&(s.size=this.sizes[t]),e.unshift([n,s])}return e}load(e){this.clear();for(const[t,n]of e){if(n.start){const e=Date.now()-n.start;n.start=r.now()-e}this.set(t,n.value,n)}}dispose(e,t,n){}set(e,t,{ttl:n=this.ttl,start:r,noDisposeOnSet:i=this.noDisposeOnSet,size:o=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:a=this.noUpdateTTL}={}){if(o=this.requireSize(e,t,o,s),this.maxEntrySize&&o>this.maxEntrySize)return this.delete(e),this;let u=0===this.size?void 0:this.keyMap.get(e);if(void 0===u)u=this.newIndex(),this.keyList[u]=e,this.valList[u]=t,this.keyMap.set(e,u),this.next[this.tail]=u,this.prev[u]=this.tail,this.tail=u,this.size++,this.addItemSize(u,o),a=!1;else{const n=this.valList[u];t!==n&&(this.isBackgroundFetch(n)?n.__abortController.abort():i||(this.dispose(n,e,"set"),this.disposeAfter&&this.disposed.push([n,e,"set"])),this.removeItemSize(u),this.valList[u]=t,this.addItemSize(u,o)),this.moveToTail(u)}if(0===n||0!==this.ttl||this.ttls||this.initializeTTLTracking(),a||this.setItemTTL(u,n,r),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return 0===this.size?this.tail:this.size===this.max&&0!==this.max?this.evict(!1):0!==this.free.length?this.free.pop():this.initialFill++}pop(){if(this.size){const e=this.valList[this.head];return this.evict(!0),e}}evict(e){const t=this.head,n=this.keyList[t],r=this.valList[t];return this.isBackgroundFetch(r)?r.__abortController.abort():(this.dispose(r,n,"evict"),this.disposeAfter&&this.disposed.push([r,n,"evict"])),this.removeItemSize(t),e&&(this.keyList[t]=null,this.valList[t]=null,this.free.push(t)),this.head=this.next[t],this.keyMap.delete(n),this.size--,t}has(e,{updateAgeOnHas:t=this.updateAgeOnHas}={}){const n=this.keyMap.get(e);return void 0!==n&&!this.isStale(n)&&(t&&this.updateItemAge(n),!0)}peek(e,{allowStale:t=this.allowStale}={}){const n=this.keyMap.get(e);if(void 0!==n&&(t||!this.isStale(n))){const e=this.valList[n];return this.isBackgroundFetch(e)?e.__staleWhileFetching:e}}backgroundFetch(e,t,n,r){const i=void 0===t?void 0:this.valList[t];if(this.isBackgroundFetch(i))return i;const s=new o,a={signal:s.signal,options:n,context:r},u=t=>(s.signal.aborted||this.set(e,t,a.options),t),f=r=>{if(this.valList[t]===l){const r=!n.noDeleteOnFetchRejection||void 0===l.__staleWhileFetching;r?this.delete(e):this.valList[t]=l.__staleWhileFetching}if(l.__returned===l)throw r},c=t=>t(this.fetchMethod(e,i,a)),l=new Promise(c).then(u,f);return l.__abortController=s,l.__staleWhileFetching=i,l.__returned=null,void 0===t?(this.set(e,l,a.options),t=this.keyMap.get(e)):this.valList[t]=l,l}isBackgroundFetch(e){return e&&"object"==typeof e&&"function"==typeof e.then&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||null===e.__returned)}async fetch(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,fetchContext:c=this.fetchContext,forceRefresh:l=!1}={}){if(!this.fetchMethod)return this.get(e,{allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r});const h={allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:i,noDisposeOnSet:o,size:s,sizeCalculation:a,noUpdateTTL:u,noDeleteOnFetchRejection:f};let d=this.keyMap.get(e);if(void 0===d){const t=this.backgroundFetch(e,d,h,c);return t.__returned=t}{const r=this.valList[d];if(this.isBackgroundFetch(r))return t&&void 0!==r.__staleWhileFetching?r.__staleWhileFetching:r.__returned=r;if(!l&&!this.isStale(d))return this.moveToTail(d),n&&this.updateItemAge(d),r;const i=this.backgroundFetch(e,d,h,c);return t&&void 0!==i.__staleWhileFetching?i.__staleWhileFetching:i.__returned=i}}get(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet}={}){const i=this.keyMap.get(e);if(void 0!==i){const o=this.valList[i],s=this.isBackgroundFetch(o);if(this.isStale(i))return s?t?o.__staleWhileFetching:void 0:(r||this.delete(e),t?o:void 0);if(s)return;return this.moveToTail(i),n&&this.updateItemAge(i),o}}connect(e,t){this.prev[t]=e,this.next[e]=t}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return l("del","delete"),this.delete}delete(e){let t=!1;if(0!==this.size){const n=this.keyMap.get(e);if(void 0!==n)if(t=!0,1===this.size)this.clear();else{this.removeItemSize(n);const t=this.valList[n];this.isBackgroundFetch(t)?t.__abortController.abort():(this.dispose(t,e,"delete"),this.disposeAfter&&this.disposed.push([t,e,"delete"])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return t}clear(){for(const e of this.rindexes({allowStale:!0})){const t=this.valList[e];if(this.isBackgroundFetch(t))t.__abortController.abort();else{const n=this.keyList[e];this.dispose(t,n,"delete"),this.disposeAfter&&this.disposed.push([t,n,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return l("reset","clear"),this.clear}get length(){return h("length","size"),this.size}static get AbortController(){return o}static get AbortSignal(){return u}}e.exports=_}}}},"form-builder":{"package.json":function e(t,n,e){e.exports={name:"@steedos/form-builder",version:"3.6.2-patch.5",private:!1,publishConfig:{access:"public"},main:"dist/form-builder.min.js",homepage:"https://formbuilder.online/",repository:{url:"https://github.com/kevinchappell/formBuilder.git",type:"git"},files:["dist/**/*","docs/**/*","src/**/*"],author:"Kevin Chappell ",contributors:[],bugs:"https://github.com/kevinchappell/formBuilder/issues",description:"A jQuery plugin for drag and drop form building",keywords:["jquery-plugin","forms","drag and drop","form builder","form create"],license:"MIT",ignore:["**/*","node_modules","test"],config:{files:{test:["test/**/*.spec.js"],pluginsDir:"src/js/control_plugins/",fonts:"src/fonts",sass:"src/sass",formBuilder:{js:"src/js/form-builder.js",sass:["src/sass/form-builder.scss"]},formRender:{js:"src/js/form-render.js",sass:["src/sass/form-render.scss"]},site:["demo/assets/sass/site.scss"]},fontServer:"http://fontello.com",fontelloToken:"09d648f01d6c57cb9f9b8cc55043e0c0"},babel:{presets:[["@babel/preset-env",{targets:{browsers:["> 1%"]},loose:!0}]],comments:!1,plugins:["@babel/plugin-proposal-object-rest-spread","@babel/plugin-proposal-class-properties"]},scripts:{"build:analyze":"webpack --mode production -p --progress --config tools/webpack.config --analyze","build:plugins":"webpack --mode production -p --display-entrypoints --progress --config tools/webpack.plugins.config","build:vendor":"babel-node tools/build-vendor",build:"webpack --mode production -p --progress --config tools/webpack.config","build:all":"npm-run-all build:plugins build:vendor build copy",copy:"cp -a dist/* demo/assets/js/ && cp CONTRIBUTING.md docs/contributing.md && cp LICENSE docs/license.md && npm run copy:lang","copy:lang":"babel-node tools/copy-language-files","deploy:all":"npm-run-all deploy:demo deploy:site","deploy:demo":"node tools/deploy-demo.js","deploy:site":"node tools/deploy-site.js",docs:"mkdocs build",font:"babel-node tools/icon-font",lint:"eslint ./src --ext .js || true","semantic-release":"semantic-release","start:devServer":"webpack-dev-server --mode development --config tools/webpack.config",prestart:"npm-run-all -p build:vendor copy:lang",start:"npm run start:devServer",test:"npm run-script build"},dependencies:{jquery:">=3.4.1","jquery-ui-sortable":"*"},devDependencies:{"@babel/cli":"^7.10.5","@babel/core":"^7.11.4","@babel/node":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.11.0","@babel/plugin-syntax-object-rest-spread":"^7.8.3","@babel/plugin-transform-destructuring":"^7.10.4","@babel/preset-env":"^7.11.0","@semantic-release/changelog":"^5.0.1","@semantic-release/git":"^9.0.0","@semantic-release/npm":"^7.0.5",autoprefixer:"^9.8.6","babel-eslint":"^10.1.0","babel-loader":"^8.1.0","clean-webpack-plugin":"^3.0.0",clui:"^0.3.6","compression-webpack-plugin":"^5.0.1","concat-files":"^0.1.1","cross-env":"^7.0.2","css-loader":"^4.2.1",eslint:"^7.7.0","eslint-loader":"^4.0.2","formbuilder-languages":"latest","fs-extra":"^9.0.1","html-webpack-harddisk-plugin":"^1.0.2","html-webpack-plugin":"^4.3.0",inquirer:"^7.3.3",mi18n:"^0.4.8","node-sass":"6.0.1","npm-run-all":"^4.1.5",opener:"^1.5.1","postcss-loader":"^3.0.0","replace-in-file":"^6.1.0",request:"^2.88.2","sass-loader":"10.5.2","semantic-release":"^17.1.1",semver:"^7.3.2","style-loader":"^1.2.1",unzipper:"^0.10.11",webpack:"^4.44.1","webpack-bundle-analyzer":"^3.8.0","webpack-cli":"^3.3.12","webpack-dev-server":"^3.11.0","wrapper-webpack-plugin":"^2.1.0"},prettier:{singleQuote:!0,trailingComma:"all",printWidth:120,semi:!1,arrowParens:"avoid",spaceAfterFunction:!1},engines:{},release:{branch:"master",verifyConditions:["@semantic-release/changelog","@semantic-release/npm","@semantic-release/git"],prepare:["@semantic-release/changelog","@semantic-release/npm","@semantic-release/git"]},browserslist:["> 1%"]}},dist:{"form-builder.min.js":[]}}},tslib:{"package.json":function e(t,n,e){e.exports={name:"tslib",version:"2.3.1",module:"tslib.es6.js",main:"tslib.js"}},"tslib.es6.js":function e(t,n,e){e.export({__extends:()=>i,__assign:()=>o,__rest:()=>s,__decorate:()=>a,__param:()=>u,__metadata:()=>f,__awaiter:()=>c,__generator:()=>l,__createBinding:()=>h,__exportStar:()=>d,__values:()=>p,__read:()=>g,__spread:()=>b,__spreadArrays:()=>m,__spreadArray:()=>v,__await:()=>y,__asyncGenerator:()=>_,__asyncDelegator:()=>w,__asyncValues:()=>k,__makeTemplateObject:()=>j,__importStar:()=>S,__importDefault:()=>D,__classPrivateFieldGet:()=>E,__classPrivateFieldSet:()=>A}); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -706,7 +706,7 @@ var r,a;r=this,a=function(t){var e=function(){"use strict";return{isMsie:functio */ var r,a;r=this,a=function(t){var e=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:t.isArray,isFunction:t.isFunction,isObject:t.isPlainObject,isUndefined:function(t){return void 0===t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(e){return e instanceof t},toStr:function t(n){return e.isUndefined(n)||null===n?"":n+""},bind:t.proxy,each:function(e,n){function i(t,e){return n(e,t)}t.each(e,i)},map:t.map,filter:t.grep,every:function(e,n){var i=!0;return e?(t.each(e,(function(t,r){if(!(i=n.call(null,r,t,e)))return!1})),!!i):i},some:function(e,n){var i=!1;return e?(t.each(e,(function(t,r){if(i=n.call(null,r,t,e))return!1})),!!i):i},mixin:t.extend,identity:function(t){return t},clone:function(e){return t.extend(!0,{},e)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function e(n){return t.isFunction(n)?n:i;function i(){return String(n)}},defer:function(t){setTimeout(t,0)},debounce:function(t,e,n){var i,r;return function(){var a=this,o=arguments,s,u;return s=function(){i=null,n||(r=t.apply(a,o))},u=n&&!i,clearTimeout(i),i=setTimeout(s,e),u&&(r=t.apply(a,o)),r}},throttle:function(t,e){var n,i,r,a,o,s;return o=0,s=function(){o=new Date,r=null,a=t.apply(n,i)},function(){var u=new Date,l=e-(u-o);return n=this,i=arguments,l<=0?(clearTimeout(r),r=null,o=u,a=t.apply(n,i)):r||(r=setTimeout(s,l)),a}},stringify:function(t){return e.isString(t)?t:JSON.stringify(t)},noop:function(){}}}(),n=function(){"use strict";var t={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return n;function n(n){var o,s;return s=e.mixin({},t,n),{css:(o={css:a(),classes:s,html:i(s),selectors:r(s)}).css,html:o.html,classes:o.classes,selectors:o.selectors,mixin:function(t){e.mixin(t,o)}}}function i(t){return{wrapper:'',menu:'
'}}function r(t){var n={};return e.each(t,(function(t,e){n[e]="."+t})),n}function a(){var t={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return e.isMsie()&&e.mixin(t.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),t}}(),i=function(){"use strict";var n,i;function r(e){e&&e.el||t.error("EventBus initialized without el"),this.$el=t(e.el)}return n="typeahead:",i={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},e.mixin(r.prototype,{_trigger:function(e,i){var r;return r=t.Event(n+e),(i=i||[]).unshift(r),this.$el.trigger.apply(this.$el,i),r},before:function(t){var e,n;return e=[].slice.call(arguments,1),(n=this._trigger("before"+t,e)).isDefaultPrevented()},trigger:function(t){var e;this._trigger(t,[].slice.call(arguments,1)),(e=i[t])&&this._trigger(e,[].slice.call(arguments,1))}}),r}(),r=function(){"use strict";var t=/\s+/,e=u();return{onSync:r,onAsync:i,off:a,trigger:o};function n(e,n,i,r){var a;if(!i)return this;for(n=n.split(t),i=r?l(i,r):i,this._callbacks=this._callbacks||{};a=n.shift();)this._callbacks[a]=this._callbacks[a]||{sync:[],async:[]},this._callbacks[a][e].push(i);return this}function i(t,e,i){return n.call(this,"async",t,e,i)}function r(t,e,i){return n.call(this,"sync",t,e,i)}function a(e){var n;if(!this._callbacks)return this;for(e=e.split(t);n=e.shift();)delete this._callbacks[n];return this}function o(n){var i,r,a,o,u;if(!this._callbacks)return this;for(n=n.split(t),a=[].slice.call(arguments,1);(i=n.shift())&&(r=this._callbacks[i]);)o=s(r.sync,this,[i].concat(a)),u=s(r.async,this,[i].concat(a)),o()&&e(u);return this}function s(t,e,n){return i;function i(){for(var i,r=0,a=t.length;!i&&r9?this.$input.on("input.tt",o):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",(function(i){n[i.which||i.keyCode]||e.defer(e.bind(t._onInput,t,i))})),this},focus:function t(){this.$input.focus()},blur:function t(){this.$input.blur()},getLangDir:function t(){return this.dir},getQuery:function t(){return this.query||""},setQuery:function t(e,n){this.setInputValue(e),this._setQuery(e,n)},hasQueryChangedSinceLastFocus:function t(){return this.query!==this.queryWhenFocused},getInputValue:function t(){return this.$input.val()},setInputValue:function t(e){this.$input.val(e),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function t(){this.setInputValue(this.query)},getHint:function t(){return this.$hint.val()},setHint:function t(e){this.$hint.val(e)},clearHint:function t(){this.setHint("")},clearHintIfInvalid:function t(){var e,n,i,r;i=(e=this.getInputValue())!==(n=this.getHint())&&0===n.indexOf(e),!(r=""!==e&&i&&!this.hasOverflow())&&this.clearHint()},hasFocus:function t(){return this.$input.is(":focus")},hasOverflow:function t(){var e=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=e},isCursorAtEnd:function(){var t,n,i;return t=this.$input.val().length,n=this.$input[0].selectionStart,e.isNumber(n)?n===t:!document.selection||((i=document.selection.createRange()).moveStart("character",-t),t===i.text.length)},destroy:function e(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=t("
")}}),i;function a(e){return t('').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:e.css("font-family"),fontSize:e.css("font-size"),fontStyle:e.css("font-style"),fontVariant:e.css("font-variant"),fontWeight:e.css("font-weight"),wordSpacing:e.css("word-spacing"),letterSpacing:e.css("letter-spacing"),textIndent:e.css("text-indent"),textRendering:e.css("text-rendering"),textTransform:e.css("text-transform")}).insertAfter(e)}function o(t,e){return i.normalizeQuery(t)===i.normalizeQuery(e)}function s(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}}(),s=function(){"use strict";var n,i;function o(n,r){(n=n||{}).templates=n.templates||{},n.templates.notFound=n.templates.notFound||n.templates.empty,n.source||t.error("missing source"),n.node||t.error("missing node"),n.name&&(n.name,0)&&t.error("invalid dataset name: "+n.name),r.mixin(this),this.highlight=!!n.highlight,this.name=n.name||i(),this.limit=n.limit||5,this.displayFn=s(n.display||n.displayKey),this.templates=u(n.templates,this.displayFn),this.source=n.source.__ttAdapter?n.source.__ttAdapter():n.source,this.async=e.isUndefined(n.async)?this.source.length>2:!!n.async,this._resetLastSuggestion(),this.$el=t(n.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}return n={val:"tt-selectable-display",obj:"tt-selectable-object"},i=e.getIdGenerator(),o.extractData=function e(i){var r=t(i);return r.data(n.obj)?{val:r.data(n.val)||"",obj:r.data(n.obj)||null}:null},e.mixin(o.prototype,r,{_overwrite:function t(e,n){(n=n||[]).length?this._renderSuggestions(e,n):this.async&&this.templates.pending?this._renderPending(e):!this.async&&this.templates.notFound?this._renderNotFound(e):this._empty(),this.trigger("rendered",this.name,n,!1)},_append:function t(e,n){(n=n||[]).length&&this.$lastSuggestion.length?this._appendSuggestions(e,n):n.length?this._renderSuggestions(e,n):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(e),this.trigger("rendered",this.name,n,!0)},_renderSuggestions:function t(e,n){var i;i=this._getSuggestionsFragment(e,n),this.$lastSuggestion=i.children().last(),this.$el.html(i).prepend(this._getHeader(e,n)).append(this._getFooter(e,n))},_appendSuggestions:function t(e,n){var i,r;r=(i=this._getSuggestionsFragment(e,n)).children().last(),this.$lastSuggestion.after(i),this.$lastSuggestion=r},_renderPending:function t(e){var n=this.templates.pending;this._resetLastSuggestion(),n&&this.$el.html(n({query:e,dataset:this.name}))},_renderNotFound:function t(e){var n=this.templates.notFound;this._resetLastSuggestion(),n&&this.$el.html(n({query:e,dataset:this.name}))},_empty:function t(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function i(r,o){var s=this,u;return u=document.createDocumentFragment(),e.each(o,(function e(i){var a,o;o=s._injectQuery(r,i),a=t(s.templates.suggestion(o)).data(n.obj,i).data(n.val,s.displayFn(i)).addClass(s.classes.suggestion+" "+s.classes.selectable),u.appendChild(a[0])})),this.highlight&&a({className:this.classes.highlight,node:u,pattern:r}),t(u)},_getFooter:function t(e,n){return this.templates.footer?this.templates.footer({query:e,suggestions:n,dataset:this.name}):null},_getHeader:function t(e,n){return this.templates.header?this.templates.header({query:e,suggestions:n,dataset:this.name}):null},_resetLastSuggestion:function e(){this.$lastSuggestion=t()},_injectQuery:function t(n,i){return e.isObject(i)?e.mixin({_query:n},i):i},update:function e(n){var i=this,r=!1,a=!1,o=0;function s(t){a||(a=!0,t=(t||[]).slice(0,i.limit),o=t.length,i._overwrite(n,t),o")}}),o;function s(t){return t=t||e.stringify,e.isFunction(t)?t:n;function n(e){return e[t]}}function u(n,i){return{notFound:n.notFound&&e.templatify(n.notFound),pending:n.pending&&e.templatify(n.pending),header:n.header&&e.templatify(n.header),footer:n.footer&&e.templatify(n.footer),suggestion:n.suggestion||r};function r(e){return t("
").text(i(e))}}function l(t){return!0}}(),u=function(){"use strict";function n(n,i){var r=this;function a(e){var n=r.$node.find(e.node).first();return e.node=n.length?n:t("
").appendTo(r.$node),new s(e,i)}(n=n||{}).node||t.error("node is required"),i.mixin(this),this.$node=t(n.node),this.query=null,this.datasets=e.map(n.datasets,a)}return e.mixin(n.prototype,r,{_onSelectableClick:function e(n){this.trigger("selectableClicked",t(n.currentTarget))},_onRendered:function t(e,n,i,r){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",n,i,r)},_onCleared:function t(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function t(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function t(){return e.every(this.datasets,n);function n(t){return t.isEmpty()}},_getSelectables:function t(){return this.$node.find(this.selectors.selectable)},_removeCursor:function t(){var e=this.getActiveSelectable();e&&e.removeClass(this.classes.cursor)},_ensureVisible:function t(e){var n,i,r,a;i=(n=e.position().top)+e.outerHeight(!0),r=this.$node.scrollTop(),a=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),n<0?this.$node.scrollTop(r+n):a"),e.each(this.datasets,i)}}),n}(),l=function(){"use strict";var t=u.prototype;function n(){u.apply(this,[].slice.call(arguments,0))}return e.mixin(n.prototype,u.prototype,{open:function e(){return!this._allDatasetsEmpty()&&this._show(),t.open.apply(this,[].slice.call(arguments,0))},close:function e(){return this._hide(),t.close.apply(this,[].slice.call(arguments,0))},_onRendered:function e(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),t._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function e(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),t._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function e(n){return this.$node.css("ltr"===n?this.css.ltr:this.css.rtl),t.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function t(){this.$node.hide()},_show:function t(){this.$node.css("display","block")}}),n}(),c=function(){"use strict";function n(n,r){var a,o,s,u,l,c,d,f,h,p,m;(n=n||{}).input||t.error("missing input"),n.menu||t.error("missing menu"),n.eventBus||t.error("missing event bus"),r.mixin(this),this.eventBus=n.eventBus,this.minLength=e.isNumber(n.minLength)?n.minLength:1,this.input=n.input,this.menu=n.menu,this.enabled=!0,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),a=i(this,"activate","open","_onFocused"),o=i(this,"deactivate","_onBlurred"),s=i(this,"isActive","isOpen","_onEnterKeyed"),u=i(this,"isActive","isOpen","_onTabKeyed"),l=i(this,"isActive","_onEscKeyed"),c=i(this,"isActive","open","_onUpKeyed"),d=i(this,"isActive","open","_onDownKeyed"),f=i(this,"isActive","isOpen","_onLeftKeyed"),h=i(this,"isActive","isOpen","_onRightKeyed"),p=i(this,"_openIfActive","_onQueryChanged"),m=i(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",a,this).onSync("blurred",o,this).onSync("enterKeyed",s,this).onSync("tabKeyed",u,this).onSync("escKeyed",l,this).onSync("upKeyed",c,this).onSync("downKeyed",d,this).onSync("leftKeyed",f,this).onSync("rightKeyed",h,this).onSync("queryChanged",p,this).onSync("whitespaceChanged",m,this).onSync("langDirChanged",this._onLangDirChanged,this)}return e.mixin(n.prototype,{_hacks:function n(){var i,r;i=this.input.$input||t("
"),r=this.menu.$node||t("
"),i.on("blur.tt",(function(t){var n,a,o;n=document.activeElement,a=r.is(n),o=r.has(n).length>0,e.isMsie()&&(a||o)&&(t.preventDefault(),t.stopImmediatePropagation(),e.defer((function(){i.focus()})))})),r.on("mousedown.tt",(function(t){t.preventDefault()}))},_onSelectableClicked:function t(e,n){this.select(n)},_onDatasetCleared:function t(){this._updateHint()},_onDatasetRendered:function t(e,n,i,r){this._updateHint(),this.eventBus.trigger("render",i,r,n)},_onAsyncRequested:function t(e,n,i){this.eventBus.trigger("asyncrequest",i,n)},_onAsyncCanceled:function t(e,n,i){this.eventBus.trigger("asynccancel",i,n)},_onAsyncReceived:function t(e,n,i){this.eventBus.trigger("asyncreceive",i,n)},_onFocused:function t(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function t(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function t(e,n){var i;(i=this.menu.getActiveSelectable())&&this.select(i)&&n.preventDefault()},_onTabKeyed:function t(e,n){var i;(i=this.menu.getActiveSelectable())?this.select(i)&&n.preventDefault():(i=this.menu.getTopSelectable())&&this.autocomplete(i)&&n.preventDefault()},_onEscKeyed:function t(){this.close()},_onUpKeyed:function t(){this.moveCursor(-1)},_onDownKeyed:function t(){this.moveCursor(1)},_onLeftKeyed:function t(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function t(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function t(e,n){this._minLengthMet(n)?this.menu.update(n):this.menu.empty()},_onWhitespaceChanged:function t(){this._updateHint()},_onLangDirChanged:function t(e,n){this.dir!==n&&(this.dir=n,this.menu.setLanguageDirection(n))},_openIfActive:function t(){this.isActive()&&this.open()},_minLengthMet:function t(n){return(n=e.isString(n)?n:this.input.getQuery()||"").length>=this.minLength},_updateHint:function t(){var n,i,r,a,s,u,l;n=this.menu.getTopSelectable(),i=this.menu.getSelectableData(n),r=this.input.getInputValue(),!i||e.isBlankString(r)||this.input.hasOverflow()?this.input.clearHint():(a=o.normalizeQuery(r),s=e.escapeRegExChars(a),(l=(u=new RegExp("^(?:"+s+")(.+$)","i")).exec(i.val))&&this.input.setHint(r+l[1]))},isEnabled:function t(){return this.enabled},enable:function t(){this.enabled=!0},disable:function t(){this.enabled=!1},isActive:function t(){return this.active},activate:function t(){return!!this.isActive()||!(!this.isEnabled()||this.eventBus.before("active"))&&(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function t(){return!this.isActive()||!this.eventBus.before("idle")&&(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0)},isOpen:function t(){return this.menu.isOpen()},open:function t(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function t(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function t(n){this.input.setQuery(e.toStr(n))},getVal:function t(){return this.input.getQuery()},select:function t(e){var n=this.menu.getSelectableData(e);return!(!n||this.eventBus.before("select",n.obj)||(this.input.setQuery(n.val,!0),this.eventBus.trigger("select",n.obj),this.close(),0))},autocomplete:function t(e){var n,i,r;return n=this.input.getQuery(),!(!(r=(i=this.menu.getSelectableData(e))&&n!==i.val)||this.eventBus.before("autocomplete",i.obj)||(this.input.setQuery(i.val),this.eventBus.trigger("autocomplete",i.obj),0))},moveCursor:function t(e){var n,i,r,a,o;return n=this.input.getQuery(),i=this.menu.selectableRelativeToCursor(e),a=(r=this.menu.getSelectableData(i))?r.obj:null,!(o=this._minLengthMet()&&this.menu.update(n))&&!this.eventBus.before("cursorchange",a)&&(this.menu.setCursor(i),r?this.input.setInputValue(r.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",a),!0)},destroy:function t(){this.input.destroy(),this.menu.destroy()}}),n;function i(t){var n=[].slice.call(arguments,1);return function(){var i=[].slice.call(arguments);e.each(n,(function(e){return t[e].apply(t,i)}))}}}();!function(){"use strict";var r,a,s;function d(e,n){e.each((function(){var e=t(this),i;(i=e.data(a.typeahead))&&n(i,e)}))}function f(t,e){return t.clone().addClass(e.classes.hint).removeData().css(e.css.hint).css(p(t)).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function h(t,e){t.data(a.attrs,{dir:t.attr("dir"),autocomplete:t.attr("autocomplete"),spellcheck:t.attr("spellcheck"),style:t.attr("style")}),t.addClass(e.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!t.attr("dir")&&t.attr("dir","auto")}catch(n){}return t}function p(t){return{backgroundAttachment:t.css("background-attachment"),backgroundClip:t.css("background-clip"),backgroundColor:t.css("background-color"),backgroundImage:t.css("background-image"),backgroundOrigin:t.css("background-origin"),backgroundPosition:t.css("background-position"),backgroundRepeat:t.css("background-repeat"),backgroundSize:t.css("background-size")}}function m(t){var n,i;n=t.data(a.www),i=t.parent().filter(n.selectors.wrapper),e.each(t.data(a.attrs),(function(n,i){e.isUndefined(n)?t.removeAttr(i):t.attr(i,n)})),t.removeData(a.typeahead).removeData(a.www).removeData(a.attr).removeClass(n.classes.input),i.length&&(t.detach().insertAfter(i),i.remove())}function g(n){var i,r;return(r=(i=e.isJQuery(n)||e.isElement(n))?t(n).first():[]).length?r:null}r=t.fn.typeahead,a={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},s={initialize:function r(s,d){var p;return d=e.isArray(d)?d:[].slice.call(arguments,1),p=n((s=s||{}).classNames),this.each(m);function m(){var n,r,m,v,_,y,b,k,w,x,T;e.each(d,(function(t){t.highlight=!!s.highlight})),n=t(this),r=t(p.html.wrapper),m=g(s.hint),v=g(s.menu),_=!1!==s.hint&&!m,y=!1!==s.menu&&!v,_&&(m=f(n,p)),y&&(v=t(p.html.menu).css(p.css.menu)),m&&m.val(""),n=h(n,p),(_||y)&&(r.css(p.css.wrapper),n.css(_?p.css.input:p.css.inputWithNoHint),n.wrap(r).parent().prepend(_?m:null).append(y?v:null)),T=y?l:u,b=new i({el:n}),k=new o({hint:m,input:n},p),w=new T({node:v,datasets:d},p),x=new c({input:k,menu:w,eventBus:b,minLength:s.minLength},p),n.data(a.www,p),n.data(a.typeahead,x)}},isEnabled:function t(){var e;return d(this.first(),(function(t){e=t.isEnabled()})),e},enable:function t(){return d(this,(function(t){t.enable()})),this},disable:function t(){return d(this,(function(t){t.disable()})),this},isActive:function t(){var e;return d(this.first(),(function(t){e=t.isActive()})),e},activate:function t(){return d(this,(function(t){t.activate()})),this},deactivate:function t(){return d(this,(function(t){t.deactivate()})),this},isOpen:function t(){var e;return d(this.first(),(function(t){e=t.isOpen()})),e},open:function t(){return d(this,(function(t){t.open()})),this},close:function t(){return d(this,(function(t){t.close()})),this},select:function e(n){var i=!1,r=t(n);return d(this.first(),(function(t){i=t.select(r)})),i},autocomplete:function e(n){var i=!1,r=t(n);return d(this.first(),(function(t){i=t.autocomplete(r)})),i},moveCursor:function t(e){var n=!1;return d(this.first(),(function(t){n=t.moveCursor(e)})),n},val:function t(e){var n;return arguments.length?(d(this,(function(t){t.setVal(e)})),this):(d(this.first(),(function(t){n=t.getVal()})),n)},destroy:function t(){return d(this,(function(t,e){m(e),t.destroy()})),this}},t.fn.typeahead=function(t){return s[t]?s[t].apply(this,[].slice.call(arguments,1)):s.initialize.apply(this,arguments)},t.fn.typeahead.noConflict=function e(){return t.fn.typeahead=r,this}}()},"function"==typeof define&&define.amd?define("typeahead.js",["jquery"],(function(t){return a(t)})):"object"==typeof n?t.exports=a(e("jquery")):a(jQuery)}).call(this,t)}},"template.af-typeahead.js":function t(){q.__checkName("afTypeAhead"),q.afTypeAhead=new q("Template.afTypeAhead",(function(){var t=this;return R.DIV({class:"typeahead-basics"},"\n ",R.INPUT(R.Attrs({type:"text",value:function(){return M.mustache(M.dot(t.lookup("."),"value"))},placeholder:""},(function(){return M.attrMustache(M.dot(t.lookup("."),"atts"))}))),"\n ")}))},"af-typeahead.coffee":function t(){var e=P="object"==typeof P?P:{};b.addInputType("typeahead",{template:"afTypeAhead",valueIn:function(t,e){return t},valueOut:function(){return this.val()},valueConverters:{stringArray:b.valueConverters.stringToStringArray,number:b.valueConverters.stringToNumber,numerArray:b.valueConverters.stringToNumberArray,boolean:b.valueConverters.stringToBoolean,booleanArray:b.valueConverters.stringToBooleanArray,date:b.valueConverters.stringToDate,dateArray:b.valueConverters.stringToDateArray},contextAdjust:function(t){return void 0===t.atts.maxlength&&"number"==typeof t.max&&(t.atts.maxlength=t.max),t.atts.class="typeahead form-control",t}}),q.afTypeAhead.helpers,q.afTypeAhead.events,q.afTypeAhead.onRendered((function(){var t,e,n,i;return n=this.data.selectOptions,t=this.data.atts.id,e=this.data.name,i=function(t){return function(e,n){var i,r;return i=[],e?(r=new RegExp(e,"i"),$.each(t,(function(t,e){r.test(e)&&i.push(e)})),n(i)):n(t)}},$("#"+t).typeahead({hint:!1,highlight:!0,minLength:0},{name:e,limit:10,source:i(n.getProperty("label"))})}))}},"coreform-number":{"template.steedos-number.js":function t(){q.__checkName("afSteedosNumber"),q.afSteedosNumber=new q("Template.afSteedosNumber",(function(){var t=this;return R.INPUT(R.Attrs({type:"number",value:function(){return M.mustache(M.dot(t.lookup("."),"value"))}},(function(){return M.attrMustache(M.dot(t.lookup("."),"atts"))})))}))},"steedos-number.coffee":function t(){var e=P="object"==typeof P?P:{},n;b.addInputType("steedosNumber",{template:"afSteedosNumber",valueIn:function(t,e){return t?Number(t).toFixed(e.scale):(0).toFixed(e.scale)},valueOut:function(){return b.valueConverters.stringToNumber(this.val())},valueConverters:{string:b.valueConverters.numberToString,stringArray:b.valueConverters.numberToStringArray,numberArray:b.valueConverters.numberToNumberArray,boolean:b.valueConverters.numberToBoolean,booleanArray:b.valueConverters.numberToBooleanArray},contextAdjust:function(t){var e,n;return e=t.atts.scale||0,void 0===t.atts.max&&"number"==typeof t.max&&(t.atts.max=t.max),void 0===t.atts.min&&"number"==typeof t.min&&(t.atts.min=t.min),void 0===t.atts.step&&a.isNumber(e)&&e>0&&(n="0.",a.range(e).forEach((function(t,n){var i;return n===e-1?i+"1":i+"0"})),t.atts.step="0."),t.atts.class="form-control",t.precision=t.atts.precision,t.scale=t.atts.scale,t}}),n=function(t,e,n,i){var r,a;return a=b.getFormId(),r=new Number(t),t.indexOf(".")>-1?t.length-1>n?Number(t.substring(0,n-i-1)).toFixed(i):r.toFixed(i):t.length>n?Number(t.substring(0,n-i)).toFixed(i):r.toFixed(i)},q.afSteedosNumber.events({"blur input[type=number]":function(t,e){return t.currentTarget.value=n(t.currentTarget.value,this.atts.name,this.atts.precision,this.atts.scale)}})}},"coreform-date-mobile":{"template.date.js":function t(){q.__checkName("steedosInputDateMobile"),q.steedosInputDateMobile=new q("Template.steedosInputDateMobile",(function(){var t=this;return R.INPUT(R.Attrs({type:function(){return M.mustache(t.lookup("inputtype"))},value:function(){return M.mustache(M.dot(t.lookup("."),"value"))}},(function(){return M.attrMustache(t.lookup("atts"))})))}))},"date.js":function t(){b.addInputType("steedos-date-mobile",{template:"steedosInputDateMobile",valueIn:function(t,e){let n="datetime";return e.dateMobileOptions&&(n=e.dateMobileOptions.type),"string"==typeof t&&(t=new Date(t)),t="date"===n?k.utc(t).format("YYYY-MM-DD"):k(t).format("YYYY-MM-DDTHH:mm:ss")},valueOut:function(){let t=this.val(),e=this.attr("type");if(!t)return t;if("date"===e)return t;{let e;return(t=k.tz(b.Utility.dateToNormalizedLocalDateAndTimeString(t),"utc").toDate()).setHours(t.getHours()+t.getTimezoneOffset()/60),t}}}),q.steedosInputDateMobile.helpers({atts:function(){var t=a.clone(this.atts);return delete(t=b.Utility.addClass(t,"form-control")).dateMobileOptions,t},inputtype:function(){let t="datetime";switch(this.atts.dateMobileOptions&&(t=this.atts.dateMobileOptions.type),t){case"datetime":return"datetime-local";case"date":return"date";default:return"datetime-local"}}})}},"coreform-html":{"template.html.js":function t(){q.__checkName("steedosInputHtml"),q.steedosInputHtml=new q("Template.steedosInputHtml",(function(){var t=this;return j.If((function(){return M.call(t.lookup("isReadOnly"))}),(function(){return["\n ",R.DIV(R.Attrs((function(){return M.attrMustache(t.lookup("attsPlusFormControlClass"))})),"\n ",j.View("lookup:..value",(function(){return M.makeRaw(M.mustache(M.dot(t.lookup("."),"value")))})),"\n "),"\n ",R.INPUT(R.Attrs({type:"text",value:function(){return M.mustache(M.dot(t.lookup("."),"value"))},style:"display: none"},(function(){return M.attrMustache(M.dot(t.lookup("."),"atts"))}),(function(){return M.attrMustache(t.lookup("attsPlusFormControlClass"))}))),"\n "]}),(function(){return["\n ",R.INPUT(R.Attrs({type:"text",value:function(){return M.mustache(M.dot(t.lookup("."),"value"))}},(function(){return M.attrMustache(M.dot(t.lookup("."),"atts"))}),(function(){return M.attrMustache(t.lookup("attsPlusFormControlClass"))}))),"\n "]}))}))},"html.js":function t(){b.addInputType("steedosHtml",{template:"steedosInputHtml",valueConverters:{stringArray:b.valueConverters.stringToStringArray},contextAdjust:function(t){return void 0===t.atts.maxlength&&"number"==typeof t.max&&(t.atts.maxlength=t.max),t}}),q.steedosInputHtml.helpers({isReadOnly:function(){var t=this.atts;return!(!t.hasOwnProperty("disabled")&&!t.hasOwnProperty("readonly"))}})}}},components:{"slds-quickForm":{"template.slds-quickForm.js":function t(){q.__checkName("quickForm_slds"),q.quickForm_slds=new q("Template.quickForm_slds",(function(){var t=this;return R.DIV({class:function(){return["quickForm_slds ",j.If((function(){return M.call(t.lookup("horizontal"))}),(function(){return"horizontal"}))]}},"\n\t",j._TemplateWith((function(){return M.call(t.lookup("qfAutoFormContext"))}),(function(){return M.include(t.lookupTemplate("autoForm"),(function(){return["\n\t\t",j.If((function(){return M.call(M.dot(t.lookup("schemaFields"),"grouplessFields"))}),(function(){return["\n\t\t\t",j.Each((function(){return M.call(M.dot(t.lookup("schemaFields"),"grouplessFields"))}),(function(){return["\n\t\t\t\t",R.DIV({class:function(){return["slds-grid view-page-section-row ",j.If((function(){return M.dataMustache(t.lookup("has_wide_field"),t.lookup("."))}),(function(){return"wide-fields"}))]}},"\n\t\t\t\t\t",j.Each((function(){return M.call(t.lookup("."))}),(function(){return["\n\t\t\t\t\t\t",R.DIV({class:"slds-has-flexi-truncate slds-p-horizontal_x-small full view-page-block-item"},"\n\t\t\t\t\t\t\t",R.DIV({class:function(){return["slds-form-element slds-form-element_edit slds-grow slds-hint-parent slds-p-vertical_xx-small override--slds-form-element uiInput ",j.If((function(){return M.dataMustache(t.lookup("hasInlineHelpText"),t.lookup("."))}),(function(){return"has-inline-text"}))]}},"\n\t\t\t\t\t\t\t\t",j.If((function(){return M.dataMustache(t.lookup("is_range"),t.lookup("."))}),(function(){return["\n\t\t\t\t\t\t\t\t\t",M.include(t.lookupTemplate("range_field")),"\n\t\t\t\t\t\t\t\t"]}),(function(){return["\n\t\t\t\t\t\t\t\t\t",j.Unless((function(){return M.dataMustache(t.lookup("is_renge_end"),t.lookup("."))}),(function(){return["\n\t\t\t\t\t\t\t\t\t\t",j.If((function(){return M.call(t.lookup("."))}),(function(){return["\n\t\t\t\t\t\t\t\t\t\t\t",j.If((function(){return M.dataMustache(t.lookup("hasInlineHelpText"),t.lookup("."))}),(function(){return["\n\t\t\t\t\t\t\t\t\t\t\t\t",R.DIV({class:"info-popover",id:function(){return["info_popover_",M.mustache(t.lookup("."))]},style:"display: none"},j.View("lookup:hasInlineHelpText",(function(){return M.mustache(t.lookup("hasInlineHelpText"),t.lookup("."))}))),"\n\t\t\t\t\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t\t\t\t\t\t",j.If((function(){return M.call(t.lookup("horizontal"))}),(function(){return["\n\t\t\t\t\t\t\t\t\t\t\t\t",j._TemplateWith((function(){return{name:M.call(t.lookup(".")),class:M.call(M.dataMustache(t.lookup("getClass"),t.lookup("."))),template:M.call("bootstrap3-horizontal"),"label-class":M.call("col-sm-3 col-xs-12"),"input-col-class":M.call("col-sm-9 col-xs-12")}}),(function(){return M.include(t.lookupTemplate("afQuickField"))})),"\n\t\t\t\t\t\t\t\t\t\t\t"]}),(function(){return["\n\t\t\t\t\t\t\t\t\t\t\t\t",j._TemplateWith((function(){return{name:M.call(t.lookup(".")),class:M.call(M.dataMustache(t.lookup("getClass"),t.lookup(".")))}}),(function(){return M.include(t.lookupTemplate("afQuickField"))})),"\n\t\t\t\t\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t"]})),"\n\t\t\t\t"),"\n\t\t\t"]})),"\n\t\t"]})),"\n\n\t\t",j.If((function(){return M.call(M.dot(t.lookup("schemaFields"),"groupFields"))}),(function(){return["\n\t\t\t",j.Each((function(){return M.call(M.dot(t.lookup("schemaFields"),"groupFields"))}),(function(){return["\n\t\t\t\t",j.If((function(){return M.call(M.dot(t.lookup("."),"fields"))}),(function(){return["\n\t\t\t\t\t",R.DIV({class:function(){return["slds-section group-section ",j.If((function(){return M.call(t.lookup("autoExpandGroup"))}),(function(){return"slds-is-open"}))]}},"\n\t\t\t\t\t\t",R.H3({class:"slds-section__title group-section-control"},"\n\t\t\t\t\t\t\t",j._TemplateWith((function(){return{className:M.call("slds-section__title-action"),iconClassName:M.call("slds-section__title-action-icon slds-button__icon_left"),iconCategory:M.call("utility"),iconName:M.call("switch"),variant:M.call("icon"),label:M.call(M.dot(t.lookup("."),"name"))}}),(function(){return M.include(t.lookupTemplate("steedos_button"))})),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t\t",R.DIV({"aria-hidden":"false",class:"slds-section__content",id:"expando-unique-id"},"\n\t\t\t\t\t\t\t",j.Each((function(){return M.call(M.dot(t.lookup("."),"fields"))}),(function(){return["\n\t\t\t\t\t\t\t\t",R.DIV({class:function(){return["slds-grid view-page-section-row ",j.If((function(){return M.dataMustache(t.lookup("has_wide_field"),t.lookup("."))}),(function(){return"wide-fields"}))]}},"\n\t\t\t\t\t\t\t\t\t",j.Each((function(){return M.call(t.lookup("."))}),(function(){return["\n\t\t\t\t\t\t\t\t\t",R.DIV({class:"slds-has-flexi-truncate slds-p-horizontal_x-small full view-page-block-item"},"\n\t\t\t\t\t\t\t\t\t\t",R.DIV({class:function(){return["slds-form-element slds-form-element_edit slds-grow slds-hint-parent slds-p-vertical_xx-small override--slds-form-element uiInput ",j.If((function(){return M.dataMustache(t.lookup("hasInlineHelpText"),t.lookup("."))}),(function(){return"has-inline-text"}))]}},"\n\t\t\t\t\t\t\t\t\t\t",j.If((function(){return M.dataMustache(t.lookup("is_range"),t.lookup("."))}),(function(){return["\n\t\t\t\t\t\t\t\t\t\t\t",M.include(t.lookupTemplate("range_field")),"\n\t\t\t\t\t\t\t\t\t\t"]}),(function(){return["\n\t\t\t\t\t\t\t\t\t\t\t",j.Unless((function(){return M.dataMustache(t.lookup("is_renge_end"),t.lookup("."))}),(function(){return["\n\t\t\t\t\t\t\t\t\t\t\t\t",j.If((function(){return M.call(t.lookup("."))}),(function(){return["\n\t\t\t\t\t\t\t\t\t\t\t\t\t",j.If((function(){return M.dataMustache(t.lookup("hasInlineHelpText"),t.lookup("."))}),(function(){return["\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t",R.DIV({class:"info-popover",id:function(){return["info_popover_",M.mustache(t.lookup("."))]},style:"display: none"},j.View("lookup:hasInlineHelpText",(function(){return M.mustache(t.lookup("hasInlineHelpText"),t.lookup("."))}))),"\n\t\t\t\t\t\t\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t\t\t\t\t\t\t\t",j.If((function(){return M.call(t.lookup("horizontal"))}),(function(){return["\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t",j._TemplateWith((function(){return{name:M.call(t.lookup(".")),class:M.call(M.dataMustache(t.lookup("getClass"),t.lookup("."))),template:M.call("bootstrap3-horizontal"),"label-class":M.call("col-sm-3 col-xs-12"),"input-col-class":M.call("col-sm-9 col-xs-12")}}),(function(){return M.include(t.lookupTemplate("afQuickField"))})),"\n\t\t\t\t\t\t\t\t\t\t\t\t\t"]}),(function(){return["\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t",j._TemplateWith((function(){return{name:M.call(t.lookup(".")),class:M.call(M.dataMustache(t.lookup("getClass"),t.lookup(".")))}}),(function(){return M.include(t.lookupTemplate("afQuickField"))})),"\n\t\t\t\t\t\t\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t"),"\n\t\t\t\t"]})),"\n\t\t\t"]})),"\n\t\t"]})),"\n\n\t\t",j.If((function(){return M.call(M.dot(t.lookup("schemaFields"),"hiddenFields"))}),(function(){return["\n\t\t\t",R.DIV({class:"slds-grid view-page-section-row hidden-fields"},"\n\t\t\t\t",R.DIV({class:"slds-has-flexi-truncate slds-p-horizontal_x-small full view-page-block-item"},"\n\t\t\t\t\t",j.Each((function(){return M.call(M.dot(t.lookup("schemaFields"),"hiddenFields"))}),(function(){return["\n\t\t\t\t\t\t",R.DIV({class:"slds-form-element slds-form-element_edit slds-grow slds-hint-parent slds-p-vertical_xx-small override--slds-form-element uiInput"},"\n\t\t\t\t\t\t\t",j.If((function(){return M.call(t.lookup("."))}),(function(){return["\n\t\t\t\t\t\t\t\t",j.If((function(){return M.call(t.lookup("horizontal"))}),(function(){return["\n\t\t\t\t\t\t\t\t\t",j._TemplateWith((function(){return{name:M.call(t.lookup(".")),class:M.call(M.dataMustache(t.lookup("getClass"),t.lookup("."))),template:M.call("bootstrap3-horizontal"),"label-class":M.call("col-sm-3 col-xs-12"),"input-col-class":M.call("col-sm-9 col-xs-12")}}),(function(){return M.include(t.lookupTemplate("afQuickField"))})),"\n\t\t\t\t\t\t\t\t"]}),(function(){return["\n\t\t\t\t\t\t\t\t\t",j._TemplateWith((function(){return{name:M.call(t.lookup(".")),class:M.call(M.dataMustache(t.lookup("getClass"),t.lookup(".")))}}),(function(){return M.include(t.lookupTemplate("afQuickField"))})),"\n\t\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t"]})),"\n\t\t\t\t"),"\n\t\t\t"),"\n\t\t"]})),"\n\n\t\t",j.If((function(){return M.call(M.dot(t.lookup("schemaFields"),"disabledFields"))}),(function(){return["\n\t\t\t",R.DIV({class:"slds-grid view-page-section-row disabled-fields"},"\n\t\t\t\t",R.DIV({class:"slds-has-flexi-truncate slds-p-horizontal_x-small full view-page-block-item"},"\n\t\t\t\t\t",j.Each((function(){return M.call(M.dot(t.lookup("schemaFields"),"disabledFields"))}),(function(){return["\n\t\t\t\t\t\t",R.DIV({class:"slds-form-element slds-form-element_edit slds-grow slds-hint-parent slds-p-vertical_xx-small override--slds-form-element uiInput"},"\n\t\t\t\t\t\t\t",j.If((function(){return M.call(t.lookup("."))}),(function(){return["\n\t\t\t\t\t\t\t\t",j.If((function(){return M.call(t.lookup("horizontal"))}),(function(){return["\n\t\t\t\t\t\t\t\t\t",j._TemplateWith((function(){return{name:M.call(t.lookup(".")),disabled:M.call(!1),readonly:M.call(!0),class:M.call(M.dataMustache(t.lookup("getClass"),t.lookup("."))),template:M.call("bootstrap3-horizontal"),"label-class":M.call("col-sm-3 col-xs-12"),"input-col-class":M.call("col-sm-9 col-xs-12")}}),(function(){return M.include(t.lookupTemplate("afQuickField"))})),"\n\t\t\t\t\t\t\t\t"]}),(function(){return["\n\t\t\t\t\t\t\t\t\t",j._TemplateWith((function(){return{name:M.call(t.lookup(".")),disabled:M.call(!1),readonly:M.call(!0),class:M.call(M.dataMustache(t.lookup("getClass"),t.lookup(".")))}}),(function(){return M.include(t.lookupTemplate("afQuickField"))})),"\n\t\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t"]})),"\n\t\t\t\t"),"\n\t\t\t"),"\n\t\t"]})),"\n\t"]}))})),"\n\t")})),q.__checkName("range_field"),q.range_field=new q("Template.range_field",(function(){var t=this;return R.DIV({class:function(){return["range-field field-code-",M.mustache(t.lookup("startName"))]}},"\n\t\t",R.DIV({class:"form-group"},"\n\t\t\t",R.LABEL({class:"col-sm-3 control-label",for:"dao2yaGvD4SFjifBi"},"\n\t\t\t\t",j.View("lookup:afFieldLabelText",(function(){return M.mustache(t.lookup("afFieldLabelText"),M.kw({name:t.lookup("startName"),class:"col-sm-3 col-xs-12"}))})),"\n\t\t\t"),"\n\t\t\t",R.DIV({class:"col-sm-9 col-xs-12"},"\n\t\t\t\t",R.DIV({class:"row show-grid"},"\n\t\t\t\t\t",R.DIV({class:"col-sm-6 col-xs-6 start"},j._TemplateWith((function(){return{name:M.call(t.lookup("startName")),class:M.call(M.dataMustache(t.lookup("getClass"),t.lookup("."))),label:M.call(!1)}}),(function(){return M.include(t.lookupTemplate("afQuickField"))}))),"\n\t\t\t\t\t",R.DIV({class:"col-sm-6 col-xs-6 end"},j._TemplateWith((function(){return{name:M.call(t.lookup("endName")),class:M.call(M.dataMustache(t.lookup("getClass"),t.lookup("."))),label:M.call(!1)}}),(function(){return M.include(t.lookupTemplate("afQuickField"))}))),"\n\t\t\t\t"),"\n\t\t\t"),"\n\t\t"),"\n\t")}))},"slds-quickForm.coffee":function t(){var e=P="object"==typeof P?P:{};q.quickForm_slds.helpers({isDisabled:function(t){var e,n,i,r;return null!=(e=q.instance())&&null!=(n=e.data)&&null!=(i=n.qfAutoFormContext.schema._schema[t])&&null!=(r=i.autoform)?r.disabled:void 0},hasInlineHelpText:function(t){var e,n,i,r;return null!=(e=q.instance())&&null!=(n=e.data)&&null!=(i=n.qfAutoFormContext.schema._schema[t])&&null!=(r=i.autoform)?r.inlineHelpText:void 0},is_range:function(t){var e,n,i,r;return null!=(e=q.instance())&&null!=(n=e.data)&&null!=(i=n.qfAutoFormContext.schema._schema[t])&&null!=(r=i.autoform)?r.is_range:void 0},is_renge_end:function(t){return null!=t?t.endsWith("_endLine"):void 0},getClass:function(t){var e,n,i,r;if("steedosGrid"!==(null!=(e=q.instance())&&null!=(n=e.data)&&null!=(i=n.qfAutoFormContext.schema._schema[t])&&null!=(r=i.autoform)?r.type:void 0))return"form-control"},schemaFields:function(){var t,e,n,i,o,s,u,l,c,d,f,h,p;return d=[],p=this.qfAutoFormContext.schema,h=p._schema,s=p._firstLevelSchemaKeys,(f=this.qfAutoFormContext.fields||s)||(f=[]),a.each(h,(function(t,e){var n;if(a.indexOf(s,e)>-1&&!(null!=(n=t.autoform)?n.omit:void 0))return d.push(e)})),1===d.length?o={grouplessFields:[d]}:(l=Creator.getHiddenFields(h),t=Creator.getDisabledFields(h),n=[],i=[],c=r.get("cmEditSingleField"),u=[],u=Creator.getFieldsWithNoGroup(h),u=Creator.getFieldsInFirstLevel(s,u),f&&(u=a.intersection(f,u)),u=Creator.getFieldsWithoutOmit(h,u),u=Creator.getFieldsForReorder(h,u,c),e=Creator.getSortedFieldGroupNames(h),a.each(e,(function(t){return i=Creator.getFieldsForGroup(h,t),i=Creator.getFieldsInFirstLevel(s,i),f&&(i=a.intersection(f,i)),i=Creator.getFieldsWithoutOmit(h,i),i=Creator.getFieldsForReorder(h,i,c),n.push({name:t,fields:i})})),o={grouplessFields:u,groupFields:n,hiddenFields:l,disabledFields:t})},horizontal:function(){return q.instance().data.atts.horizontal},is_range_fields:function(t){var e,n,i,r;if((null!=t?t.length:void 0)>0&&t[0])return null!=(e=q.instance())&&null!=(n=e.data)&&null!=(i=n.qfAutoFormContext.schema._schema[t[0]])&&null!=(r=i.autoform)?r.is_range:void 0},has_wide_field:function(t){var e,n,i,r;if((null!=t?t.length:void 0)>0&&t[0])return null!=(e=q.instance())&&null!=(n=e.data)&&null!=(i=n.qfAutoFormContext.schema._schema[t[0]])&&null!=(r=i.autoform)?r.is_wide:void 0},autoExpandGroup:function(){return q.instance().data.atts.autoExpandGroup||!1}}),q.quickForm_slds.events({"click .group-section-control":function(t,e){return t.preventDefault(),t.stopPropagation(),$(t.currentTarget).closest(".group-section").toggleClass("slds-is-open")}}),q.quickForm_slds.onRendered((function(){var t;return t=this,this.$(".has-inline-text").each((function(){var t,e;return t='\n\t\n',$(".control-label",$(this)).append(t)})),this.$(".info-popover").each((function(){var t;return t=$("~ .form-group .help-info",$(this)).attr("id"),$(this).dxPopover({target:"#"+t,showEvent:"mouseenter",hideEvent:"mouseleave",position:"top",width:300,animation:{show:{type:"pop",from:{scale:0},to:{scale:1}},hide:{type:"fade",from:1,to:0}}})}))})),q.range_field.helpers({startName:function(){return this.toString()},endName:function(){return this.toString()+"_endLine"},getClass:function(t){return"form-control"}})}}}}}}}}},{extensions:[".js",".json",".coffee",".html",".less"]});W("/node_modules/meteor/steedos:autoform/client/core.coffee"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/boolean-checkbox/template.boolean-checkbox.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/boolean-checkbox/boolean-checkbox.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/boolean-toggle/template.boolean-toggle.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/boolean-toggle/boolean-toggle.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-org-localdata/template.select-orgs.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-org-localdata/select-orgs.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-org/lib/template.cf_organization.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-org/lib/cf_organization.coffee"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-org/lib/template.cf_organization_modal.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-org/lib/cf_organization_modal.coffee"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-org/template.select-orgs.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-org/select-orgs.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-user-localdata/template.select-users.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-user-localdata/select-users.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-user/lib/cf_data_manager.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-user/lib/cf_tabular_space_user.coffee"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-user/lib/template.cf_contact_modal.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-user/lib/cf_contact_modal.coffee"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-user/lib/template.cf_organization_list.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-user/lib/cf_organization_list.coffee"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-user/lib/template.cf_space_user_list.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-user/lib/cf_space_user_list.coffee"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-user/lib/template.cf_organization_modal.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-user/lib/cf_organization_modal.coffee"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-user/template.select-users.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-user/select-users.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-tree/template.select-tree.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-tree/select-tree.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-email/template.email.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-email/email.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-url/template.url.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-url/url.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-widearea/template.widearea.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-widearea/widearea.coffee"),W("/node_modules/meteor/steedos:autoform/client/coreform/components/slds-quickForm/template.slds-quickForm.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/components/slds-quickForm/slds-quickForm.coffee"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-typeahead/typeahead.js/bloodhound.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-typeahead/typeahead.js/typeahead.bundle.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-typeahead/typeahead.js/typeahead.jquery.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-typeahead/template.af-typeahead.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-typeahead/af-typeahead.coffee"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-number/template.steedos-number.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-number/steedos-number.coffee"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-date-mobile/template.date.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-date-mobile/date.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-html/template.html.js"),W("/node_modules/meteor/steedos:autoform/client/coreform/inputTypes/coreform-html/html.js"),Package._define("steedos:autoform",{CFDataManager:L})}(); -!function(){var Meteor=Package.meteor.Meteor,global=Package.meteor.global,meteorEnv=Package.meteor.meteorEnv,ReactiveVar=Package["reactive-var"].ReactiveVar,ReactiveDict=Package["reactive-dict"].ReactiveDict,Random=Package.random.Random,DDP=Package["ddp-client"].DDP,check=Package.check.check,Match=Package.check.Match,_=Package.underscore._,Tracker=Package.tracker.Tracker,Deps=Package.tracker.Deps,Session=Package.session.Session,Blaze=Package.ui.Blaze,UI=Package.ui.UI,Handlebars=Package.ui.Handlebars,Template=Package["templating-runtime"].Template,SimpleSchema=Package["aldeed:simple-schema"].SimpleSchema,MongoObject=Package["aldeed:simple-schema"].MongoObject,Tabular=Package["aldeed:tabular"].Tabular,AutoForm=Package["aldeed:autoform"].AutoForm,CollectionHooks=Package["matb33:collection-hooks"].CollectionHooks,BlazeLayout=Package["kadira:blaze-layout"].BlazeLayout,FlowRouter=Package["kadira:flow-router"].FlowRouter,SubsManager=Package["meteorhacks:subs-manager"].SubsManager,moment=Package["momentjs:moment"].moment,UniSelectize=Package["steedos:autoform-lookup"].UniSelectize,Accounts=Package["accounts-base"].Accounts,Selector=Package["steedos:base"].Selector,Steedos=Package["steedos:base"].Steedos,AjaxCollection=Package["steedos:base"].AjaxCollection,SteedosDataManager=Package["steedos:base"].SteedosDataManager,SteedosOffice=Package["steedos:base"].SteedosOffice,Modal=Package["steedos:base"].Modal,CFDataManager=Package["steedos:autoform"].CFDataManager,Push=Package["raix:push"].Push,Logger=Package["steedos:logger"].Logger,_i18n=Package["universe:i18n"]._i18n,i18n=Package["universe:i18n"].i18n,Promise=Package.promise.Promise,meteorInstall=Package.modules.meteorInstall,HTML=Package.htmljs.HTML,Collection2=Package["aldeed:collection2-core"].Collection2,FS=Package["steedos:cfs-base-package"].FS,Spacebars=Package.spacebars.Spacebars,Mongo=Package.mongo.Mongo,__coffeescriptShare,regions,require=meteorInstall({node_modules:{meteor:{"steedos:creator":{"core.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Creator.getSchema=function(e){var t;return null!=(t=Creator.getObject(e))?t.schema:void 0},Creator.getObjectHomeComponent=function(e){return!1},Creator.getObjectUrl=function(e,t,r){var o,a;return r||(r=Session.get("app_id")),e||(e=Session.get("object_name")),a=null!=(o=Creator.getListView(e,null))?o._id:void 0,t?Creator.getRelativeUrl("/app/"+r+"/"+e+"/view/"+t):Creator.getObjectHomeComponent(e)?Creator.getRelativeUrl("/app/"+r+"/"+e):a?Creator.getRelativeUrl("/app/"+r+"/"+e+"/grid/"+a):Creator.getRelativeUrl("/app/"+r+"/"+e)},Creator.getObjectAbsoluteUrl=function(e,t,r){var o,a;return r||(r=Session.get("app_id")),e||(e=Session.get("object_name")),a=null!=(o=Creator.getListView(e,null))?o._id:void 0,t?Steedos.absoluteUrl("/app/"+r+"/"+e+"/view/"+t,!0):Steedos.absoluteUrl("/app/"+r+"/"+e+"/grid/"+a,!0)},Creator.getObjectRouterUrl=function(e,t,r){var o,a;return r||(r=Session.get("app_id")),e||(e=Session.get("object_name")),a=null!=(o=Creator.getListView(e,null))?o._id:void 0,t?"/app/"+r+"/"+e+"/view/"+t:"/app/"+r+"/"+e+"/grid/"+a},Creator.getListViewUrl=function(e,t,r){var o;return o=Creator.getListViewRelativeUrl(e,t,r),Creator.getRelativeUrl(o)},Creator.getListViewRelativeUrl=function(e,t,r){return"/app/"+t+"/"+e+"/grid/"+r},Creator.getSwitchListUrl=function(e,t,r){return r?Creator.getRelativeUrl("/app/"+t+"/"+e+"/"+r+"/list"):Creator.getRelativeUrl("/app/"+t+"/"+e+"/list/switch")},Creator.getRelatedObjectUrl=function(e,t,r,o,a){return a?Creator.getRelativeUrl("/app/"+t+"/"+e+"/"+r+"/"+o+"/grid?related_field_name="+a):Creator.getRelativeUrl("/app/"+t+"/"+e+"/"+r+"/"+o+"/grid")},Creator.getObjectLookupFieldOptions=function(e,t,r,o){var a,n,i,s,c,l;return n=[],e?(i=null!=(a=Creator.getObject(e))?a.fields:void 0,s=null!=a?a.icon:void 0,_.forEach(i,(function(e,t){if(!r||!e.hidden)return"select"===e.type?n.push({label:""+(e.label||t),value:""+t,icon:s}):n.push({label:e.label||t,value:t,icon:s})})),t&&_.forEach(i,(function(e,t){var o;if(!r||!e.hidden)return("lookup"===e.type||"master_detail"===e.type)&&e.reference_to&&_.isString(e.reference_to)&&(o=Creator.getObject(e.reference_to))?_.forEach(o.fields,(function(r,a){return n.push({label:(e.label||t)+"=>"+(r.label||a),value:t+"."+a,icon:null!=o?o.icon:void 0})})):void 0})),o&&(c=Creator.getRelatedObjects(e),_.each(c,(l=this,function(e){var t,r;return r=Creator.getObjectLookupFieldOptions(e.object_name,!1,!1,!1),t=Creator.getObject(e.object_name),_.each(r,(function(r){if(e.foreign_key!==r.value)return n.push({label:(t.label||t.name)+"=>"+r.label,value:t.name+"."+r.value,icon:null!=t?t.icon:void 0})}))}))),n):n},Creator.getObjectFilterFieldOptions=function(e){var t,r,o,a,n;return r=[],e?(o=null!=(t=Creator.getObject(e))?t.fields:void 0,n=Creator.getFields(e),a=null!=t?t.icon:void 0,_.forEach(o,(function(e,t){if(!_.include(["grid","object","[Object]","[object]","Object","avatar","image","markdown","html"],e.type)&&!e.hidden&&!/\w+\./.test(t)&&_.indexOf(n,t)>-1)return r.push({label:e.label||t,value:t,icon:a})})),r):r},Creator.getObjectFieldOptions=function(e){var t,r,o,a,n;return r=[],e?(o=null!=(t=Creator.getObject(e))?t.fields:void 0,n=Creator.getFields(e),a=null!=t?t.icon:void 0,_.forEach(o,(function(e,t){if(!_.include(["grid","object","[Object]","[object]","Object","markdown","html"],e.type)&&!/\w+\./.test(t)&&_.indexOf(n,t)>-1)return r.push({label:e.label||t,value:t,icon:a})})),r):r},Creator.getFiltersWithFilterFields=function(e,t,r){return e||(e=[]),r||(r=[]),(null!=r?r.length:void 0)&&r.forEach((function(r){if(_.isString(r)&&(r={field:r,required:!1}),t[r.field]&&!_.findWhere(e,{field:r.field}))return e.push({field:r.field,is_default:!0,is_required:r.required})})),e.forEach((function(e){var t;return t=r.find((function(t){return t===e.field||t.field===e.field})),_.isString(t)&&(t={field:t,required:!1}),t?(e.is_default=!0,e.is_required=t.required):(delete e.is_default,delete e.is_required)})),e},Creator.getObjectRecord=function(e,t,r,o){var a,n,i,s,c,l;if(e||(e=Session.get("object_name")),t||(t=Session.get("record_id")),Meteor.isClient){if(e!==Session.get("object_name")||t!==Session.get("record_id"))return Creator.odata.get(e,t,r,o);if(null!=(s=Template.instance())?s.record:void 0)return null!=(c=Template.instance())&&null!=(l=c.record)?l.get():void 0}if("meteor"!==(n=Creator.getObject(e)).database_name&&n.database_name){if(e&&t)return Creator.odata.get(e,t,r,o)}else if(a=Creator.getCollection(e))return i=a.findOne(t)},Creator.getObjectRecordName=function(e,t){var r,o;if(e||(e=Creator.getObjectRecord()),e&&(r="organizations"===t?"name":null!=(o=Creator.getObject(t))?o.NAME_FIELD_KEY:void 0,e&&r))return e.label||e[r]},Creator.getApp=function(e){var t,r;return(t=Session.get("_app_menus")||Session.get("app_menus"))?r=t.find((function(t){return t.id===e})):{}},Creator.getAppDashboard=function(e){var t,r;if(t=Creator.getApp(e))return r=null,_.each(Creator.Dashboards,(function(e,o){var a;if((null!=(a=e.apps)?a.indexOf(t._id):void 0)>-1)return r=e})),r},Creator.getAppDashboardComponent=function(e){var t;t=Creator.getApp(e)},Creator.getAppObjectNames=function(e){var t,r,o,a;if(t=Creator.getApp(e))return r=(o=Steedos.isMobile())?t.mobile_objects:t.objects,a=[],t&&_.each(r,(function(e){var t;if(null!=(t=Creator.getObject(e))?t.permissions.get().allowRead:void 0)return a.push(e)})),a},Creator.getUrlWithToken=function(e,t){var r,o,a;return(a={})["X-Space-Id"]=Steedos.spaceId(),a["X-User-Id"]=Steedos.userId(),a["X-Company-Ids"]=Steedos.getUserCompanyIds(),a["X-Auth-Token"]=Accounts._storedLoginToken(),Steedos.isExpression(e)&&(e=Steedos.parseSingleExpression(e,t,"#",Creator.USER_CONTEXT)),""+e+(o=(r=/(\#.+\?)|(\?[^#]*$)/g.test(e))?"&":"?")+$.param(a)},Creator.getAppMenu=function(e,t){var r;return(r=Creator.getAppMenus(e))&&r.find((function(e){return e.id===t}))},Creator.getAppMenuUrlForInternet=function(e){return Creator.getUrlWithToken(e.path,e)},Creator.getAppMenuUrl=function(e){var t;return t=e.path,"url"===e.type?e.target?Creator.getAppMenuUrlForInternet(e):"/app/-/tab_iframe/"+e.id:e.path},Creator.getAppMenus=function(e){var t,r;return(t=Session.get("_app_menus")||Session.get("app_menus"))?(r=t.find((function(t){return t.id===e})))?r.children:void 0:[]},Creator.loadAppsMenus=function(){var e,t,r;return e={},(t=Steedos.isMobile())&&(e.mobile=t),r={type:"get",data:e,success:function(e){return Session.set("app_menus",e)}},null!=Steedos?Steedos.authRequest("/service/api/apps/menus",r):void 0},Creator.creatorAppsSelector=function(e,t){var r,o,a;return r=void 0,a=void 0,_.each(e,(function(e,t){e._id||(e._id=t),e.is_creator||(e.visible=!1)})),a=_.sortBy(_.values(e),"sort"),o={},r={},_.each(a,(function(e){return"admin"===e._id?r=e:o[e._id]=e})),o.admin=r,t.length&&_.each(o,(function(e,r){t.indexOf(r)>-1?e.visible=e.is_creator:e.visible=!1})),o},Creator.visibleAppsSelector=function(e,t){var r;return null==t&&(t=!0),r=[],_.each(e,(function(e,o){(!1!==e.visible&&"admin"!==e._id||t&&"admin"===e._id)&&r.push(e)})),r},Creator.getVisibleApps=function(e){var t,r;return t=Creator._subApp.get(),r=Object.assign({},Creator.Apps,{apps:t}),Creator.visibleAppsSelector(r,e)},Creator.getVisibleAppsObjects=function(){var e,t,r;return e=Creator.getVisibleApps(),r=_.flatten(_.pluck(e,"objects")),t=(t=_.filter(Creator.Objects,(function(e){return!(r.indexOf(e.name)<0)}))).sort(Creator.sortingMethod.bind({key:"label"})),t=_.pluck(t,"name"),_.uniq(t)},Creator.getAppsObjects=function(){var e,t;return e=[],t=[],_.forEach(Creator.Apps,(function(r){return t=_.filter(r.objects,(function(e){return!e.hidden})),e=e.concat(t)})),_.uniq(e)},Creator.validateFilters=function(e,t){var r,o,a,n,i,s,c;if(a=_.map(e,(function(e){return!_.isEmpty(e)&&e})),a=_.compact(a),o="",n=a.length,t){if(t=t.replace(/\n/g,"").replace(/\s+/g," "),/[._\-!+]+/gi.test(t)&&(o="含有特殊字符。"),!o)if(s=t.match(/\d+/gi))for(s.forEach((function(e){if(e<1||e>n)return o="您的筛选条件引用了未定义的筛选器:"+e+"。"})),i=1;i<=n;)s.includes(""+i)||(o="有些筛选条件进行了定义,但未在高级筛选条件中被引用。"),i++;else o="有些筛选条件进行了定义,但未在高级筛选条件中被引用。";if(o||(c=t.match(/[a-zA-Z]+/gi))&&c.forEach((function(e){if(!/^(and|or)$/gi.test(e))return o="检查您的高级筛选条件中的拼写。"})),!o){try{Creator.eval(t.replace(/and/gi,"&&").replace(/or/gi,"||"))}catch(l){r=l,o="您的筛选器中含有特殊字符"}(/(AND)[^()]+(OR)/gi.test(t)||/(OR)[^()]+(AND)/gi.test(t))&&(o="您的筛选器必须在连续性的 AND 和 OR 表达式前后使用括号。")}}return!o||(console.log("error",o),Meteor.isClient&&toastr.error(o),!1)},Creator.formatFiltersToMongo=function(e,t){var r;if(null!=e?e.length:void 0)return e[0]instanceof Array||(e=_.map(e,(function(e){return[e.field,e.operation,e.value]}))),r=[],_.each(e,(function(e){var o,a,n,i,s;return o=e[0],a=e[1],s=Meteor.isClient?Creator.evaluateFormula(e[2]):Creator.evaluateFormula(e[2],null,t),(i={})[o]={},"="===a?i[o].$eq=s:"<>"===a?i[o].$ne=s:">"===a?i[o].$gt=s:">="===a?i[o].$gte=s:"<"===a?i[o].$lt=s:"<="===a?i[o].$lte=s:"startswith"===a?(n=new RegExp("^"+s,"i"),i[o].$regex=n):"contains"===a?(n=new RegExp(s,"i"),i[o].$regex=n):"notcontains"===a&&(n=new RegExp("^((?!"+s+").)*$","i"),i[o].$regex=n),r.push(i)})),r},Creator.isBetweenFilterOperation=function(e){var t;return"between"===e||!!(null!=(t=Creator.getBetweenTimeBuiltinValues(!0))?t[e]:void 0)},Creator.formatFiltersToDev=function(e,t,r){var o,a;if(e.length)return(null!=r?r.is_logic_or:void 0)&&(o=[],e.forEach((function(e){return o.push(e),o.push("or")})),o.pop(),e=o),a=SteedosFilters.formatFiltersToDev(e,Creator.USER_CONTEXT)},Creator.formatLogicFiltersToDev=function(e,t,r){var o;return o="["+(o=(o=t.replace(/\(\s+/gi,"(").replace(/\s+\)/gi,")").replace(/\(/g,"[").replace(/\)/g,"]").replace(/\s+/g,",").replace(/(and|or)/gi,"'$1'")).replace(/(\d)+/gi,(function(t){var o,a,n,i,s;return o=e[t-1],a=o.field,n=o.operation,s=Meteor.isClient?Creator.evaluateFormula(o.value):Creator.evaluateFormula(o.value,null,r),i=[],!0===_.isArray(s)?("="===n?_.each(s,(function(e){return i.push([a,n,e],"or")})):"<>"===n?_.each(s,(function(e){return i.push([a,n,e],"and")})):_.each(s,(function(e){return i.push([a,n,e],"or")})),"and"!==i[i.length-1]&&"or"!==i[i.length-1]||i.pop()):i=[a,n,s],JSON.stringify(i)})))+"]",Creator.eval(o)},Creator.getRelatedObjects=function(e,t,r){var o,a,n,i,s;return Meteor.isClient&&(e||(e=Session.get("object_name")),t||(t=Session.get("spaceId")),r||(r=Meteor.userId())),n=[],(o=Creator.getObject(e))?(i=Creator.getObjectRelateds(o._collection_name),0===(null!=(n=_.pluck(i,"object_name"))?n.length:void 0)?n:(s=(a=Creator.getPermissions(e,t,r)).unrelated_objects,n=_.difference(n,s),_.filter(i,(function(e){var o,i,s,c;return c=e.object_name,i=n.indexOf(c)>-1,o=null!=(s=Creator.getPermissions(c,t,r))?s.allowRead:void 0,"cms_files"===c&&(o=o&&a.allowReadFiles),i&&o})))):n},Creator.getRelatedObjectNames=function(e,t,r){var o;return o=Creator.getRelatedObjects(e,t,r),_.pluck(o,"object_name")},Creator.getRelatedObjectListActions=function(e,t,r){var o;return o=Creator.getActions(e,t,r),o=_.filter(o,(function(e){return"standard_follow"!==e.name&&("standard_query"!==e.name&&("list"===e.on&&("function"==typeof e.visible?e.visible():e.visible)))}))},Creator.getActions=function(e,t,r){var o,a,n,i,s,c;if(Meteor.isClient&&(e||(e=Session.get("object_name")),t||(t=Session.get("spaceId")),r||(r=Meteor.userId())),n=Creator.getObject(e))return i=Creator.getPermissions(e,t,r),a=i.disabled_actions,o=_.sortBy(_.values(n.actions),"sort"),_.has(n,"allow_customActions")&&(o=_.filter(o,(function(e){return _.include(n.allow_customActions,e.name)||_.include(_.keys(Creator.getObject("base").actions)||{},e.name)}))),_.has(n,"exclude_actions")&&(o=_.filter(o,(function(e){return!_.include(n.exclude_actions,e.name)}))),_.each(o,(function(e){if(Steedos.isMobile()&&["record","record_only"].indexOf(e.on)>-1&&"standard_edit"!==e.name)return"record_only"===e.on?e.on="record_only_more":e.on="record_more"})),Steedos.isMobile()&&["cms_files","cfs.files.filerecord"].indexOf(e)>-1&&(null!=(s=o.find((function(e){return"standard_edit"===e.name})))&&(s.on="record_more"),null!=(c=o.find((function(e){return"download"===e.name})))&&(c.on="record")),o=_.filter(o,(function(e){return _.indexOf(a,e.name)<0}))},Creator.getListViews=function(e,t,r){var o,a,n,i,s,c;if(Meteor.isClient&&(e||(e=Session.get("object_name")),t||(t=Session.get("spaceId")),r||(r=Meteor.userId())),e&&(s=Creator.getObject(e)))return o=(null!=(c=Creator.getPermissions(e,t,r))?c.disabled_list_views:void 0)||[],i=[],a=Steedos.isMobile(),_.each(s.list_views,(function(e,t){return e.name=t})),n=_.sortBy(_.values(s.list_views),"sort_no"),_.each(n,(function(e){var t;if(!a||"calendar"!==e.type)return"default"===e.name||(t=_.indexOf(o,e.name)>-1||e._id&&_.indexOf(o,e._id)>-1)&&e.owner!==r?void 0:i.push(e)})),i},Creator.getFields=function(e,t,r){var o,a,n;return Meteor.isClient&&(e||(e=Session.get("object_name")),t||(t=Session.get("spaceId")),r||(r=Meteor.userId())),o=Creator.getObjectFieldsName(e),n=null!=(a=Creator.getPermissions(e,t,r))?a.unreadable_fields:void 0,_.difference(o,n)},Creator.isloading=function(){return!Creator.bootstrapLoaded.get()},Creator.convertSpecialCharacter=function(e){return e.replace(/([\^\$\(\)\*\+\?\.\\\|\[\]\{\}])/g,"\\$1")},Creator.getDisabledFields=function(e){var t;return t=_.map(e,(function(e,t){return e.autoform&&e.autoform.disabled&&!e.autoform.omit&&t})),t=_.compact(t)},Creator.getHiddenFields=function(e){var t;return t=_.map(e,(function(e,t){return e.autoform&&"hidden"===e.autoform.type&&!e.autoform.omit&&t})),t=_.compact(t)},Creator.getFieldsWithNoGroup=function(e){var t;return t=_.map(e,(function(e,t){return(!e.autoform||!e.autoform.group||"-"===e.autoform.group)&&(!e.autoform||"hidden"!==e.autoform.type)&&t})),t=_.compact(t)},Creator.getSortedFieldGroupNames=function(e){var t;return t=_.map(e,(function(e){return e.autoform&&"-"!==e.autoform.group&&e.autoform.group})),t=_.compact(t),t=_.unique(t)},Creator.getFieldsForGroup=function(e,t){var r;return r=_.map(e,(function(e,r){return e.autoform&&e.autoform.group===t&&"hidden"!==e.autoform.type&&r})),r=_.compact(r)},Creator.getSystemBaseFields=function(){return["created","created_by","modified","modified_by"]},Creator.getFieldsWithoutSystemBase=function(e){return _.difference(e,Creator.getSystemBaseFields())},Creator.getFieldsWithoutOmit=function(e,t){return t=_.map(t,(function(t){var r,o;return(null==(o=(r=_.pick(e,t))[t].autoform)||!o.omit)&&t})),t=_.compact(t)},Creator.getFieldsInFirstLevel=function(e,t){return t=_.map(t,(function(t){return _.indexOf(e,t)>-1&&t})),t=_.compact(t)},Creator.getFieldsForReorder=function(e,t,r){var o,a,n,i,s,c,l,u;for(n=[],i=0,o=_.filter(t,(function(e){return!e.endsWith("_endLine")}));i-1&&(o=e[t].data_type),o):"text"},Meteor.isServer&&(Creator.getAllRelatedObjects=function(e){var t;return t=[],_.each(Creator.Objects,(function(r,o){return _.each(r.fields,(function(r,a){if("master_detail"===r.type&&r.reference_to&&r.reference_to===e)return t.push(o)}))})),Creator.getObject(e).enable_files&&t.push("cms_files"),t}),Meteor.isServer&&(Steedos.formatIndex=function(e){var t,r,o,a,n,i;return o={background:!0},(r=(null!=(a=Meteor.settings)&&null!=(n=a.datasources)&&null!=(i=n.default)?i.documentDB:void 0)||!1)&&e.length>0&&(t=e.join("."),o.name=t,t.length>52&&(o.name=t.substring(0,52))),o})},lib:{"apps.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Creator.appsByName={}},"object_recent.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};this.ObjectRecent={},ObjectRecent.insert=function(e,t,r){return Meteor.call("object_recent_viewed",e,t,Session.get("spaceId"),(function(){if(r&&_.isFunction(r))return r()}))}},"filters_transform.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},r;this.FiltersTransform={},r=function(e){return["date","datetime","time","currency","number"].includes(e)?"between":["text","textarea","html"].includes(e)?"contains":"="},FiltersTransform.queryToFilters=function(e){var t,o,a,n;if(e)return n=e.query,a=e.object_name,o=Creator.getObject(a).fields,t=[],_.each(n,(function(e,a){var n,i;if(o[a]){if(i=Creator.getFieldDataType(o,a),["date","datetime","time","currency","number"].includes(i))return t.push({field:a,operation:r(i),start_value:e,value:[e,null]});if(!["text","textarea","html"].includes(i))return["boolean"].includes(i)?t.push({field:a,operation:"=",value:e}):t.push({field:a,operation:r(i),value:e});if(_.isString(e))return t.push({field:a,operation:r(i),value:e});if(_.isArray(e))return t.push({field:a,operation:"=",value:e})}else if(a=a.replace(/(_endLine)$/,""),i=Creator.getFieldDataType(o,a),o[a]&&["date","datetime","time","currency","number"].includes(i))return(n=_.find(t,(function(e){return e.field===a})))?(n.end_value=e,n.value[1]=e):t.push({field:a,operation:r(i),end_value:e,value:[null,e]})})),t}},"form_manager.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},r,o;this.FormManager={},SimpleSchema.messages({formValidate:"[value]"}),FormManager.getRelatedInitialValues=(o=this,function(e,t,r){var o,a,n,i,s;if(!_.isString(t))throw new Meteor.Error("main_record_id must be String");return o={},i="",Creator.getRelatedList(e,t).forEach((function(e){if(r===e.object_name)return i=e.related_field_name})),a="company_id",(s=Creator.getObject(r))&&i&&s.fields[i]&&s.fields[i].reference_to_field&&(a=a+","+s.fields[i].reference_to_field),(n=Creator.odata.get(e,t,a))&&i&&n[s.fields[i].reference_to_field]&&(t=n[s.fields[i].reference_to_field]),o={},i&&("objects"===e?o[i]=Creator.getObjectRecord().name:(s=Creator.getObject(r),_.isString(s.fields[i].reference_to)?s.fields[i].multiple?o[i]=[t]:o[i]=t:o[i]={o:e,ids:[t]})),!_.has(o,"company_id")&&(null!=n?n.company_id:void 0)&&(o.company_id=n.company_id),o=Object.assign({},o,FormManager.getInitialValues(r,o))}),FormManager.getInitialValues=function(e,t){var r,o,a;return o=null!=(r=Creator.getObject(e))&&null!=(a=r.form)?a.initialValues:void 0,_.isFunction(o)?o.apply({doc:t||{}}):{}},FormManager.validate=function(e,t){var r,o,a,n,i,s;if(a=null!=(o=Creator.getObject(e))&&null!=(n=o.form)?n.validate:void 0,_.isFunction(a))try{if(s=a.apply({},[null!=(i=AutoForm.getFormValues(t))?i.insertDoc:void 0]),_.isBoolean(s)&&!1===s)return!1;if(!_.isEmpty(s)&&_.isObject(s))return _.each(s,(function(e,r){return AutoForm.addStickyValidationError(t,r,"formValidate",e),toastr.error(e)})),!1}catch(c){return r=c,console.error(r),toastr.error(r.message),!1}return!0},FormManager.onSubmit=function(e,t){var r,o,a,n,i;return o=null!=(r=Creator.getObject(e))&&null!=(n=r.form)?n.onSubmit:void 0,!(_.isFunction(o)&&(a=o.apply({},[null!=(i=AutoForm.getFormValues(t))?i.insertDoc:void 0]),!_.isEmpty(a)&&_.isObject(a)))||(_.each(a,(function(e,r){return AutoForm.addStickyValidationError(t,r,"formValidate",e),toastr.error(e)})),!1)},r=function(e,t,r){var o,a,n;return o={userId:Meteor.userId(),spaceId:Session.get("spaceId"),object_name:e},_.has(r,"previousDoc")&&(o.previousDoc=r.previousDoc),t.endsWith("Delete")?(o.id=r._id,o.doc=Creator.odata.get(e,r._id),t.startsWith("error")&&(o.error=r.error)):t.startsWith("after")?(o.id=null!=(a=r.dbDoc)?a._id:void 0,o.doc=r.dbDoc):t.startsWith("before")?(t.endsWith("Insert")||(o.id=r._id),t.endsWith("Update")?o.doc=null!=(n=r.doc)?n.$set:void 0:o.doc=r.doc):t.startsWith("error")&&(o.id=r._id,o.doc=r.doc,o.error=r.error),o},FormManager.getPreviousDoc=function(e,t,r){var o,a,n,i,s;if(("update"===r||"delete"===r)&&(o="after",a="after"+r.charAt(0).toLocaleUpperCase()+_.rest(r.split("")).join(""),i=null!=(n=Creator.getObject(e))&&null!=(s=n.form)?s[a]:void 0,_.isFunction(i)))return Creator.odata.get(e,t)},FormManager.runHook=function(e,t,o,a){var n,i,s,c,l,u,d,p;if(l=""+o+t.charAt(0).toLocaleUpperCase()+_.rest(t.split("")).join(""),"view"===t||"edit"===t)return FormManager.runViewEditHook(e,l,a.schema,a.record,a.doc);if(s=a.formId,d=null!=(u=Creator.getObject(e))&&null!=(p=u.form)?p[l]:void 0,_.isFunction(d))try{if(n=r(e,l,a),c=d.apply(n),_.isBoolean(c)&&!1===c)return!1;if(s&&"before"===o&&!_.isEmpty(c)&&_.isObject(c))return _.each(c,(function(e,t){return AutoForm.addStickyValidationError(s,t,"formValidate",e),toastr.error(e)})),!1}catch(f){return i=f,console.error(i),toastr.error(i.message),!1}return!0},FormManager.runViewEditHook=function(e,t,r,o,a){var n,i,s,c,l,u,d;if(l=null!=(u=Creator.getObject(e))&&null!=(d=u.form)?d[t]:void 0,_.isFunction(l)&&(s=r.get(),c={id:(i=a||o.get())._id,userId:Meteor.userId(),spaceId:Session.get("spaceId"),object_name:e,doc:i,schema:s},!1!==(n=l.apply(c))))return r.set(s),o.set(i)}},"grid_export.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},r,o;this.ObjectGrid={},this.GridExport={},r={equals:"=",notEqual:"!=",contains:"contains",notContains:"notcontains",startsWith:"startswith",endsWith:"=",lessThan:"<",lessThanOrEqual:"<=",greaterThan:">",greaterThanOrEqual:">=",empty:"empty"},o=function(e){var t;return t=[],_.forEach(e,(function(e,o){var a;return"between"===e.type?"number"===e.filterType?t.push([o,"between",[e.numberFrom,e.numberTo]]):e.filter?t.push([o,e.type,e.filter]):t.push([o,"between",[e.dateFrom,e.dateTo]]):_.isEmpty(e.filter)?e.operator?(a=[],e.condition1&&a.push([o,r[e.condition1.type],e.condition1.filter]),a.push(e.operator.toLocaleLowerCase()),e.condition2&&a.push([o,r[e.condition2.type],e.condition2.filter]),t.push(a)):void 0:(a=[o,r[e.type],e.filter],t.push(a))})),t},ObjectGrid.getFilters=function(e,t,r,a,n){var i,s,c,l,u,d;return s=Steedos.Page.Listview.getDefaultName(e,t),l=window.gridRefs&&window.gridRefs[s]&&window.gridRefs[s].current?window.gridRefs[s].current:window.gridRef.current,u=[],i=Creator.getListViewFilters(e,t,r,a,n),d=o(l.api.getFilterModel()),c=_.compact([].concat(i).concat(d))},GridExport.excel=function(e,t,r,a,n,i,s){var c,l,u,d,p,f,m,g,h,v,b,w,S;return u=Steedos.Page.Listview.getDefaultName(e,t),f=window.gridRefs&&window.gridRefs[u]&&window.gridRefs[u].current?window.gridRefs[u].current:window.gridRef.current,v=[],_.each(f.props.columnDefs,(function(e){if(e&&e.field)return v.push(e.field)})),b=[],_.forEach(f.api.getSortModel(),(function(e){return b.push([e.colId,e.sort])})),l=Creator.getListViewFilters(e,t,r,a,n,s),S=o(f.api.getFilterModel()),p=_.compact([].concat(l).concat(S)),c=SteedosFilters.formatFiltersToODataQuery(p),d=r?i+"-"+Creator.getObject(a).label:Creator.getObject(e).label+"-"+(null!=(h=Creator.getListView(e,t))?h.label:void 0),g=[],_.map(b,(function(e){var t;return t="desc"===e[1]?e[0]+" desc":e[0],g.push(t)})),m=g.join(","),d=encodeURIComponent(d),w=r?"/api/record/export/"+a+"?$select="+v.toString()+"&filename="+d:"/api/record/export/"+e+"?$select="+v.toString()+"&filename="+d,b.length>0&&(w=w+"&$orderby="+m),c&&(w=w+"&$filter="+c),Meteor.isCordova?Steedos.cordovaDownload(encodeURI(Steedos.absoluteUrl(w)),d+".xlsx"):window.open(w)}}},client:{"listview.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},r,o,a,n,i;n=function(e,t,r){var o,a,n;return o=null!=t?t.columns:void 0,r&&((null!=t?t.mobile_columns:void 0)?o=t.mobile_columns:(null!=(n=Creator.getObjectFirstListView(e))?n.mobile_columns:void 0)?o=n.mobile_columns:o&&(o=Creator.pickObjectMobileColumns(e,o))),o||(a=Creator.getObjectFirstListViewColumns(e,r))&&(o=a),o},o=function(e,t,r){var o,a,i,s,c,l;return s=(c=Creator.getObject(e)).NAME_FIELD_KEY,"organizations"===c.name&&(s="name"),o=[s],(i=Creator.getCollection("object_listviews").findOne(t))?o=n(e,i,r):c.list_views&&(l=c.list_views[t],o=n(e,l,r)),o=o.map((function(e){var t,r;return t=_.isObject(e)?e.field:e,(null!=(r=c.fields[t])?r.type:void 0)?t:void 0})),Creator.isCommonSpace(Session.get("spaceId"))&&o.indexOf("space")<0&&o.push("space"),"cms_files"===e&&o.push("parent"),o=_.compact(o),a=Creator.getObjectFieldsName(e),_.intersection(o,a)},i=function(e,t,r,o){var a;return r?(a=Creator.getObject(e).fields,o&&(t=t.filter((function(e){var t,o;return"master_detail"!==(null!=(o=a[e])?o.type:void 0)||(!!a[e].multiple||(a[e].reference_to?(t=a[e].reference_to,_.isFunction(t)&&(t=t())):t=a[e].optionsFunction({}).getProperty("value"),!!_.isArray(t)||t!==r))}))),t):t},r=function(e,t){var r,o;return o=Creator.getObject(e).fields,r=[],_.each(t,(function(e){var t;if(null!=(t=o[e])?t.depend_on:void 0)return r=_.union(o[e].depend_on)})),r},a=function(e,t,r){var o,a;return a=_.intersection(["owner","company_id","company_ids","locked"],_.keys(e.fields)),!r&&e.enable_tree&&(a.push("parent"),a.push("children")),(o=Creator.getObjectDefaultExtraColumns(e.name))&&(a=_.union(a,o)),a},Creator.unionSelectColumnsWithExtraAndDepandOn=function(e,t,o,n){var i,s;return i=t.name,s=a(t,o,n),e=_.union(e,s),e=_.union(e,r(i,e))},Creator.getListViewFilters=function(e,t,r,o,a,n){var i,s,c,l,u,d,p,f,m,g;if(!e)return null;if(c=Creator.getObject(e),r)l=Creator.getODataRelatedFilter(e,o,a,t,n);else{if(d=Session.get("filter_logic"),p=Session.get("filter_scope"),u=Session.get("filter_items"),s=c.fields,u&&u.length>0&&window.lodash.isArray(u[0]))return l=u,(g=Creator.getStandardQuery(e,Session.get("standard_query")))&&g.length&&(l=l?[l,"and",g]:g),(m=Session.get("grid_sidebar_filters"))&&m.length&&(l=l?[l,"and",m]:m),l||(l=null),l;i=[],_.forEach(u,(function(t){var r,o,a,n,c,l,u,d,p,f,m;if(void 0!==t.value)if(r=s[null!=t?t.field:void 0],o=Creator.getFieldDataType(s,null!=t?t.field:void 0),["text","textarea","html","code"].includes(o)){if(_.isString(t.value)&&(m=t.value.trim().split(" "),l=[],m.forEach((function(e){return e=encodeURIComponent(Creator.convertSpecialCharacter(e)),l.push([t.field,t.operation,e])})),l.length>0))return c=!1,["<>","notcontains"].includes(t.operation)&&(c=!1),i.push(Creator.formatFiltersToDev(l,e,{is_logic_or:c}))}else{if(!["lookup","master_detail"].includes(o))return i.push(t);if(a=null!=r?r.reference_to:void 0,_.isFunction(a)&&(a=a()),!_.isArray(a))return i.push(t);if((null!=(u=t.value)?u.ids:void 0)&&i.push({field:t.field+".ids",operation:t.operation,value:null!=(d=t.value)?d.ids:void 0}),null!=(p=t.value)?p.o:void 0)return n=Creator.getObject(null!=(f=t.value)?f.o:void 0),i.push({field:t.field+".o",operation:t.operation,value:n._collection_name})}})),i.length>0&&(f={filter_logic:d,filter_scope:p,filters:i}),l=Creator.getODataFilter(t,e,f),(g=Creator.getStandardQuery(e,Session.get("standard_query")))&&g.length&&(l=l?[l,"and",g]:g),r||(m=Session.get("grid_sidebar_filters"))&&m.length&&(l=l?[l,"and",m]:m)}return l||(l=null),l},Creator.getODataEndpointUrl=function(e,t,r,o){var a,n;return r?(a=Creator.formatObjectName(o),n=Creator.getListViewIsRecent(e,t)?"/api/v4/"+a+"/recent":"/api/v4/"+a):(a=Creator.formatObjectName(e),n=Creator.getListViewIsRecent(e,t)?"/api/v4/"+a+"/recent":"/api/v4/"+a),Steedos.absoluteUrl(n)},Creator.getListviewColumns=function(e,t,r,a,n,s){var c,l;return c=e.name,l=Tracker.nonreactive((function(){return o(c,a,s)})),n&&n.customRelatedListObject&&(n.columns&&(l=n.columns),s&&n.mobile_columns&&(l=n.mobile_columns),l&&(l=l.map((function(e){return _.isObject(e)?e.field:_.isString(e)?e:void 0})),l=_.uniq(_.compact(l)))),l=i(c,l,t,r)}},views:{"_helpers.coffee":function e(){var r=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Creator.helpers={object_name:function(){return Session.get("object_name")},object:function(){return Creator.getObject(Session.get("object_name"))},object_listviews:function(){return Creator.getObject("object_listviews")},objectLabel:function(e){return Creator.getObject(e).label},getOperationLabel:function(e){switch(e){case"=":return t("creator_filter_operation_equal");case"<>":return t("creator_filter_operation_unequal");case"<":return t("creator_filter_operation_less_than");case">":return t("creator_filter_operation_greater_than");case"<=":return t("creator_filter_operation_less_or_equal");case">=":return t("creator_filter_operation_greater_or_equal");case"contains":return t("creator_filter_operation_contains");case"notcontains":return t("creator_filter_operation_does_not_contain");case"startswith":return t("creator_filter_operation_starts_with");case"between":return t("creator_filter_operation_between")}},isMobile:function(){return Steedos.isMobile()}}},"template.page_template.js":function e(){Template.__checkName("page_template"),Template.page_template=new Template("Template.page_template",(function(){var e=this;return HTML.Raw('
')}))},"page_template.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Template.page_template.onRendered((function(){var e,t;return t=this,e=Session.get("app_id"),this.containerList=[],this.autorun((function(){var r;if(r=Steedos.Page.App.render(t,Session.get("pageApiName"),e))return t.containerList.push(r)}))})),Template.page_template.onDestroyed((function(){return _.each(this.containerList,(function(e){if(e)return ReactDOM.unmountComponentAtNode(e)}))}))},"template.page_object.js":function e(){Template.__checkName("page_object"),Template.page_object=new Template("Template.page_object",(function(){var e=this;return HTML.Raw('
')}))},"page_object.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Template.page_object.onRendered((function(){var e;return e=this,Steedos.Page.Object.Template.onRendered.apply(this)})),Template.page_object.onDestroyed((function(){var e;return e=this,Steedos.Page.Object.Template.onDestroyed.apply(this)}))},"template.page_record_view.js":function e(){Template.__checkName("page_record_view"),Template.page_record_view=new Template("Template.page_record_view",(function(){var e=this;return HTML.Raw('
')}))},"page_record_view.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Template.page_record_view.onRendered((function(){var e,t,r;return r=this,e=Session.get("object_name"),t=Session.get("record_id"),this.containerList=[],this.pageName=null,this.autorun((function(){var o,a,n,i,s,c,l,u,d,p;if(d=!0,(l=r.data.regions()).objectName!==(null!=(i=this.lastRegions)?i.objectName:void 0)&&(d=!1),this.lastRegions=l,d&&r.pageName)try{if(SteedosUI.refs[r.pageName])return(p={objectName:e}).recordId=Tracker.nonreactive((function(){return Session.get("record_id")})),n=(null!=(s=SteedosUI.refs[r.pageName])&&null!=(c=s.__$schema)?c.data:void 0)||{},SteedosUI.refs[r.pageName].updateProps({data:window._.defaultsDeep(p,n)})}catch(f){a=f,console.error(r.pageName+": "+a)}if(!d&&r.pageName&&SteedosUI.refs[r.pageName])try{SteedosUI.refs[r.pageName].unmount()}catch(f){a=f,console.error(r.pageName+": "+a)}if(r.data.regions&&(l=Tracker.nonreactive(r.data.regions),this.lastRegions=l,l&&l.page&&l.page.schema&&(u=l.page.schema,_.isString(u)&&(u=JSON.parse(u)),r.pageName=u.name)),e=Tracker.nonreactive((function(){return Session.get("object_name")})),t=Tracker.nonreactive((function(){return Session.get("record_id")})),o=Steedos.Page.Record.render(r,e,t))return r.containerList.push(o)}))})),Template.page_record_view.onDestroyed((function(){var e;try{SteedosUI.refs[this.pageName].unmount()}catch(t){e=t,console.error(this.pageName+": "+e)}return _.each(this.containerList,(function(e){if(e)return ReactDOM.unmountComponentAtNode(e)}))}))},"template.page_list_view.js":function e(){Template.__checkName("page_list_view"),Template.page_list_view=new Template("Template.page_list_view",(function(){var e=this;return HTML.Raw('
')}))},"page_list_view.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Template.page_list_view.onRendered((function(){var e,t;return t=this,e=Session.get("object_name"),this.containerList=[],this.pageName=null,this.autorun((function(){var r,o,a,n;if(t.pageName)try{SteedosUI.refs[t.pageName].unmount()}catch(i){o=i,console.error(t.pageName+": "+o)}if(t.data.regions&&(a=t.data.regions())&&a.page&&a.page.schema&&(n=a.page.schema,_.isString(n)&&(n=JSON.parse(n)),t.pageName=n.name),r=Steedos.Page.Listview.render(t,e))return t.containerList.push(r)}))})),Template.page_list_view.onDestroyed((function(){var e;try{SteedosUI.refs[this.pageName].unmount()}catch(t){e=t,console.error(this.pageName+": "+e)}return _.each(this.containerList,(function(e){if(e)return ReactDOM.unmountComponentAtNode(e)}))}))},"template.page_related_list_view.js":function e(){Template.__checkName("page_related_list_view"),Template.page_related_list_view=new Template("Template.page_related_list_view",(function(){var e=this;return HTML.Raw('')}))},"page_related_list_view.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Template.page_related_list_view.onRendered((function(){var e,t,r;return r=this,e=Session.get("object_name"),t=Session.get("record_id"),this.containerList=[],this.pageName=null,this.autorun((function(){var o,a,n,i;if(r.pageName)try{SteedosUI.refs[r.pageName].unmount()}catch(s){a=s,console.error(r.pageName+": "+a)}if(r.data.regions&&(n=r.data.regions())&&n.page&&n.page.schema&&(i=n.page.schema,_.isString(i)&&(i=JSON.parse(i)),r.pageName=i.name),o=Steedos.Page.RelatedListview.render(r,e,t))return r.containerList.push(o)}))})),Template.page_related_list_view.onDestroyed((function(){var e;try{SteedosUI.refs[this.pageName].unmount()}catch(t){e=t,console.error(this.pageName+": "+e)}return _.each(this.containerList,(function(e){if(e)return ReactDOM.unmountComponentAtNode(e)}))}))},"template.app_home.js":function e(){Template.__checkName("creator_app_home"),Template.creator_app_home=new Template("Template.creator_app_home",(function(){var e=this;return""}))},"app_home.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},r;r=function(e){var t,r,o,a,n;return(null!=(t=Creator.getApp(e))?t.isExternalUrl:void 0)?/^http(s?):\/\//.test(t.path)?t.blank?window.open(t.path):window.location.href=t.path:FlowRouter.go(t.path):(a=Creator.getAppMenus(e),(r=_.first(a))?"url"===(o=Object.assign({},r,{target:!1})).type&&o.is_use_iframe?FlowRouter.go(o.path):(n=Creator.getAppMenuUrl(o),FlowRouter.go(n)):FlowRouter.go("/app/"+e))},Template.creator_app_home.onRendered((function(){return this.autorun((function(){var e,t,o;if(o=Creator.bootstrapLoaded.get(),_.has(FlowRouter.current().params,"app_id")){if(e=Session.get("app_id"),o&&e)return r(e)}else if(t=Steedos.getFirstApp(),o&&t)return r(t.code||t.id)}))}))},"template.app_iframe.js":function e(){Template.__checkName("creator_app_iframe"),Template.creator_app_iframe=new Template("Template.creator_app_iframe",(function(){var e=this;return Blaze.If((function(){return Spacebars.call(e.lookup("subsReady"))}),(function(){return["\n\t\t",HTML.IFRAME({id:"app_iframe",src:function(){return Spacebars.mustache(e.lookup("url"))},style:"width: 100%; height: 100%;"}),"\n\t"]}))}))},"app_iframe.coffee":function module(){__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};var share=__coffeescriptShare;Template.creator_app_iframe.helpers({subsReady:function(){return Steedos.subsBootstrap.ready()},url:function(){var e,t;return t=Session.get("app_id"),(e=Creator.getApp(t))&&!e.on_click&&e.url?Creator.getUrlWithToken(e.url,e):""}}),Template.creator_app_iframe.events,Template.creator_app_iframe.onCreated((function(){})),Template.creator_app_iframe.onRendered((function(){var app,app_id,e,evalFunString,iframe;if(Steedos.forbidNodeContextmenu(window,"#app_iframe"),app_id=Session.get("app_id"),app=Creator.getApp(app_id),iframe=$("#app_iframe"),app&&app.on_click){evalFunString="(function(){"+app.on_click+"})()";try{return eval(evalFunString)}catch(error){return e=error,console.error("catch some error when eval the on_click script for app link:"),console.error(e.message+"\r\n"+e.stack)}}})),Template.creator_app_iframe.onDestroyed((function(){}))},"template.page_iframe.js":function e(){Template.__checkName("page_iframe"),Template.page_iframe=new Template("Template.page_iframe",(function(){var e=this;return HTML.IFRAME({name:"pageIframe",src:function(){return Spacebars.mustache(e.lookup("url"))},style:function(){return Spacebars.mustache(e.lookup("style"))},class:function(){return Spacebars.mustache(e.lookup("className"))}})}))},"page_iframe.js":function e(){var t=function(e){const{data:t}=e;"nav.click"===t.type&&FlowRouter.current().params.tab_id==t.data.id&&$("[name='pageIframe']").attr("src",$("[name='pageIframe']").attr("src"))};Template.page_iframe.helpers({url:()=>{if(Template.instance().data.regions){var e,t=Template.instance().data.regions().queryParams.url;return t.startsWith("https:/")&&!t.startsWith("https://")&&(t=t.replace("https:/","https://")),t.startsWith("http:/")&&!t.startsWith("http://")&&(t=t.replace("http:/","http://")),!Meteor.isCordova||t.startsWith("http:")||t.startsWith("!https:")||(t=Meteor.absoluteUrl(t)),t}},className:()=>{if(Template.instance().data.regions)return(regions=Template.instance().data.regions()).queryParams.className||""},style:()=>Template.instance().data.regions&&(regions=Template.instance().data.regions()).queryParams.style||"width: 100%; height: 100%;"}),Template.page_iframe.onCreated((function(){window.addEventListener("message",t)})),Template.page_iframe.onDestroyed((function(){window.removeEventListener("message",t)})),Template.page_iframe.onRendered((function(){window.Steedos.setDocumentTitle({pageName:null,tabName:null})}))},"template.initiate_approval.js":function e(){Template.__checkName("initiate_approval"),Template.initiate_approval=new Template("Template.initiate_approval",(function(){var e=this;return HTML.DIV({class:"modal fade creator-modal",id:"initiate_approval"},"\n\t\t",HTML.DIV({class:"modal-dialog slds-modal slds-fade-in-open"},"\n\t\t\t",HTML.DIV({class:"slds-modal__container"},"\n\t\t\t\t",HTML.HEADER({class:"slds-modal__header"},"\n\t\t\t\t\t",HTML.DIV({"data-dismiss":"modal"},"\n\t\t\t\t\t\t",Blaze._TemplateWith((function(){return{className:Spacebars.call("slds-modal__close slds-button__icon"),iconSize:Spacebars.call("large"),inverse:Spacebars.call(!0),iconCategory:Spacebars.call("utility"),iconName:Spacebars.call("close"),title:Spacebars.call(Spacebars.dataMustache(e.lookup("_"),"close")),variant:Spacebars.call("icon")}}),(function(){return Spacebars.include(e.lookupTemplate("steedos_button"))})),"\n\t\t\t\t\t"),"\n\t\t\t\t\t",HTML.Raw('

\n\t\t\t\t\t\t选择流程发起审批\n\t\t\t\t\t

'),"\n\t\t\t\t"),"\n\n\t\t\t\t",HTML.DIV({class:"slds-modal__content slds-p-around_medium",style:"font-size: 17px;"},"\n\t\t\t\t\t",Blaze.Each((function(){return Spacebars.call(e.lookup("flows"))}),(function(){return["\n\t\t\t\t\t",HTML.DIV({class:"weui_cells_weui_cells_access"},"\n\t\t\t\t\t\t",HTML.A({class:"weui_cell","data-flow":function(){return Spacebars.mustache(e.lookup("flow_id"))}},"\n\t\t\t\t\t\t\t",HTML.I({class:"ion ion-ios-compose-outline"}),HTML.CharRef({html:" ",str:" "}),HTML.CharRef({html:" ",str:" "}),Blaze.View("lookup:flow_name",(function(){return Spacebars.mustache(e.lookup("flow_name"))})),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t"),"\n\t\t\t\t\t"]})),"\n\n\t\t\t\t"),"\n\n\t\t\t"),"\n\t\t"),"\n\t")}))},"initiate_approval.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Template.initiate_approval.helpers({flows:function(){return _.where(Creator.object_workflows,{object_name:this.object_name,can_add:!0})}}),Template.initiate_approval.events({"click .weui_cell":function(e,t){var r,o,a,n,i,s,c;o=e.currentTarget.dataset.flow,a=t.data.object_name,n=t.data.record_id,i=[{o:a,ids:[n]}],(s={}).methodOverride="POST",s["X-User-Id"]=Meteor.userId(),s["X-Auth-Token"]=Accounts._storedLoginToken(),c=Steedos.absoluteUrl()+"api/object/workflow/drafts?"+$.param(s),r={Instances:[{flow:o,applicant:Meteor.userId(),space:Session.get("spaceId"),record_ids:i}]},r=JSON.stringify(r),$(document.body).addClass("loading"),$.ajax({url:c,type:"POST",async:!0,data:r,dataType:"json",processData:!1,contentType:"application/json",success:function(e,r){var o;$(document.body).removeClass("loading"),e.errors?e.errors.forEach((function(e){toastr.error(e.errorMessage)})):(o=e.inserts[0],Steedos.openWindow(Steedos.absoluteUrl("/app/"+FlowRouter.current().params.app_id+"/instances/view/"+o._id+"?display="+FlowRouter.current().queryParams.display+"&side_object=instances&side_listview_id=draft")),Modal.hide(t),SteedosUI.reloadRecord(a,n),FlowRouter.reload())},error:function(e,t,r){$(document.body).removeClass("loading"),toastr.error(t)}})}})},"template.amis_action.js":function e(){Template.__checkName("amis_action"),Template.amis_action=new Template("Template.amis_action",(function(){var e=this;return HTML.LI({class:function(){return["steedos-amis-button steedos-button-",Spacebars.mustache(e.lookup("objectName")),"-",Spacebars.mustache(e.lookup("name"))," ",Spacebars.mustache(e.lookup("buttonClassName"))]}})}))},"amis_action.js":function e(){const t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location;(e=e||"")&&"#"===e[0]?e=t.pathname+t.search+e:e&&"?"===e[0]&&(e=t.pathname+e);const r=e.indexOf("?"),o=e.indexOf("#");let a=~r?e.substring(0,r):~o?e.substring(0,o):e,n=~r?e.substring(r,~o?o:void 0):"",i=~o?e.substring(o):t.hash;if(a){if("/"!=a[0]&&!/^https?\:\/\//.test(a)){let e;const r=t.pathname.split("/");let o;for(r.pop();o=/^\.\.?\//.exec(a);)"../"===o[0]&&r.pop(),a=a.substring(o[0].length);a=r.concat(a).join("/")}}else a=t.pathname;return a+n+i},r=()=>({theme:"antd",getModalContainer:e=>{let t=document.querySelector("#amisModalContainer");return t||((t=document.createElement("div")).className="amis-scope",t.style.height="0px",t.id="amisModalContainer",document.body.appendChild(t)),t},notify:(e,t)=>{var r,o;(null===(r=t.props)||void 0===r?void 0:r.schema.tpl)?SteedosUI.message[e](null===(o=t.props)||void 0===o?void 0:o.schema.tpl):"string"==typeof t?SteedosUI.message[e](t):console.warn("notify",e,t)},confirm:e=>new Promise((t,r)=>SteedosUI.Modal.confirm({title:e,onOk:()=>{t(!0)},okText:"确认",cancelText:"取消"})),jumpTo:(e,r)=>{if("goBack"===e)return window.history.back();e=t(e),r&&"url"===r.actionType?!1===r.blank?FlowRouter.go(e):window.open(e):r&&e&&r.target?window.open(e,r.target):/^https?:\/\//.test(e)?window.location.replace(e):FlowRouter.go(e)},requestAdaptor:e=>(e.url&&!/^http[s]?:\/\//i.test(e.url)?(Meteor.isCordova&&(e.url=Meteor.absoluteUrl(e.url)),e.headers||(e.headers={}),!e.headers.Authorization&&Builder.settings.context&&Builder.settings.context.tenantId&&Builder.settings.context.authToken&&(e.headers.Authorization="Bearer ".concat(Builder.settings.context.tenantId,",").concat(Builder.settings.context.authToken))):e.url&&Meteor.isCordova&&Builder.settings.context&&Builder.settings.context.rootUrl&&e.url.startsWith(Builder.settings.context.rootUrl)&&Meteor.isCordova&&(e.headers||(e.headers={}),!e.headers.Authorization&&Builder.settings.context&&Builder.settings.context.tenantId&&Builder.settings.context.authToken&&(e.headers.Authorization="Bearer ".concat(Builder.settings.context.tenantId,",").concat(Builder.settings.context.authToken))),console.log("env.requestAdaptor=action==",e),e)});Template.amis_action.helpers({objectName:()=>{var e=Template.instance().data;return e.button.object||e.button.object_name},name:()=>{var e;return Template.instance().data.button.name},buttonClassName:()=>{var e;return Template.instance().data.buttonClassName}}),Template.amis_action.onRendered(()=>{var e=Template.instance().data,t=e.button,o=e.buttonClassName,a=e.inMore,n=e.data,i=e.env,s=".steedos-button-"+(t.object||e.button.object_name)+"-"+t.name;const c=()=>{var e=Creator.USER_CONTEXT?Creator.USER_CONTEXT.user.language:null;return e?e="cn"===(e="zh"===(e="en"===(e=e.replace("_","-"))?"en-US":e)?"zh-CN":e)?"zh-CN":e:"zh-CN"};Promise.all([waitForThing(window,"amis")]).then(()=>{var e=amisRequire("amis/embed"),o=t.amis_schema?_.isString(t.amis_schema)?JSON.parse(t.amis_schema):t.amis_schema:{type:"service",bodyClassName:"p-0",body:[{type:"button",label:t.label}],regions:["body"]};const a=__meteor_runtime_config__.ROOT_URL,l=lodash.defaultsDeep({},{data:n},{data:{app_id:n.appId,object_name:n.objectName,record_id:n.recordId,formFactor:Steedos.isMobile()?"SMALL":"LARGE",context:{rootUrl:Meteor.isCordova?a.endsWith("/")?a.substr(0,a.length-1):a:"",tenantId:Creator.USER_CONTEXT.spaceId,userId:Creator.USER_CONTEXT.userId,authToken:Creator.USER_CONTEXT.user.authToken,user:Creator.USER_CONTEXT.user},global:{userId:Creator.USER_CONTEXT.userId,spaceId:Creator.USER_CONTEXT.spaceId,user:Creator.USER_CONTEXT.user,now:new Date},scopeId:o.name||o.id,$scopeId:o.name||o.id}});return o=lodash.defaultsDeep(l,o),e.embed(s,o,{locale:c()},Object.assign(r(),i))})})}},layout:{"template.layout.js":function e(){Template.__checkName("creatorLayout"),Template.creatorLayout=new Template("Template.creatorLayout",(function(){var e=this;return Blaze.If((function(){return Spacebars.call(e.lookup("isloading"))}),(function(){return"\n\t"}),(function(){return["\n\t\t",HTML.DIV({class:"steedos skin-blue-light creator h-full flex flex-col relative overflow-hidden"},"\n\t\t\t\n\n\t\t\t",HTML.HEADER({id:"header",class:"steedos-global-header-root flex-none"}),"\n\n\t\t\t\t\n\t\t\t",HTML.DIV({id:"main",class:function(){return["creator-content-wrapper ",Blaze.If((function(){return Spacebars.call(e.lookup("split"))}),(function(){return"split"}))]}},"\n\n\n\n\t\t\t\t",HTML.Comment(' {{#if split}}\n\t\t\t\t\t
\n\t\t\t\t\t\t{{> Template.dynamic template="creatorSidebar"}}\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t{{> Template.dynamic template=main}}\n\t\t\t\t\t
\n\t\t\t\t{{else}} '),"\n\t\t\t\t\t",Blaze._TemplateWith((function(){return{template:Spacebars.call(e.lookup("main"))}}),(function(){return Spacebars.include((function(){return Spacebars.call(Template.__dynamic)}))})),"\n\t\t\t\t",HTML.Comment(" {{/if}} "),"\n\t\t\t"),"\n\t\t\t",HTML.FOOTER({id:"footer",class:"steedos-global-footer-root flex-none"}),"\n\t\t"),"\n",HTML.Comment(' \n\t\t
\n\t\t\t{{> status}}\n\t\t
'),"\n\t\t"]}))}))},"layout.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},r,o;Template.creatorLayout.helpers(Creator.helpers),Template.creatorLayout.helpers({isloading:function(){return Creator.isloading()},collection:function(){return Session.get("action_collection")},fields:function(){return Session.get("action_fields")},collectionName:function(){return Session.get("action_collection_name")},doc:function(){return Session.get("action_record_id")},saveAndInsert:function(){var e,t,r,o;return!!(e=Session.get("action_save_and_insert"))&&(r=(t=Session.get("action_collection")).replace(/Creator.Collections./,""),null!=(o=Creator.getPermissions(r))?o.allowCreate:void 0)},split:function(){var e,t,r;return!(!(e=Creator.getApp())||"admin"!==e._id)&&(r=/\/app\/\w+\/search\//,t=Session.get("router-path"),!r.test(t))},object_name:function(){return Session.get("object_name")},recordId:function(){return Session.get("recordId")},title:function(){return"编辑"},triggerLabel:function(){return"编辑"},onAddFinish:function(){return function(e){var t,r,o,a,n;return a=e[0],n="/app/"+(t=Session.get("app_id"))+"/"+(r=Session.get("object_name"))+"/view/"+(o=a._id),FlowRouter.go(n),!0}},onEditFinish:function(){return function(){return setTimeout((function(){return FlowRouter.reload()}),1),!0}}}),Template.creatorLayout.onRendered((function(){var e;return e=Session.get("pageApiName")||Session.get("object_name")||Session.get("tab_name"),this.autorun((function(){return Steedos.Page.Header.render(Session.get("app_id"),e)})),this.autorun((function(){return Steedos.Page.Footer.render(Session.get("app_id"),e)})),this.autorun((function(){var e,t;if(t=Session.get("pageApiName")||Session.get("object_name")||Session.get("tab_name"),window.SteedosUI&&(e=SteedosUI.refs.globalHeader))return Meteor.setTimeout((function(){var t;try{return e.updateProps({location:FlowRouter.current()},(function(){return console.log("amisScope.updateProps callback.......")}))}catch(r){t=r}}),100)})),this.autorun((function(){var e,t;if(t=Session.get("pageApiName")||Session.get("object_name")||Session.get("tab_name"),window.SteedosUI&&(e=SteedosUI.refs.globalFooter))return Meteor.setTimeout((function(){var t;try{return e.updateProps({location:FlowRouter.current()},(function(){return console.log("amisScope.updateProps callback.......")}))}catch(r){t=r}}),100)}))})),r=function(){var e;return"calendar"===(null!=(e=Creator.getListView(Session.get("object_name",Session.get("list_view_id"))))?e.type:void 0)},AutoForm.hooks({creatorAddForm:{onSuccess:function(e,t){var o,a,n,i;if($("#afModal").modal("hide"),"/app/:app_id/:object_name/calendar/"!==FlowRouter._current.route.path&&!r())return"post"===t.type?(i="/app/"+(o=Session.get("app_id"))+"/"+(a=t.object_name)+"/view/"+(n=t._id),FlowRouter.go(i)):void 0}}},!1),AutoForm.hooks({creatorEditForm:{onSuccess:function(e,t){var o,a,n,i,s,c;if($("#afModal").modal("hide"),!r())return"post"===t.type&&(c="/app/"+(o=Session.get("app_id"))+"/"+(a=t.object_name)+"/view/"+(s=t._id),FlowRouter.go(c)),this.docId&&t.object_name?(i=Creator.getObjectUrl(t.object_name,this.docId),n=Creator.getObjectRecordName(this.updateDoc.$set,t.object_name),Creator.updateTempNavLabel(t.object_name,i,n)):void 0}}},!1),AutoForm.hooks({creatorCellEditForm:{onSuccess:function(e,t){var r,o;if($("#afModal").modal("hide"),this.docId&&t.object_name)return o=Creator.getObjectUrl(t.object_name,this.docId),r=Creator.getObjectRecordName(this.updateDoc.$set,t.object_name),Creator.updateTempNavLabel(t.object_name,o,r)}}},!1),o=function(e,t){return FlowRouter.current().route.path.endsWith("/:record_id")?FlowRouter.reload():window.refreshGrid()},AutoForm.hooks({creatorAddRelatedForm:{onSuccess:o}},!1)},"template.loading.js":function e(){Template.__checkName("creatorLoading"),Template.creatorLoading=new Template("Template.creatorLoading",(function(){var e=this;return HTML.Raw('
\n
\n Loading\n
\n
\n
\n
')}))},"template.empty_layout.js":function e(){Template.__checkName("empty_layout"),Template.empty_layout=new Template("Template.empty_layout",(function(){var e=this;return Blaze._TemplateWith((function(){return{template:Spacebars.call(e.lookup("main"))}}),(function(){return Spacebars.include((function(){return Spacebars.call(Template.__dynamic)}))}))}))}},mobile:{"template.admin.js":function e(){Template.__checkName("adminMenu"),Template.adminMenu=new Template("Template.adminMenu",(function(){var e=this;return HTML.DIV({class:"admin-menu mobile-template-container",id:"admin_menu"},"\n\n ",HTML.DIV({class:"admin-menu-content mobile-template-content"},"\n\t\t\t",HTML.DIV({class:"weui-panel weui-panel_access user-info"},"\n\t\t\t\t",HTML.A({class:"weui-media-box weui-media-box_appmsg"},"\n\t\t\t\t\t",HTML.DIV({class:"weui-media-box__hd",style:function(){return["background: url(",Spacebars.mustache(e.lookup("avatarURL")),")"]}},"\n\t\t\t\t\t\t",HTML.Raw('\x3c!-- --\x3e'),"\n\t\t\t\t\t"),"\n\t\t\t\t\t",HTML.DIV({class:"weui-media-box__bd"},"\n\t\t\t\t\t\t",HTML.H4({class:"weui-media-box__title"},Blaze.View("lookup:name",(function(){return Spacebars.mustache(e.lookup("name"))}))),"\n\t\t\t\t\t\t",HTML.P({class:"weui-media-box__desc"},"\n\t\t\t\t\t\t\t",Blaze.View("lookup:_",(function(){return Spacebars.mustache(e.lookup("_"),"Company")})),":",Blaze.View("lookup:spaceName",(function(){return Spacebars.mustache(e.lookup("spaceName"))})),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t"),"\n\t\t\t\t"),"\n\t\t\t"),"\n\n\t\t\t",HTML.DIV({class:"weui-panel"},"\n\t\t\t\t",HTML.DIV({class:"weui-panel__bd"},"\n\t\t\t\t\t",HTML.DIV({class:"weui-media-box weui-media-box_small-appmsg"},"\n\t\t\t\t\t\t",HTML.DIV({class:"weui-cells"},"\n\t\t\t\t\t\t\t",HTML.A({class:"weui-cell weui-cell_access btn-switch-space"},"\n\t\t\t\t\t\t\t\t",HTML.DIV({class:"weui-cell__bd weui-cell_primary"},"\n\t\t\t\t\t\t\t\t\t",HTML.P(Blaze.View("lookup:_",(function(){return Spacebars.mustache(e.lookup("_"),"Switch Company")}))),"\n\t\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t\t\t",HTML.SPAN({class:"space-name"},Blaze.View("lookup:spaceName",(function(){return Spacebars.mustache(e.lookup("spaceName"))}))),"\n\t\t\t\t\t\t\t\t",HTML.Raw(''),"\n\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t"),"\n\n\n\n\t\t\t\t\t",HTML.DIV({class:"weui-media-box weui-media-box_small-appmsg"},"\n\t\t\t\t\t\t",HTML.DIV({class:"weui-cells"},"\n\t\t\t\t\t\t\t",HTML.A({class:"weui-cell weui-cell_access btn-change-password"},"\n\t\t\t\t\t\t\t\t",HTML.DIV({class:"weui-cell__bd weui-cell_primary"},"\n\t\t\t\t\t\t\t\t\t",HTML.P(Blaze.View("lookup:_",(function(){return Spacebars.mustache(e.lookup("_"),"Change Password")}))),"\n\t\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t\t\t",HTML.Raw(''),"\n\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t"),"\n\t\t\t"),"\n\t\t\t"),"\n\n ",HTML.DIV({class:"weui-panel"},"\n\t\t\t\t",HTML.DIV({class:"weui-panel__bd"},"\n\t\t\t\t\t",HTML.DIV({class:"weui-media-box weui-media-box_small-appmsg"},"\n\t\t\t\t\t\t",HTML.DIV({class:"weui-cells"},"\n\t\t\t\t\t\t\t",HTML.A({class:"weui-cell weui-cell_access log-out steedos-logout"},"\n\t\t\t\t\t\t\t\t",HTML.DIV({class:"weui-cell__bd weui-cell_primary"},"\n\t\t\t\t\t\t\t\t\t",HTML.P(Blaze.View("lookup:_",(function(){return Spacebars.mustache(e.lookup("_"),"Logout")}))),"\n\t\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t"),"\n\t\t\t\t"),"\n\t\t\t"),"\n "),"\n ")}))},"admin.coffee":function e(){var r=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Template.adminMenu.helpers({avatarURL:function(e,t,r,o){var a,n;return n=Meteor.userId(),(e=null!=(a=Creator.getCollection("users").findOne({_id:n}))?a.avatar:void 0)?Steedos.absoluteUrl("avatar/"+Meteor.userId()+"?avatar="+e):Creator.getRelativeUrl("/images/default-avatar.png")},name:function(){var e;return null!=(e=Creator.getCollection("users").findOne())?e.name:void 0},logoutUrL:function(){return Creator.getRelativeUrl("/accounts/a/#/logout")},spaceName:function(){var e;return Session.get("spaceId")&&(e=db.spaces.findOne(Session.get("spaceId")))?e.name:t("none_space_selected_title")}}),Template.adminMenu.events({"click .steedos-logout":function(){return Steedos.logout()},"click .admin-menu-back":function(e,t){var r;return r=urlQuery[urlQuery.length-2],urlQuery.pop(),t.$("#admin_menu").animateCss("fadeOutRight",(function(){return Blaze.remove(t.view),r?FlowRouter.go(r):FlowRouter.go("/app")}))},"click .btn-switch-space":function(e,t){return FlowRouter.go("/user_settings/switchspace")},"click .btn-change-password":function(e,t){return Modal.show("reset_password_modal")},"click .btn-change-avatar":function(e,t){return t.$("#mobile-avator-upload").click()},"change #mobile-avator-upload":function(e,r){var o;if(o=e.target.files[0])return $("body").addClass("loading"),db.avatars.insert(o,(function(e,r){return e?(console.error(e),toastr.error(t(e.reason)),$(document.body).removeClass("loading")):setTimeout((function(){return Meteor.call("updateUserAvatar",r._id,(function(e,r){return(null!=r?r.error:void 0)?($(document.body).removeClass("loading"),toastr.error(t(r.message))):$(document.body).removeClass("loading")}))}),3e3)}))}})},"template.switch_space.js":function e(){Template.__checkName("switchSpace"),Template.switchSpace=new Template("Template.switchSpace",(function(){var e=this;return HTML.DIV({class:"switch-space mobile-template-container",id:"switch_space"},"\n\t\t\n\t\t",HTML.DIV({class:"switch-space-content mobile-template-content"},"\n\t\t\t",HTML.DIV({class:"weui-panel"},"\n\t\t\t\t",HTML.DIV({class:"weui-panel__bd"},"\n\t\t\t\t\t",HTML.DIV({class:"weui-media-box weui-media-box_small-appmsg"},"\n\t\t\t\t\t\t",HTML.DIV({class:"weui-cells"},"\n\t\t\t\t\t\t\t",Blaze.Each((function(){return Spacebars.call(e.lookup("spaces"))}),(function(){return["\n\t\t\t\t\t\t\t",HTML.A({class:"weui-cell weui-cell_access switchSpace"},"\n\t\t\t\t\t\t\t\t",HTML.DIV({class:"weui-cell__bd weui-cell_primary"},"\n\t\t\t\t\t\t\t\t\t",HTML.P(Blaze.View("lookup:name",(function(){return Spacebars.mustache(e.lookup("name"))}))),"\n\t\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t\t\t",Blaze.If((function(){return Spacebars.dataMustache(e.lookup("current_space"),e.lookup("_id"))}),(function(){return["\n\t\t\t\t\t\t\t\t\t",HTML.SPAN({class:"weui-icon-success-no-circle"}),"\n\t\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t"),"\n\t\t\t\t"),"\n\t\t\t"),"\n\t\t"),"\n\t")}))},"switch_space.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Template.switchSpace.helpers({spaces:function(){return db.spaces.find()},current_space:function(e){return e===Session.get("spaceId")}}),Template.switchSpace.events({"click .switchSpace":function(e,t){return Steedos.setSpaceId(this._id),FlowRouter.go("/app")},"click .switch-space-back":function(e,t){var r;return r=urlQuery[urlQuery.length-2],urlQuery.pop(),t.$("#switch_space").animateCss("fadeOutRight",(function(){return Blaze.remove(t.view),r?FlowRouter.go(r):FlowRouter.go("/app")}))}})}},"core.coffee":function e(){var r=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},o;Creator.Pages={},o=["owner","company_id","company_ids","locked"],Steedos.addPage=function(e,t){if(e)return Creator.Pages[e]=t},Creator.getLayout=function(e){return e||(e=Session.get("app_id")),"steedos"===e?"steedosLayout":"creatorLayout"},Creator.createObject=function(e,t){var r,o;return o=Creator.getObject(e),r="Creator.Collections."+e,Session.set("action_collection",r),Session.set("action_save_and_insert",!0),Session.set("action_collection_name",o.label),Session.set("action_object_name",e),Session.set("action_fields",void 0),Session.set("cmDoc",t),Meteor.defer((function(){return $(".creator-add").click()}))},Meteor.isClient&&(Creator.TabularSelectedIds={},Meteor.autorun((function(){var e,t;if(e=Session.get("list_view_id"),t=Session.get("object_name"))return Creator.TabularSelectedIds[t]=[]})),Creator.remainCheckboxState=function(e){var t,r,o,a,n,i,s;if((t=e.find(".select-all")).length&&(a=(o=null!=(n=t[0])?n.dataset:void 0).objectName,i=Creator.TabularSelectedIds[a]))return(r=e.find(".select-one")).each((function(e,t){var r;return r=i.indexOf(t.dataset.id)>-1,$(t).prop("checked",r)})),(s=i.length)>0&&r.length!==s?t.prop("indeterminate",!0):(t.prop("indeterminate",!1),0===s?t.prop("checked",!1):s===r.length?t.prop("checked",!0):void 0)},Creator.isListViewFilterEditable=function(e){return!e.shared||e.shared&&e.owner===Steedos.userId()},Creator.getODataFilter=function(e,t,r){var o,a,n,i,s,c,l,u,d,p,f,m,g;if(g=Meteor.userId(),m=Session.get("spaceId"),a=Creator.Collections.object_listviews.findOne(e))(l=Creator.isListViewFilterEditable(a))||((o={}).filter_scope=a.filter_scope,o.filters=a.filters);else if(o={},m&&g){if(!(u=Creator.getListView(t,e)))return["_id","=",-1];o.filter_scope=u.filter_scope,o.filters=u.filters}if(Creator.isCloudAdminSpace(m)&&_.include(["users","space_users","spaces"],t)&&delete o.filters,o&&(r?(o.filter_scope&&(r.filter_scope=o.filter_scope),_.isFunction(r.filters)||(null!=(d=r.filters)?d.length:void 0)?(_.isFunction(o.filters)||(null!=(p=o.filters)?p.length:void 0))&&(r.filters=[[r.filters,"and",o.filters]]):r.filters=o.filters):r=o),r||(r={}),n=r.filter_logic,i=r.filter_scope,s=r.filters,f=[],_.isFunction(s)&&(s=s()),a?n?(c=Creator.formatLogicFiltersToDev(s,n),f.length?f.push("and",c):f.push(c)):s&&s.length>0&&(f.length>0&&f.push("and"),(s=Creator.formatFiltersToDev(s,t))&&s.length>0&&(s=[s]),_.each(s,(function(e){return f.push(e)}))):m&&g&&("users"!==t||Creator.isCloudAdminSpace(m)||f.push(["_id","=",g]),s&&(s=Creator.formatFiltersToDev(s,t))&&s.length>0&&(s=[s],f.length>0&&f.push("and"),_.each(s,(function(e){if("spaces"!==t||e.length>0&&"_id"!==e[0])return f.push(e)})))),"mine"===i&&(f.length>0&&f.push("and"),f.push(["owner","=",g])),0!==f.length)return f},Creator.getODataRelatedFilter=function(e,t,r,o,a){var n,i,s,c,l,u,d,p,f,m,g,h,v,b,w,S,C;if(r&&(S=Steedos.spaceId(),C=Meteor.userId(),v=a?[a]:Creator.getRelatedList(e,r),h="",u="",w=[],n=function(e){return w.length>0&&w.push("and"),w.push(e)},_.each(v,(function(e){if(e.object_name===t)return e.filtersFunction?u=e.filtersFunction:h=e.related_field_name})),h||u)){if(h=h.replace(/\./g,"/"),o&&(i=Creator.getListView(t,o))){if(s=i.filter_logic,c=i.filter_scope,l=i.filters,u)return l=u(Creator.odata.get(e,r));s?(d=Creator.formatLogicFiltersToDev(l,s),n(d)):l&&l.length>0&&(l=_.map(l,(function(e){return _.isObject(e)&&!_.isArray(e)?Meteor.isClient&&_.isString(null!=e?e._value:void 0)?[e.field,e.operation,Creator.eval("("+e._value+")")()]:[e.field,e.operation,e.value]:e})),(l=Creator.formatFiltersToDev(l,t))&&l.length>0&&(l=[l]),_.each(l,(function(e){return n(e)})))}if("cfs.files.filerecord"===t&&n(["metadata/space","=",S]),m=Creator.getObject(t),p=t===e&&(null!=m?m.enable_tree:void 0),"cms_files"===t?(n(["parent/o","=",e]),n(["parent/ids","=",r])):"objects"===e?n([h,"=",r]):p||((b=null!=m?m.fields:void 0)&&(g=b[h]),g&&g.reference_to_field&&(f=Creator.odata.get(e,r,g.reference_to_field),"permission_fields"===t&&"object_fields"===e&&n(["object_name","=",f.object]),f&&f[g.reference_to_field]&&(r=f[g.reference_to_field])),!g||"master_detail"!==g.type&&"lookup"!==g.type?g&&"grid"===g.type?(n([h+".o","=",e]),n([h+".ids","=",r])):n([h,"=",r]):_.isFunction(g.reference_to)?_.isArray(g.reference_to())?n([h+".ids","=",r]):n([h,"=",r]):_.isArray(g.reference_to)?n([h+".ids","=",r]):n([h,"=",r])),"mine"===c&&n(["owner","=",C]),0!==w.length)return w}},Creator.getJsReportUrlQuery=function(){var e,t,r;return r="?space_id="+Steedos.getSpaceId(),(t=Tracker.nonreactive((function(){return Session.get("filter_items")})))&&(r+="&user_filters="+(e=encodeURI(JSON.stringify(t)))),r},Creator.getJsReportViewUrl=function(e){var t;return t=Creator.getRelativeUrl("/plugins/jsreport/web/viewer_db/"+e),t+=Creator.getJsReportUrlQuery()},Creator.getJsReportExcelUrl=function(e){var t;return t=Creator.getRelativeUrl("/plugins/jsreport/api/report_db/"+e+"/excel"),t+=Creator.getJsReportUrlQuery()},Creator.getJsReportPdfUrl=function(e){var t;return t=Creator.getRelativeUrl("/plugins/jsreport/api/report_db/"+e+"/pdf"),t+=Creator.getJsReportUrlQuery()},Creator.getStimulsoftReportViewUrl=function(e){var t;return t=Creator.getRelativeUrl("/plugins/stimulsoft/web/viewer_db/"+e),t+=Creator.getJsReportUrlQuery()},Creator.getStimulsoftReportDesignerUrl=function(e){var t;return t=Creator.getRelativeUrl("/plugins/stimulsoft/web/designer_db/"+e),t+=Creator.getJsReportUrlQuery()},Creator.objectOdataSelectFields=function(e){var t,r;return t=e.fields,r=(r=_.keys(t)).filter((function(e){return e.indexOf(".")<0})),e&&["default","meteor"].indexOf(e.database_name||"default")>-1&&(r=_.union(r.concat(o))),r.join(",")},Creator.objectOdataExpandFields=function(e,t){var r,o;return r=[],o=e.fields,t||(t=_.keys(o)),_.each(t,(function(e){var t,a,n;if(("master_detail"===(null!=(a=o[e])?a.type:void 0)||"lookup"===(null!=(n=o[e])?n.type:void 0))&&(o[e].reference_to?(t=o[e].reference_to,_.isFunction(t)&&(t=t())):_.isFunction(o[e].optionsFunction)&&(t=o[e].optionsFunction({}).getProperty("value")),_.isArray(t)||(t=[t]),t=_.map(t,(function(e){var t,r;return t=(null!=(r=Creator.getObject(e))?r.NAME_FIELD_KEY:void 0)||"name"})),t=_.compact(t),(t=(t=_.uniq(t)).join(","))&&e.indexOf("$")<0))return e.indexOf(".")<0?r.push(e):r.push(e.replace(".","/"))})),r.join(",")},Creator.relatedObjectFileUploadHandler=function(e,r){var o,a,n,i,s,c,l,u,d,p;for(u=null!=(o=e.currentTarget.dataset)?o.parent:void 0,s=e.currentTarget.files,c=0,d=Session.get("record_id"),l=Session.get("object_name"),p=Session.get("spaceId");c0&&(t=!0),!t})),t},Creator.pushCurrentPathToUrlQuery=function(){var e;if((e=FlowRouter.current().path)!==urlQuery[urlQuery.length-1])return urlQuery.push(e)},Creator.getStandardQuery=function(e,t){var r,o,a,n,i,s;if(o=Creator.getObject(e).fields,t&&t.query&&_.size(t.query)&&t.object_name===e)return a=t.object_name,i=t.query,s=[],t.is_mini?_.each(i,(function(e,t){var r,n,i,c;if(o[t])if(r=Creator.getFieldDataType(o,t),["currency","number"].includes(r)){if(!_.isString(e))return s.push([t,"=",e]);if(c=e.trim().split(" "),n=[],c.forEach((function(e){var r,o;try{if(o=Number(e),_.isNumber(o)&&!_.isNaN(o))return n.push([t,"=",o])}catch(a){return r=a,console.error(r)}})),n.length>0)return s.push(Creator.formatFiltersToDev(n,a,{is_logic_or:!1}))}else if(["text","textarea","html","select","autonumber","url","email"].includes(r))if(_.isString(e)){if(c=e.trim().split(" "),i=[],c.forEach((function(e){return e=encodeURIComponent(Creator.convertSpecialCharacter(e)),"select"===r&&o[t].multiple?i.push([t,"=",e]):i.push([t,"contains",e])})),i.length>0)return s.push(Creator.formatFiltersToDev(i,a,{is_logic_or:!1}))}else if(_.isArray(e))return s.push([t,"=",e])})):_.each(i,(function(e,t){var r,n,i,c,l,u;if(o[t]){if(n=Creator.getFieldDataType(o,t),["date","datetime","time","currency","number"].includes(n))return s.push([t,">=",e]);if(["text","textarea","html"].includes(n)){if(_.isString(e)){if(u=e.trim().split(" "),l=[],u.forEach((function(e){return e=encodeURIComponent(Creator.convertSpecialCharacter(e)),l.push([t,"contains",e])})),l.length>0)return s.push(Creator.formatFiltersToDev(l,a,{is_logic_or:!1}))}else if(_.isArray(e))return s.push([t,"=",e])}else{if(["boolean"].includes(n))return s.push([t,"=",JSON.parse(e)]);if(!["lookup","master_detail"].includes(n))return s.push([t,"=",e]);if(i=null!=(r=o[t])?r.reference_to:void 0,_.isFunction(i)&&(i=i()),!_.isArray(i))return s.push([t,"=",e]);if((null!=e?e.ids:void 0)&&s.push({field:t+".ids",operation:"=",value:null!=e?e.ids:void 0}),null!=e?e.o:void 0)return c=Creator.getObject(null!=e?e.o:void 0),s.push({field:t+".o",operation:"=",value:c._collection_name})}}else if(t=t.replace(/(_endLine)$/,""),n=Creator.getFieldDataType(o,t),o[t]&&["date","datetime","time","currency","number"].includes(n))return s.push([t,"<=",e])})),n={is_logic_or:r=!!t.is_mini},Creator.formatFiltersToDev(s,a,n);delete Session.keys.standard_query},Creator.getSafeObjectUrl=function(e,t,r){var o;return _.isString(e)?(o="users"===e?Creator.getObject("space_users"):Creator.getObject(e)).permissions.get().allowRead?Creator.getObjectUrl(e,t,r):void 0:""},Creator.formatFileSize=function(e){var t,r;return r="KB",(t=e/1024)>1024&&(t/=1024,r="MB"),t>1024&&(t/=1024,r="GB"),t.toFixed(2)+r},Creator.getTableCellData=function(e){var r,o,a,n,i,s,c,l,u,d,p,f,m,g,h,v,b,w,S,C,y,j,T,R;if(d=[],R=e.val,g=e.object_name,y=(j=Creator.getObject(g)).NAME_FIELD_KEY,"organizations"===g&&(y="name"),o=e.field){if(a=o.type,"formula"===o.type)a=o.data_type;else if("select"===o.type&&o.data_type&&"text"!==o.data_type)a=o.data_type;else if("summary"===o.type)if("count"===o.summary_type)a="number";else{if(!(C=Creator.getObject(o.summary_object)))throw new Meteor.Error(500,"The summary_object '"+o.summary_object+"' is not found for the field '"+o.name+"'");if(!(S=C.fields[o.summary_field]))throw new Meteor.Error(500,"The summary_field '"+o.summary_field+"' is not found for the field '"+o.name+"'");"formula"!==(a=S.type)&&"summary"!==a||(a=S.data_type),_.isNumber(o.scale)||(r=function(e){var t,o;return _.isNumber(e.scale)?e.scale:"summary"===e.type&&(o=Creator.getObject(e.summary_object))?(t=o.fields[e.summary_field])?r(t):null:void 0},o.scale=r(S))}return v=null!=(h=e.field)?h.reference_to:void 0,_.isFunction(v)&&(v=v()),"grid"===a?d.push({isTable:!0}):"location"===a?d.push({value:(null!=R?R.address:void 0)||"",id:e._id}):"lookup"!==a&&"master_detail"!==a||_.isEmpty(R)?"image"===a?"string"==typeof R?d.push({value:R,id:e._id,isImage:!0,baseUrl:Creator.getRelativeUrl("/api/files/images")}):d.push({value:R,id:e._id,isImages:!0,baseUrl:Creator.getRelativeUrl("/api/files/images")}):"avatar"===a?"string"==typeof R?d.push({value:R,id:e._id,isImage:!0,baseUrl:Creator.getRelativeUrl("/api/files/avatars")}):d.push({value:R,id:e._id,isImages:!0,baseUrl:Creator.getRelativeUrl("/api/files/avatars")}):"code"===a?(R=R?"...":"",d.push({value:R,id:e._id})):"password"===a?(R=R?"******":"",d.push({value:R,id:e._id})):"url"===a?((null!=(f=R)?f.startsWith("http"):void 0)||(f=Steedos.absoluteUrl(encodeURI(f))),d.push({value:R,href:f,id:e._id,isUrl:!0})):"email"===a?d.push({value:R,href:f,id:e._id,isEmail:!0}):"boolean"===a||"toggle"===a?(R=e.val?t("YES"):t("NO"),d.push({value:R,checked:e.val,id:e._id,isBoolean:!0})):"select"===a?(s=o.allOptions||o.options,u=e.doc||{},c=e.record_val,_.isFunction(o.options)&&(s=o.options(c||u)),_.isFunction(o.optionsFunction)&&(s=o.optionsFunction(c||u)),w=e.val,_.isArray(w)||(w=[w]),m=[],_.each(s,(function(e){if(_.indexOf(w,e.value)>-1)return m.push({label:e.label,value:e.value})})),R=(R=m.map((function(e){return e.label}))).join(","),d.push({value:R,items:m,id:e._id,isSelects:!0})):(R&&["datetime","date","time"].indexOf(a)>=0?"odata"===e.agreement?"datetime"===a?"string"==typeof e.val&&/\d+Z$/.test(e.val)?R=moment(e.val).format("YYYY-MM-DD H:mm"):(T=moment().utcOffset()/60,R=moment(e.val).add(T,"hours").format("YYYY-MM-DD H:mm")):"date"===a&&(R="string"==typeof e.val&&/\d+Z$/.test(e.val)?moment.utc(e.val).format("YYYY-MM-DD"):moment(e.val).format("YYYY-MM-DD")):"datetime"===a?R=moment(e.val).format("YYYY-MM-DD H:mm"):"date"===a?R=moment.utc(e.val).format("YYYY-MM-DD"):"time"===a&&(R=moment.utc(e.val).format("HH:mm")):null===e.val?R="":"lookup"===a?_.isFunction(o.optionsFunction)&&(u=e.doc||{},(l=R)&&(_.isArray(l)||(l=[l]),(b=_.filter(o.optionsFunction(u),(function(e){return l.indexOf(e.value)>-1})))&&(R=b.getProperty("label")))):"filesize"===a?R=Creator.formatFileSize(R):["number","currency","percent"].indexOf(a)>-1&&_.isNumber(R)?(p=0,p=_.isNumber(o.scale)?o.scale:"currency"===a?2:0,"percent"===a&&(R*=100),R=Steedos.numberToString(R,p),"percent"===a&&(R+="%")):"markdown"===a?_.isEmpty(R)||(R=Spacebars.SafeString(marked(R))):"html"===a?_.isEmpty(R)||(R=Spacebars.SafeString(R)):"textarea"===a&&R&&(R=(R=R.replace(/\n/g,"\n
")).replace(/ /g," ")),"record_details"!==e.parent_view&&e.field_name===y&&(f=Creator.getObjectUrl(e.object_name,e._id)),d.push({value:R,href:f,id:e._id,type:a})):_.isFunction(o.optionsFunction)&&"company"!==v?(u=e.doc||{},c=e.record_val,(l=R)&&(l=_.isArray(l)?l.map((function(e){return _.isObject(e)?e._id:e})):_.isObject(l)?[l._id]:[l],i=o.optionsFunction(c||u),(b=_.filter(i,(function(e){return l.indexOf(null!=e?e.value:void 0)>-1})))&&(R&&_.isArray(R)&&_.isArray(b)&&(b=Creator.getOrderlySetByIds(b,R,"value")),R=b.getProperty("label"))),v?"objects"===v?_.each(b,(function(t){var r,o,a;return a=t.label,(null!=(r=Creator.getObject(t.value))?r._id:void 0)?(o=Creator.getSafeObjectUrl(v,r._id),d.push({reference_to:v,rid:a,value:a,id:e._id,href:o})):d.push({value:R,id:e._id})})):(n=e.val,_.isArray(n)||(n=n?[n]:[]),_.each(n,(function(t){var r,o,a;return _.isString(t)?(b=_.filter(i,(function(e){return t===(null!=e?e.value:void 0)})),d.push({value:b.getProperty("label"),id:e._id})):(v=t["reference_to._o"]||v,o=t._id,a=t._NAME_FIELD_VALUE,r=Creator.getSafeObjectUrl(v,o),d.push({reference_to:v,rid:o,value:a,href:r,id:e._id}))}))):d.push({value:R,id:e._id})):(_.isArray(R)||(R=R?[R]:[]),_.each(R,(function(t){var r,o,a;if(t)return v=t["reference_to._o"]||v,o=t._id,a=t._NAME_FIELD_VALUE,_.isString(t)&&(o=t,a=t),r=Creator.getSafeObjectUrl(v,o),d.push({reference_to:v,rid:o,value:a,href:r,id:e._id})}))),d}},Creator.openSafeObjectUrl=function(e,t){var r;return Steedos.isMobile()||(r=Creator.getSafeObjectUrl(e,t,"-"))&&window.open(r,"_blank","width=800, height=600, left=50, top= 50, toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes"),"undefined"!=typeof event&&null!==event&&event.stopPropagation(),"undefined"!=typeof event&&null!==event&&event.preventDefault(),!1},Creator.getAppLabel=function(e){return e||(e=Creator.getApp()),e?e.label?t(e.label):t(e.name):""},Creator.measureWidth=_.memoize((function(e,t,r){var o,a,n,i;return(o=arguments.callee.canvas)||(o=document.createElement("canvas"),(n=document.createDocumentFragment()).appendChild(o),arguments.callee.canvas=o),(a=o.getContext("2d")).font=t,i=a.measureText(e).width,r&&i>r?r:i})),Creator.showPreviewButton=function(e){var t,r,o,a,n;return!!((null!=(n=null!=(t=Meteor.settings)&&null!=(r=t.public)?r.webservices:void 0)&&null!=(o=n.officeOnline)?o.url:void 0)&&Steedos.isOfficeFile(e)||(null!=n&&null!=(a=n.pdfOnline)?a.url:void 0)&&Steedos.isPdfFile(e))},Creator.officeOnlinePreview=function(e,t){var r,o,a,n,i,s,c,l,u,d,p,f,m,_,g,h;return a=null!=(s=Meteor.settings)&&null!=(c=s.public)&&null!=(l=c.webservices)&&null!=(u=l.officeOnline)?u.url:void 0,i=null!=(d=Meteor.settings)&&null!=(p=d.public)&&null!=(f=p.webservices)&&null!=(m=f.pdfOnline)?m.url:void 0,a&&""!==a||i&&""!==i?(h=Meteor.userId(),_=Steedos.spaceId(),r={authToken:o=Accounts._storedLoginToken()},e=e+"?token="+(g=window.btoa(JSON.stringify(r))),Steedos.isPdfFile(t)?(n=e,i&&""!==i&&(n=i+encodeURIComponent(e)),Steedos.openWindow(n)):(n=a+encodeURIComponent(e),Steedos.openWindow(n))):(toastr.error(TAPi18n.__("creator_office_online_web_url_required")),!1)},Creator.isImageAttachment=function(e){var t,r;return!(e.split(".").length<2)&&(t=e.split(".").pop().toLowerCase(),-1!==(r=["png","jpg","jpeg","bmp","gif","webp","psd","svg","tiff"]).indexOf(t))},Creator.isHtmlAttachment=function(e){var t,r;return!(e.split(".").length<2)&&(t=e.split(".").pop().toLowerCase(),-1!==(r=["html","htm"]).indexOf(t))}),Meteor.startup((function(){return $(document).on("click",(function(e){return $(e.target).closest(".slds-table td").length<1?$(".slds-table").addClass("slds-no-cell-focus"):$(".slds-table").removeClass("slds-no-cell-focus")})),$(window).resize((function(){if($(".list-table-container table.dataTable").length)return $(".list-table-container table.dataTable thead th").each((function(){var e;return e=$(this).outerWidth(),$(".slds-th__action",this).css("width",e+"px")}))})),$(document).keydown((function(e){if("13"===e.keyCode||"Enter"===e.key){if($(".modal").length>1)return;if("TEXTAREA"!==e.target.tagName||$(e.target).closest("div").hasClass("bootstrap-tagsinput")){if("update"===Session.get("cmOperation"))return e.preventDefault(),e.stopPropagation(),$(".creator-auotform-modals .btn-update").click();if("insert"===Session.get("cmOperation"))return e.preventDefault(),e.stopPropagation(),$(".creator-auotform-modals .btn-insert").click()}}}))}))},"colors.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},r,o,a,n,i;n="border-radius: 10px;padding: 1px 6px;display: inline-block;",i=function(e){return 3===(e=e.slice(1)).length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),{r:Number.parseInt(e.slice(0,2),16),g:Number.parseInt(e.slice(2,4),16),b:Number.parseInt(e.slice(4,6),16)}},a=function(e,t,r){var o,a,n,s;return.299*(n=(s=i(e)).r)+.587*(a=s.g)+.114*(o=s.b)>186?r:t},o=function(e,t,r){var o,a,n,s,c,l,u;return(o=.2126*(n=(u=[(c=(l=i(e)).r)/255,(s=l.g)/255,(a=l.b)/255]).map((function(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})))[0]+.7152*n[1]+.0722*n[2])>.179?r:t},r=function(e){var t,r;return r=[],t=e.fields,_.each(t,(function(t,a){var i;if(i=t.options,_.isFunction(i)&&(i=i({})),"select"===t.type&&(null!=i?i.length:void 0))return _.each(i,(function(t){var i,s;if(t.color)return i=t.color,/^#/.test(i)||(i="#"+i),s=o(i,"#fff","#333"),r.push(".creator-cell-color-"+e.name+"-"+a+"-"+t.value+"{"+n+"background:"+i+";color:"+s+";}")}))})),r},Creator.appendObjectFieldsColorStyles=function(){var e,t;return $("#object_fields_color_styles").remove(),t=[],_.each(Creator.Objects,(function(e){return t=_.union(t,r(e))})),t.push(".creator-cell-multiple-color{\n\tmargin-right:1px;\n}\n@media (max-width:767px) {\n\t.creator-cell-multiple-color{\n\t\tmargin-right:4px;\n\t}\n}"),e=$('"),$("head").append(e)}},"temp_navs.coffee":function e(){var r=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},o,a,n,i,s,c,l,u,d,p;s=!1,a=function(){var e;if(e=sessionStorage.getItem("temp_navs"))return e.split(",").map((function(e){var t;return{name:(t=e.split(":"))[0],url:t[1],label:t[2],is_temp:!0}}))},n=function(e,t,r){return sessionStorage.getItem("temp_navs_id")},d=function(e){return sessionStorage.setItem("temp_navs_id",e)},p=function(e){var t,r;return e||(e=[]),t=(r=e.map((function(e){var t;return t=e.name,e.url&&(t+=":"+e.url),e.label&&(t+=":"+e.label),t}))).join(","),sessionStorage.setItem("temp_navs",t)},c=[],o=function(e,t){var r;return r=t||Creator.getObjectUrl(e),c.push(r)},u=function(e,t){var r,o;if(o=t||Creator.getObjectUrl(e),(r=c.indexOf(o))>-1)return c.splice(r,1)},i=function(e,t){var r,o,a,n,i,s;for(r=t||Creator.getObjectUrl(e),o=2,s=6,i=!1;!i&&o<8&&!((a=urlQuery.length-o)<0);)n=urlQuery[a],__meteor_runtime_config__.ROOT_URL_PATH_PREFIX+n!==r?(i=n&&c.indexOf(__meteor_runtime_config__.ROOT_URL_PATH_PREFIX+n)<0,o++):o++;return i?n:null},l=function(e,t,r,a){var n,s,c,l,u,d,p,f,m;return n=Session.get("object_name"),s=Session.get("record_id"),t?(l=(c=Creator.getObjectUrl(n,s))===t)||(l=FlowRouter.current().path===t):l=n===e,l?(d=i(e,t),o(e,t),d?(FlowRouter.go(d),urlQuery.pop(),urlQuery.pop()):((f=r[a])||(f=r[a-1]),f?(m=f.url?f.url:Creator.getObjectUrl(f.name),FlowRouter.redirect(m)):(u=(p=Creator.getAppMenus())[p.length-1],FlowRouter.redirect(u.path)))):o(e,t)},Creator.getTempNavs=function(){var e;return(e=Session.get("temp_navs"))||(e=a())&&Session.set("temp_navs",e),e},Creator.getTempNavsId=function(){var e;return(e=Session.get("temp_navs_id"))||(e=n())&&Session.set("temp_navs_id",e),e},Creator.createTempNav=function(e,t,r){var o,a;if(t||!(["users","cms_files","cfs.files.filerecord"].indexOf(e)>-1))return(a=Creator.getTempNavs())||(a=[]),(o=a.find((function(r){return t?r.name===e&&r.url===t:r.name===e})))?void 0:(a.push({name:e,url:t,label:r,is_temp:!0}),Session.set("temp_navs",a),p(a),u(e,t))},Creator.updateTempNavLabel=function(e,t,r){var o,a;if(t&&r)return(a=Creator.getTempNavs())||(a=[]),(o=a.find((function(r){return r.name===e&&r.url===t})))?(o.label=r,Session.set("temp_navs",a),p(a)):void 0},Creator.removeTempNavItem=function(e,t){var r,o,a;if((a=Session.get("temp_navs"))&&(o=null,r=a.filter((function(r,a){var n;return(n=t?r.name===e&&r.url===t:r.name===e)&&(o=a),!n})),_.isNumber(o)))return s=!0,l(e,t,r,o),Meteor.defer((function(){return Session.set("temp_navs",r),p(r),s=!1})),!0},Creator.resetTempNavsIfNeeded=function(){var e,t,r;if((t=(r=Creator.getTempNavsId())!==(e=Meteor.userId()+":"+Steedos.spaceId()+":"+Session.get("app_id")))&&(Session.set("temp_navs",null),p(null),c.length=0),t||!Session.get("temp_navs_id"))return Session.set("temp_navs_id",e),d(e)},Meteor.startup((function(){if(!Steedos.isMobile())return Tracker.autorun((function(){var e,t;if(Creator.bootstrapLoaded.get()&&(t=Session.get("spaceId"),e=Session.get("app_id"),t&&e))return Creator.resetTempNavsIfNeeded()})),Tracker.autorun((function(e){var r,o,a,n,i,c,l,u,d,p,f,m,g,h,v;if(u=Session.get("object_name"),h=Session.get("tab_name"),p=Session.get("record_id"),i=Creator.getAppMenus(),u&&i&&i.length&&(f=Session.get("record_name"),n=_.pluck(i,"id"),o=Session.get("temp_navs_force_create"),(null!=n?n.indexOf(u||h):void 0)<0||o)){if(o&&s)return void Session.set("temp_navs_force_create",!1);if(!(l=Creator.getObject(u)))return;if(p){if(!(d=Creator.getObjectRecord()))return;if(v=Creator.getObjectUrl(u,p),o&&(r=urlQuery[urlQuery.length-3])&&(g=new RegExp(r+"$")).test(v))return void Session.set("temp_navs_force_create",!1);a=f||("cfs.files.filerecord"===u?t("cfs_files_filerecord__object")+"-"+(null!=d&&null!=(m=d.original)?m.name:void 0):d[c=l.NAME_FIELD_KEY||"name"]),Creator.createTempNav(u,v,a)}else Creator.createTempNav(u);if(o)return Session.set("temp_navs_force_create",!1)}}))}))},"router.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},r,o,a,n;this.urlQuery=new Array,o=function(e,t){var r,o;Meteor.userId()&&(Creator.pushCurrentPathToUrlQuery(),"-"!==(r=e.params.app_id)&&r&&Session.get("app_id")!==r?Session.set("app_id",r):"-"!==r||Session.get("app_id")||(o=Steedos.getFirstApp(),Session.set("app_id",o.id)))},n=function(e,t){var r,o,a,n;if(o=Tracker.nonreactive((function(){return Session.get("object_name")})),a=Tracker.nonreactive((function(){return Session.get("record_id")})),r=e.params.object_name,n=e.params.record_id,Session.set("object_name",r),Session.set("tab_name",null),Session.set("pageApiName",null),Session.set("record_id",n),Session.set("record_name",null),n&&(o&&o!==r||a&&n!==a))return Session.set("temp_navs_force_create",!0)},r=function(e,t){var r;if("admin"===(r=e.params.app_id)&&Steedos.isMobile())return t("/user_settings"),urlQuery.pop()},FlowRouter.route("/app",{triggersEnter:[o],action:function(e,t){return BlazeLayout.render(Creator.getLayout(),{main:"creator_app_home"})}}),FlowRouter.route("/app/menu",{triggersEnter:[o],action:function(e,t){var r;return r="app_object_menu",Session.set("hidden_header",!0),BlazeLayout.render(Creator.getLayout(),{main:r})},triggersExit:[function(e,t){if(Steedos.isMobile())return Session.set("hidden_header",void 0)}]}),FlowRouter.route("/app/:app_id",{triggersEnter:[o],action:function(e,t){var r,o,a;return"-"!==(o=FlowRouter.getParam("app_id"))&&(Session.set("object_name",null),Session.set("record_id",null),Session.set("app_id",o)),Session.set("admin_template_name",null),a=(r=Creator.getApp(o))&&r.is_use_iframe?"creator_app_iframe":"creator_app_home",BlazeLayout.render(Creator.getLayout(),{main:a})}}),FlowRouter.route("/app/:app_id/page/:page_id",{triggersEnter:[o],action:function(e,t){var r,o;return console.log("params",e),r=FlowRouter.getParam("app_id"),o=null!=e?e.page_id:void 0,Session.set("pageApiName",o),Session.set("object_name",null),BlazeLayout.render(Creator.getLayout(),{main:"page_template",regions:{appId:r,pageId:o}})},triggersExit:[function(e,t){return Session.set("pageApiName",null)}]}),FlowRouter.route("/page/:page_id/",{action:function(e,t){return BlazeLayout.render(Creator.getLayout(),{main:"page"})}}),FlowRouter.route("/app/:app_id/tab_iframe/:tab_id",{triggersEnter:[o],action:function(e,t){var r;return r=FlowRouter.getParam("tab_id"),Session.set("tab_name",r),Session.set("object_name",null),BlazeLayout.render(Creator.getLayout(),{main:"page_iframe",regions:{params:e,queryParams:t}})},triggersExit:[function(e,t){return Session.set("tab_name",null)}]}),(a=FlowRouter.group({prefix:"/app/:app_id/:object_name",name:"objectRoutes",triggersEnter:[o,n]})).route("/",{triggersEnter:[function(e,t){var r,o,a,n,i;return n=e.params.object_name,o=(null!=(a=window.getFirstListView(n))?a.name:void 0)||(null!=a?a._id:void 0),t(i="/app/"+(r=e.params.app_id)+"/"+n+"/grid/"+o)}],action:function(e,t){return BlazeLayout.render(Creator.getLayout(),{main:"object_home"})}}),a.route("/:record_id/:related_object_name/grid",{action:function(e,t){var r,o,a,n,i,s,c,l;return o={app_id:r=Session.get("app_id"),object_name:n=FlowRouter.getParam("object_name"),record_id:s=FlowRouter.getParam("record_id"),related_object_name:l=FlowRouter.getParam("related_object_name")},Session.set("related_object_name",l),a="related_object_list",(i=Steedos.Page.getPage("related_list",r,l))&&(a="page_related_list_view",c={page:i,appId:Session.get("app_id"),objectName:n,recordId:s,relatedObjectName:l,__timestamp:(new Date).getTime()}),Meteor.setTimeout((function(){return BlazeLayout.render(Creator.getLayout(),{main:a,regions:c})}),10)}}),a.route("/view/:record_id",{action:function(e,t){var r,o,a,n,i,s,c;return t["X-Space-Id"]&&Steedos.setSpaceId(t["X-Space-Id"]),o={app_id:r=FlowRouter.getParam("app_id"),object_name:n=FlowRouter.getParam("object_name"),record_id:s=FlowRouter.getParam("record_id")},ObjectRecent.insert(n,s),Session.set("detail_info_visible",!0),a="creator_view",(i=Steedos.Page.getPage("record",Session.get("app_id"),n,s))&&(a="page_object",c=window._.defaultsDeep({display:Steedos.Page.getDisplay(n)},FlowRouter.current().queryParams,{page:i,appId:Session.get("app_id"),recordId:s,objectName:n,pageType:"record",__timestamp:(new Date).getTime()})),Meteor.setTimeout((function(){return BlazeLayout.render(Creator.getLayout(),{main:a,regions:c})}),10)},triggersExit:[function(e,t){var r,o,a,n;if(Session.get("instance_change")&&("instances"===(null!=(r=e.params)?r.object_name:void 0)&&"draft"===(null!=(o=e.queryParams)?o.side_listview_id:void 0)||"instance_tasks"===(null!=(a=e.params)?a.object_name:void 0)&&"inbox"===(null!=(n=e.queryParams)?n.side_listview_id:void 0)))return InstanceManager.saveIns(!1)}]}),a.route("/grid/:list_view_id",{action:function(e,t){var r,o,a,n,i;return Session.set("record_id",null),Session.get("object_name")===FlowRouter.getParam("object_name")&&Session.get("list_view_id")===FlowRouter.getParam("list_view_id")||(Session.set("filter_target",null),Session.set("filter_items",null)),Session.get("object_name")!==FlowRouter.getParam("object_name")&&Session.set("list_view_id",null),"true"===(null!=t?t.hidden_header:void 0)&&Session.set("hidden_header",!0),"-"!==(r=FlowRouter.getParam("app_id"))&&Session.set("app_id",r),a=FlowRouter.getParam("object_name"),Session.set("object_name",a),Session.set("list_view_id",FlowRouter.getParam("list_view_id")),Session.set("list_view_visible",!1),Tracker.afterFlush((function(){return Session.set("list_view_visible",!0)})),(n=Steedos.Page.getPage("list",Session.get("app_id"),a))&&(o="page_object",i=window._.defaultsDeep({display:Steedos.Page.getDisplay(a)},FlowRouter.current().queryParams,{page:n,appId:Session.get("app_id"),objectName:a,listViewId:Session.get("list_view_id"),pageType:"list",__timestamp:(new Date).getTime()})),BlazeLayout.render(Creator.getLayout(),{main:o,regions:i})}}),FlowRouter.notFound={action:function(e,t){var r;try{throw new Error("404 not found:"+window.location.href)}catch(o){r=o,console.log(r,window.location.href)}return BlazeLayout.render("empty_layout",{main:"notFound"})}}},"tenant.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};$.getJSON("/accounts/settings",(function(e){return(null!=e?e.tenant:void 0)&&Session.set("tenant_settings",e.tenant),Steedos.settings=Object.assign(Steedos.settings,e.settings||{})}))},"animate.js":function e(){$.fn.extend({animateCss:function(e,t){var r=function(e){var t={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(var r in t)if(void 0!==e.style[r])return t[r]}(document.createElement("div"));return this.addClass("animated "+e).one(r,(function(){$(this).removeClass("animated "+e),"function"==typeof t&&t()})),this}})},"colResizable-1.6.js":function e(){!function(e){var t=e(document),r=e("head"),o=null,a={},n=0,i="id",s="px",c="JColResizer",l="JCLRFlex",u=parseInt,d=Math,p=navigator.userAgent.indexOf("Trident/4.0")>0,f;try{f=sessionStorage}catch(T){}r.append("");var m=function(t,o){var s=e(t);if(s.opt=o,s.mode=o.resizeMode,s.dc=s.opt.disabledColumns,s.opt.disable)return _(s);var l=s.id=s.attr(i)||c+n++;s.p=s.opt.postbackSafe,!s.is("table")||a[l]&&!s.opt.partialRefresh&&s.prev(".JCLRgrips").length>0||("col-resize"!==s.opt.hoverCursor&&r.append(""),s.addClass(c).attr(i,l).before('
'),s.g=[],s.c=[],s.w=s.width(),s.gc=s.prev(),s.f=s.opt.fixed,o.marginLeft&&s.gc.css("marginLeft",o.marginLeft),o.marginRight&&s.gc.css("marginRight",o.marginRight),s.cs=u(p?t.cellSpacing||t.currentStyle.borderSpacing:s.css("border-spacing"))||2,s.b=u(p?t.border||t.currentStyle.borderLeftWidth:s.css("border-left-width"))||1,a[l]=s,g(s))},_=function(e){var t=e.attr(i),e;(e=a[t])&&e.is("table")&&(e.removeClass(c+" "+l).gc.remove(),delete a[t])},g=function(t){var r=t.find(">thead>tr:first>th,>thead>tr:first>td");r.length||(r=t.find(">tbody>tr:first>th,>tr:first>th,>tbody>tr:first>td, >tr:first>td")),r=r.filter(":visible"),t.cg=t.find("col"),t.ln=r.length,t.p&&f&&f[t.id]&&h(t,r),r.each((function(r){var o=e(this),a=-1!=t.dc.indexOf(r),n=e(t.gc.append('
')[0].lastChild);n.append(a?"":t.opt.gripInnerHtml).append('
'),r==t.ln-1&&(n.addClass("JCLRLastGrip"),t.f&&n.html("")),n.bind("touchstart mousedown",y),a?n.addClass("JCLRdisabledGrip"):n.removeClass("JCLRdisabledGrip").bind("touchstart mousedown",y),n.t=t,n.i=r,n.c=o,o.w=o.width(),t.g.push(n),t.c.push(o),o.width(o.w).removeAttr("width"),n.data(c,{i:r,t:t.attr(i),last:r==t.ln-1})})),t.cg.removeAttr("width"),t.find("td, th").not(r).not("table th, table td").each((function(){e(this).removeAttr("width")})),t.f||t.removeAttr("width").addClass(l),v(t)},h=function(e,t){var r,o=0,a=0,n=[],i;if(t){if(e.cg.removeAttr("width"),e.opt.flush)return void(f[e.id]="");for(i=(r=f[e.id].split(";"))[e.ln+1],!e.f&&i&&(e.width(i*=1),e.opt.overflow&&(e.css("min-width",i+s),e.w=i));a*{cursor:"+s.opt.dragCursor+"!important}"),l.addClass(s.opt.draggingClass),o=l,s.c[i.i].l)for(var d=0,p;d"+(r.label||a),value:t+"."+a,icon:null!=o?o.icon:void 0})})):void 0})),o&&(c=Creator.getRelatedObjects(e),_.each(c,(l=this,function(e){var t,r;return r=Creator.getObjectLookupFieldOptions(e.object_name,!1,!1,!1),t=Creator.getObject(e.object_name),_.each(r,(function(r){if(e.foreign_key!==r.value)return n.push({label:(t.label||t.name)+"=>"+r.label,value:t.name+"."+r.value,icon:null!=t?t.icon:void 0})}))}))),n):n},Creator.getObjectFilterFieldOptions=function(e){var t,r,o,a,n;return r=[],e?(o=null!=(t=Creator.getObject(e))?t.fields:void 0,n=Creator.getFields(e),a=null!=t?t.icon:void 0,_.forEach(o,(function(e,t){if(!_.include(["grid","object","[Object]","[object]","Object","avatar","image","markdown","html"],e.type)&&!e.hidden&&!/\w+\./.test(t)&&_.indexOf(n,t)>-1)return r.push({label:e.label||t,value:t,icon:a})})),r):r},Creator.getObjectFieldOptions=function(e){var t,r,o,a,n;return r=[],e?(o=null!=(t=Creator.getObject(e))?t.fields:void 0,n=Creator.getFields(e),a=null!=t?t.icon:void 0,_.forEach(o,(function(e,t){if(!_.include(["grid","object","[Object]","[object]","Object","markdown","html"],e.type)&&!/\w+\./.test(t)&&_.indexOf(n,t)>-1)return r.push({label:e.label||t,value:t,icon:a})})),r):r},Creator.getFiltersWithFilterFields=function(e,t,r){return e||(e=[]),r||(r=[]),(null!=r?r.length:void 0)&&r.forEach((function(r){if(_.isString(r)&&(r={field:r,required:!1}),t[r.field]&&!_.findWhere(e,{field:r.field}))return e.push({field:r.field,is_default:!0,is_required:r.required})})),e.forEach((function(e){var t;return t=r.find((function(t){return t===e.field||t.field===e.field})),_.isString(t)&&(t={field:t,required:!1}),t?(e.is_default=!0,e.is_required=t.required):(delete e.is_default,delete e.is_required)})),e},Creator.getObjectRecord=function(e,t,r,o){var a,n,i,s,c,l;if(e||(e=Session.get("object_name")),t||(t=Session.get("record_id")),Meteor.isClient){if(e!==Session.get("object_name")||t!==Session.get("record_id"))return Creator.odata.get(e,t,r,o);if(null!=(s=Template.instance())?s.record:void 0)return null!=(c=Template.instance())&&null!=(l=c.record)?l.get():void 0}if("meteor"!==(n=Creator.getObject(e)).database_name&&n.database_name){if(e&&t)return Creator.odata.get(e,t,r,o)}else if(a=Creator.getCollection(e))return i=a.findOne(t)},Creator.getObjectRecordName=function(e,t){var r,o;if(e||(e=Creator.getObjectRecord()),e&&(r="organizations"===t?"name":null!=(o=Creator.getObject(t))?o.NAME_FIELD_KEY:void 0,e&&r))return e.label||e[r]},Creator.getApp=function(e){var t,r;return(t=Session.get("_app_menus")||Session.get("app_menus"))?r=t.find((function(t){return t.id===e})):{}},Creator.getAppDashboard=function(e){var t,r;if(t=Creator.getApp(e))return r=null,_.each(Creator.Dashboards,(function(e,o){var a;if((null!=(a=e.apps)?a.indexOf(t._id):void 0)>-1)return r=e})),r},Creator.getAppDashboardComponent=function(e){var t;t=Creator.getApp(e)},Creator.getAppObjectNames=function(e){var t,r,o,a;if(t=Creator.getApp(e))return r=(o=Steedos.isMobile())?t.mobile_objects:t.objects,a=[],t&&_.each(r,(function(e){var t;if(null!=(t=Creator.getObject(e))?t.permissions.get().allowRead:void 0)return a.push(e)})),a},Creator.getUrlWithToken=function(e,t){var r,o,a;return(a={})["X-Space-Id"]=Steedos.spaceId(),a["X-User-Id"]=Steedos.userId(),a["X-Company-Ids"]=Steedos.getUserCompanyIds(),a["X-Auth-Token"]=Accounts._storedLoginToken(),Steedos.isExpression(e)&&(e=Steedos.parseSingleExpression(e,t,"#",Creator.USER_CONTEXT)),""+e+(o=(r=/(\#.+\?)|(\?[^#]*$)/g.test(e))?"&":"?")+$.param(a)},Creator.getAppMenu=function(e,t){var r;return(r=Creator.getAppMenus(e))&&r.find((function(e){return e.id===t}))},Creator.getAppMenuUrlForInternet=function(e){return Creator.getUrlWithToken(e.path,e)},Creator.getAppMenuUrl=function(e){var t;return t=e.path,"url"===e.type?e.target?Creator.getAppMenuUrlForInternet(e):"/app/-/tab_iframe/"+e.id:e.path},Creator.getAppMenus=function(e){var t,r;return(t=Session.get("_app_menus")||Session.get("app_menus"))?(r=t.find((function(t){return t.id===e})))?r.children:void 0:[]},Creator.loadAppsMenus=function(){var e,t,r;return e={},(t=Steedos.isMobile())&&(e.mobile=t),r={type:"get",data:e,success:function(e){return Session.set("app_menus",e)}},null!=Steedos?Steedos.authRequest("/service/api/apps/menus",r):void 0},Creator.creatorAppsSelector=function(e,t){var r,o,a;return r=void 0,a=void 0,_.each(e,(function(e,t){e._id||(e._id=t),e.is_creator||(e.visible=!1)})),a=_.sortBy(_.values(e),"sort"),o={},r={},_.each(a,(function(e){return"admin"===e._id?r=e:o[e._id]=e})),o.admin=r,t.length&&_.each(o,(function(e,r){t.indexOf(r)>-1?e.visible=e.is_creator:e.visible=!1})),o},Creator.visibleAppsSelector=function(e,t){var r;return null==t&&(t=!0),r=[],_.each(e,(function(e,o){(!1!==e.visible&&"admin"!==e._id||t&&"admin"===e._id)&&r.push(e)})),r},Creator.getVisibleApps=function(e){var t,r;return t=Creator._subApp.get(),r=Object.assign({},Creator.Apps,{apps:t}),Creator.visibleAppsSelector(r,e)},Creator.getVisibleAppsObjects=function(){var e,t,r;return e=Creator.getVisibleApps(),r=_.flatten(_.pluck(e,"objects")),t=(t=_.filter(Creator.Objects,(function(e){return!(r.indexOf(e.name)<0)}))).sort(Creator.sortingMethod.bind({key:"label"})),t=_.pluck(t,"name"),_.uniq(t)},Creator.getAppsObjects=function(){var e,t;return e=[],t=[],_.forEach(Creator.Apps,(function(r){return t=_.filter(r.objects,(function(e){return!e.hidden})),e=e.concat(t)})),_.uniq(e)},Creator.validateFilters=function(e,t){var r,o,a,n,i,s,c;if(a=_.map(e,(function(e){return!_.isEmpty(e)&&e})),a=_.compact(a),o="",n=a.length,t){if(t=t.replace(/\n/g,"").replace(/\s+/g," "),/[._\-!+]+/gi.test(t)&&(o="含有特殊字符。"),!o)if(s=t.match(/\d+/gi))for(s.forEach((function(e){if(e<1||e>n)return o="您的筛选条件引用了未定义的筛选器:"+e+"。"})),i=1;i<=n;)s.includes(""+i)||(o="有些筛选条件进行了定义,但未在高级筛选条件中被引用。"),i++;else o="有些筛选条件进行了定义,但未在高级筛选条件中被引用。";if(o||(c=t.match(/[a-zA-Z]+/gi))&&c.forEach((function(e){if(!/^(and|or)$/gi.test(e))return o="检查您的高级筛选条件中的拼写。"})),!o){try{Creator.eval(t.replace(/and/gi,"&&").replace(/or/gi,"||"))}catch(l){r=l,o="您的筛选器中含有特殊字符"}(/(AND)[^()]+(OR)/gi.test(t)||/(OR)[^()]+(AND)/gi.test(t))&&(o="您的筛选器必须在连续性的 AND 和 OR 表达式前后使用括号。")}}return!o||(console.log("error",o),Meteor.isClient&&toastr.error(o),!1)},Creator.formatFiltersToMongo=function(e,t){var r;if(null!=e?e.length:void 0)return e[0]instanceof Array||(e=_.map(e,(function(e){return[e.field,e.operation,e.value]}))),r=[],_.each(e,(function(e){var o,a,n,i,s;return o=e[0],a=e[1],s=Meteor.isClient?Creator.evaluateFormula(e[2]):Creator.evaluateFormula(e[2],null,t),(i={})[o]={},"="===a?i[o].$eq=s:"<>"===a?i[o].$ne=s:">"===a?i[o].$gt=s:">="===a?i[o].$gte=s:"<"===a?i[o].$lt=s:"<="===a?i[o].$lte=s:"startswith"===a?(n=new RegExp("^"+s,"i"),i[o].$regex=n):"contains"===a?(n=new RegExp(s,"i"),i[o].$regex=n):"notcontains"===a&&(n=new RegExp("^((?!"+s+").)*$","i"),i[o].$regex=n),r.push(i)})),r},Creator.isBetweenFilterOperation=function(e){var t;return"between"===e||!!(null!=(t=Creator.getBetweenTimeBuiltinValues(!0))?t[e]:void 0)},Creator.formatFiltersToDev=function(e,t,r){var o,a;if(e.length)return(null!=r?r.is_logic_or:void 0)&&(o=[],e.forEach((function(e){return o.push(e),o.push("or")})),o.pop(),e=o),a=SteedosFilters.formatFiltersToDev(e,Creator.USER_CONTEXT)},Creator.formatLogicFiltersToDev=function(e,t,r){var o;return o="["+(o=(o=t.replace(/\(\s+/gi,"(").replace(/\s+\)/gi,")").replace(/\(/g,"[").replace(/\)/g,"]").replace(/\s+/g,",").replace(/(and|or)/gi,"'$1'")).replace(/(\d)+/gi,(function(t){var o,a,n,i,s;return o=e[t-1],a=o.field,n=o.operation,s=Meteor.isClient?Creator.evaluateFormula(o.value):Creator.evaluateFormula(o.value,null,r),i=[],!0===_.isArray(s)?("="===n?_.each(s,(function(e){return i.push([a,n,e],"or")})):"<>"===n?_.each(s,(function(e){return i.push([a,n,e],"and")})):_.each(s,(function(e){return i.push([a,n,e],"or")})),"and"!==i[i.length-1]&&"or"!==i[i.length-1]||i.pop()):i=[a,n,s],JSON.stringify(i)})))+"]",Creator.eval(o)},Creator.getRelatedObjects=function(e,t,r){var o,a,n,i,s;return Meteor.isClient&&(e||(e=Session.get("object_name")),t||(t=Session.get("spaceId")),r||(r=Meteor.userId())),n=[],(o=Creator.getObject(e))?(i=Creator.getObjectRelateds(o._collection_name),0===(null!=(n=_.pluck(i,"object_name"))?n.length:void 0)?n:(s=(a=Creator.getPermissions(e,t,r)).unrelated_objects,n=_.difference(n,s),_.filter(i,(function(e){var o,i,s,c;return c=e.object_name,i=n.indexOf(c)>-1,o=null!=(s=Creator.getPermissions(c,t,r))?s.allowRead:void 0,"cms_files"===c&&(o=o&&a.allowReadFiles),i&&o})))):n},Creator.getRelatedObjectNames=function(e,t,r){var o;return o=Creator.getRelatedObjects(e,t,r),_.pluck(o,"object_name")},Creator.getRelatedObjectListActions=function(e,t,r){var o;return o=Creator.getActions(e,t,r),o=_.filter(o,(function(e){return"standard_follow"!==e.name&&("standard_query"!==e.name&&("list"===e.on&&("function"==typeof e.visible?e.visible():e.visible)))}))},Creator.getActions=function(e,t,r){var o,a,n,i,s,c;if(Meteor.isClient&&(e||(e=Session.get("object_name")),t||(t=Session.get("spaceId")),r||(r=Meteor.userId())),n=Creator.getObject(e))return i=Creator.getPermissions(e,t,r),a=i.disabled_actions,o=_.sortBy(_.values(n.actions),"sort"),_.has(n,"allow_customActions")&&(o=_.filter(o,(function(e){return _.include(n.allow_customActions,e.name)||_.include(_.keys(Creator.getObject("base").actions)||{},e.name)}))),_.has(n,"exclude_actions")&&(o=_.filter(o,(function(e){return!_.include(n.exclude_actions,e.name)}))),_.each(o,(function(e){if(Steedos.isMobile()&&["record","record_only"].indexOf(e.on)>-1&&"standard_edit"!==e.name)return"record_only"===e.on?e.on="record_only_more":e.on="record_more"})),Steedos.isMobile()&&["cms_files","cfs.files.filerecord"].indexOf(e)>-1&&(null!=(s=o.find((function(e){return"standard_edit"===e.name})))&&(s.on="record_more"),null!=(c=o.find((function(e){return"download"===e.name})))&&(c.on="record")),o=_.filter(o,(function(e){return _.indexOf(a,e.name)<0}))},Creator.getListViews=function(e,t,r){var o,a,n,i,s,c;if(Meteor.isClient&&(e||(e=Session.get("object_name")),t||(t=Session.get("spaceId")),r||(r=Meteor.userId())),e&&(s=Creator.getObject(e)))return o=(null!=(c=Creator.getPermissions(e,t,r))?c.disabled_list_views:void 0)||[],i=[],a=Steedos.isMobile(),_.each(s.list_views,(function(e,t){return e.name=t})),n=_.sortBy(_.values(s.list_views),"sort_no"),_.each(n,(function(e){var t;if(!a||"calendar"!==e.type)return"default"===e.name||(t=_.indexOf(o,e.name)>-1||e._id&&_.indexOf(o,e._id)>-1)&&e.owner!==r?void 0:i.push(e)})),i},Creator.getFields=function(e,t,r){var o,a,n;return Meteor.isClient&&(e||(e=Session.get("object_name")),t||(t=Session.get("spaceId")),r||(r=Meteor.userId())),o=Creator.getObjectFieldsName(e),n=null!=(a=Creator.getPermissions(e,t,r))?a.unreadable_fields:void 0,_.difference(o,n)},Creator.isloading=function(){return!Creator.bootstrapLoaded.get()},Creator.convertSpecialCharacter=function(e){return e.replace(/([\^\$\(\)\*\+\?\.\\\|\[\]\{\}])/g,"\\$1")},Creator.getDisabledFields=function(e){var t;return t=_.map(e,(function(e,t){return e.autoform&&e.autoform.disabled&&!e.autoform.omit&&t})),t=_.compact(t)},Creator.getHiddenFields=function(e){var t;return t=_.map(e,(function(e,t){return e.autoform&&"hidden"===e.autoform.type&&!e.autoform.omit&&t})),t=_.compact(t)},Creator.getFieldsWithNoGroup=function(e){var t;return t=_.map(e,(function(e,t){return(!e.autoform||!e.autoform.group||"-"===e.autoform.group)&&(!e.autoform||"hidden"!==e.autoform.type)&&t})),t=_.compact(t)},Creator.getSortedFieldGroupNames=function(e){var t;return t=_.map(e,(function(e){return e.autoform&&"-"!==e.autoform.group&&e.autoform.group})),t=_.compact(t),t=_.unique(t)},Creator.getFieldsForGroup=function(e,t){var r;return r=_.map(e,(function(e,r){return e.autoform&&e.autoform.group===t&&"hidden"!==e.autoform.type&&r})),r=_.compact(r)},Creator.getSystemBaseFields=function(){return["created","created_by","modified","modified_by"]},Creator.getFieldsWithoutSystemBase=function(e){return _.difference(e,Creator.getSystemBaseFields())},Creator.getFieldsWithoutOmit=function(e,t){return t=_.map(t,(function(t){var r,o;return(null==(o=(r=_.pick(e,t))[t].autoform)||!o.omit)&&t})),t=_.compact(t)},Creator.getFieldsInFirstLevel=function(e,t){return t=_.map(t,(function(t){return _.indexOf(e,t)>-1&&t})),t=_.compact(t)},Creator.getFieldsForReorder=function(e,t,r){var o,a,n,i,s,c,l,u;for(n=[],i=0,o=_.filter(t,(function(e){return!e.endsWith("_endLine")}));i-1&&(o=e[t].data_type),o):"text"},Meteor.isServer&&(Creator.getAllRelatedObjects=function(e){var t;return t=[],_.each(Creator.Objects,(function(r,o){return _.each(r.fields,(function(r,a){if("master_detail"===r.type&&r.reference_to&&r.reference_to===e)return t.push(o)}))})),Creator.getObject(e).enable_files&&t.push("cms_files"),t}),Meteor.isServer&&(Steedos.formatIndex=function(e){var t,r,o,a,n,i;return o={background:!0},(r=(null!=(a=Meteor.settings)&&null!=(n=a.datasources)&&null!=(i=n.default)?i.documentDB:void 0)||!1)&&e.length>0&&(t=e.join("."),o.name=t,t.length>52&&(o.name=t.substring(0,52))),o})},lib:{"apps.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Creator.appsByName={}},"object_recent.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};this.ObjectRecent={},ObjectRecent.insert=function(e,t,r){return Meteor.call("object_recent_viewed",e,t,Session.get("spaceId"),(function(){if(r&&_.isFunction(r))return r()}))}},"filters_transform.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},r;this.FiltersTransform={},r=function(e){return["date","datetime","time","currency","number"].includes(e)?"between":["text","textarea","html"].includes(e)?"contains":"="},FiltersTransform.queryToFilters=function(e){var t,o,a,n;if(e)return n=e.query,a=e.object_name,o=Creator.getObject(a).fields,t=[],_.each(n,(function(e,a){var n,i;if(o[a]){if(i=Creator.getFieldDataType(o,a),["date","datetime","time","currency","number"].includes(i))return t.push({field:a,operation:r(i),start_value:e,value:[e,null]});if(!["text","textarea","html"].includes(i))return["boolean"].includes(i)?t.push({field:a,operation:"=",value:e}):t.push({field:a,operation:r(i),value:e});if(_.isString(e))return t.push({field:a,operation:r(i),value:e});if(_.isArray(e))return t.push({field:a,operation:"=",value:e})}else if(a=a.replace(/(_endLine)$/,""),i=Creator.getFieldDataType(o,a),o[a]&&["date","datetime","time","currency","number"].includes(i))return(n=_.find(t,(function(e){return e.field===a})))?(n.end_value=e,n.value[1]=e):t.push({field:a,operation:r(i),end_value:e,value:[null,e]})})),t}},"form_manager.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},r,o;this.FormManager={},SimpleSchema.messages({formValidate:"[value]"}),FormManager.getRelatedInitialValues=(o=this,function(e,t,r){var o,a,n,i,s;if(!_.isString(t))throw new Meteor.Error("main_record_id must be String");return o={},i="",Creator.getRelatedList(e,t).forEach((function(e){if(r===e.object_name)return i=e.related_field_name})),a="company_id",(s=Creator.getObject(r))&&i&&s.fields[i]&&s.fields[i].reference_to_field&&(a=a+","+s.fields[i].reference_to_field),(n=Creator.odata.get(e,t,a))&&i&&n[s.fields[i].reference_to_field]&&(t=n[s.fields[i].reference_to_field]),o={},i&&("objects"===e?o[i]=Creator.getObjectRecord().name:(s=Creator.getObject(r),_.isString(s.fields[i].reference_to)?s.fields[i].multiple?o[i]=[t]:o[i]=t:o[i]={o:e,ids:[t]})),!_.has(o,"company_id")&&(null!=n?n.company_id:void 0)&&(o.company_id=n.company_id),o=Object.assign({},o,FormManager.getInitialValues(r,o))}),FormManager.getInitialValues=function(e,t){var r,o,a;return o=null!=(r=Creator.getObject(e))&&null!=(a=r.form)?a.initialValues:void 0,_.isFunction(o)?o.apply({doc:t||{}}):{}},FormManager.validate=function(e,t){var r,o,a,n,i,s;if(a=null!=(o=Creator.getObject(e))&&null!=(n=o.form)?n.validate:void 0,_.isFunction(a))try{if(s=a.apply({},[null!=(i=AutoForm.getFormValues(t))?i.insertDoc:void 0]),_.isBoolean(s)&&!1===s)return!1;if(!_.isEmpty(s)&&_.isObject(s))return _.each(s,(function(e,r){return AutoForm.addStickyValidationError(t,r,"formValidate",e),toastr.error(e)})),!1}catch(c){return r=c,console.error(r),toastr.error(r.message),!1}return!0},FormManager.onSubmit=function(e,t){var r,o,a,n,i;return o=null!=(r=Creator.getObject(e))&&null!=(n=r.form)?n.onSubmit:void 0,!(_.isFunction(o)&&(a=o.apply({},[null!=(i=AutoForm.getFormValues(t))?i.insertDoc:void 0]),!_.isEmpty(a)&&_.isObject(a)))||(_.each(a,(function(e,r){return AutoForm.addStickyValidationError(t,r,"formValidate",e),toastr.error(e)})),!1)},r=function(e,t,r){var o,a,n;return o={userId:Meteor.userId(),spaceId:Session.get("spaceId"),object_name:e},_.has(r,"previousDoc")&&(o.previousDoc=r.previousDoc),t.endsWith("Delete")?(o.id=r._id,o.doc=Creator.odata.get(e,r._id),t.startsWith("error")&&(o.error=r.error)):t.startsWith("after")?(o.id=null!=(a=r.dbDoc)?a._id:void 0,o.doc=r.dbDoc):t.startsWith("before")?(t.endsWith("Insert")||(o.id=r._id),t.endsWith("Update")?o.doc=null!=(n=r.doc)?n.$set:void 0:o.doc=r.doc):t.startsWith("error")&&(o.id=r._id,o.doc=r.doc,o.error=r.error),o},FormManager.getPreviousDoc=function(e,t,r){var o,a,n,i,s;if(("update"===r||"delete"===r)&&(o="after",a="after"+r.charAt(0).toLocaleUpperCase()+_.rest(r.split("")).join(""),i=null!=(n=Creator.getObject(e))&&null!=(s=n.form)?s[a]:void 0,_.isFunction(i)))return Creator.odata.get(e,t)},FormManager.runHook=function(e,t,o,a){var n,i,s,c,l,u,d,p;if(l=""+o+t.charAt(0).toLocaleUpperCase()+_.rest(t.split("")).join(""),"view"===t||"edit"===t)return FormManager.runViewEditHook(e,l,a.schema,a.record,a.doc);if(s=a.formId,d=null!=(u=Creator.getObject(e))&&null!=(p=u.form)?p[l]:void 0,_.isFunction(d))try{if(n=r(e,l,a),c=d.apply(n),_.isBoolean(c)&&!1===c)return!1;if(s&&"before"===o&&!_.isEmpty(c)&&_.isObject(c))return _.each(c,(function(e,t){return AutoForm.addStickyValidationError(s,t,"formValidate",e),toastr.error(e)})),!1}catch(f){return i=f,console.error(i),toastr.error(i.message),!1}return!0},FormManager.runViewEditHook=function(e,t,r,o,a){var n,i,s,c,l,u,d;if(l=null!=(u=Creator.getObject(e))&&null!=(d=u.form)?d[t]:void 0,_.isFunction(l)&&(s=r.get(),c={id:(i=a||o.get())._id,userId:Meteor.userId(),spaceId:Session.get("spaceId"),object_name:e,doc:i,schema:s},!1!==(n=l.apply(c))))return r.set(s),o.set(i)}},"grid_export.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},r,o;this.ObjectGrid={},this.GridExport={},r={equals:"=",notEqual:"!=",contains:"contains",notContains:"notcontains",startsWith:"startswith",endsWith:"=",lessThan:"<",lessThanOrEqual:"<=",greaterThan:">",greaterThanOrEqual:">=",empty:"empty"},o=function(e){var t;return t=[],_.forEach(e,(function(e,o){var a;return"between"===e.type?"number"===e.filterType?t.push([o,"between",[e.numberFrom,e.numberTo]]):e.filter?t.push([o,e.type,e.filter]):t.push([o,"between",[e.dateFrom,e.dateTo]]):_.isEmpty(e.filter)?e.operator?(a=[],e.condition1&&a.push([o,r[e.condition1.type],e.condition1.filter]),a.push(e.operator.toLocaleLowerCase()),e.condition2&&a.push([o,r[e.condition2.type],e.condition2.filter]),t.push(a)):void 0:(a=[o,r[e.type],e.filter],t.push(a))})),t},ObjectGrid.getFilters=function(e,t,r,a,n){var i,s,c,l,u,d;return s=Steedos.Page.Listview.getDefaultName(e,t),l=window.gridRefs&&window.gridRefs[s]&&window.gridRefs[s].current?window.gridRefs[s].current:window.gridRef.current,u=[],i=Creator.getListViewFilters(e,t,r,a,n),d=o(l.api.getFilterModel()),c=_.compact([].concat(i).concat(d))},GridExport.excel=function(e,t,r,a,n,i,s){var c,l,u,d,p,f,m,g,h,v,b,w,S;return u=Steedos.Page.Listview.getDefaultName(e,t),f=window.gridRefs&&window.gridRefs[u]&&window.gridRefs[u].current?window.gridRefs[u].current:window.gridRef.current,v=[],_.each(f.props.columnDefs,(function(e){if(e&&e.field)return v.push(e.field)})),b=[],_.forEach(f.api.getSortModel(),(function(e){return b.push([e.colId,e.sort])})),l=Creator.getListViewFilters(e,t,r,a,n,s),S=o(f.api.getFilterModel()),p=_.compact([].concat(l).concat(S)),c=SteedosFilters.formatFiltersToODataQuery(p),d=r?i+"-"+Creator.getObject(a).label:Creator.getObject(e).label+"-"+(null!=(h=Creator.getListView(e,t))?h.label:void 0),g=[],_.map(b,(function(e){var t;return t="desc"===e[1]?e[0]+" desc":e[0],g.push(t)})),m=g.join(","),d=encodeURIComponent(d),w=r?"/api/record/export/"+a+"?$select="+v.toString()+"&filename="+d:"/api/record/export/"+e+"?$select="+v.toString()+"&filename="+d,b.length>0&&(w=w+"&$orderby="+m),c&&(w=w+"&$filter="+c),Meteor.isCordova?Steedos.cordovaDownload(encodeURI(Steedos.absoluteUrl(w)),d+".xlsx"):window.open(w)}}},client:{"listview.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},r,o,a,n,i;n=function(e,t,r){var o,a,n;return o=null!=t?t.columns:void 0,r&&((null!=t?t.mobile_columns:void 0)?o=t.mobile_columns:(null!=(n=Creator.getObjectFirstListView(e))?n.mobile_columns:void 0)?o=n.mobile_columns:o&&(o=Creator.pickObjectMobileColumns(e,o))),o||(a=Creator.getObjectFirstListViewColumns(e,r))&&(o=a),o},o=function(e,t,r){var o,a,i,s,c,l;return s=(c=Creator.getObject(e)).NAME_FIELD_KEY,"organizations"===c.name&&(s="name"),o=[s],(i=Creator.getCollection("object_listviews").findOne(t))?o=n(e,i,r):c.list_views&&(l=c.list_views[t],o=n(e,l,r)),o=o.map((function(e){var t,r;return t=_.isObject(e)?e.field:e,(null!=(r=c.fields[t])?r.type:void 0)?t:void 0})),Creator.isCommonSpace(Session.get("spaceId"))&&o.indexOf("space")<0&&o.push("space"),"cms_files"===e&&o.push("parent"),o=_.compact(o),a=Creator.getObjectFieldsName(e),_.intersection(o,a)},i=function(e,t,r,o){var a;return r?(a=Creator.getObject(e).fields,o&&(t=t.filter((function(e){var t,o;return"master_detail"!==(null!=(o=a[e])?o.type:void 0)||(!!a[e].multiple||(a[e].reference_to?(t=a[e].reference_to,_.isFunction(t)&&(t=t())):t=a[e].optionsFunction({}).getProperty("value"),!!_.isArray(t)||t!==r))}))),t):t},r=function(e,t){var r,o;return o=Creator.getObject(e).fields,r=[],_.each(t,(function(e){var t;if(null!=(t=o[e])?t.depend_on:void 0)return r=_.union(o[e].depend_on)})),r},a=function(e,t,r){var o,a;return a=_.intersection(["owner","company_id","company_ids","locked"],_.keys(e.fields)),!r&&e.enable_tree&&(a.push("parent"),a.push("children")),(o=Creator.getObjectDefaultExtraColumns(e.name))&&(a=_.union(a,o)),a},Creator.unionSelectColumnsWithExtraAndDepandOn=function(e,t,o,n){var i,s;return i=t.name,s=a(t,o,n),e=_.union(e,s),e=_.union(e,r(i,e))},Creator.getListViewFilters=function(e,t,r,o,a,n){var i,s,c,l,u,d,p,f,m,g;if(!e)return null;if(c=Creator.getObject(e),r)l=Creator.getODataRelatedFilter(e,o,a,t,n);else{if(d=Session.get("filter_logic"),p=Session.get("filter_scope"),u=Session.get("filter_items"),s=c.fields,u&&u.length>0&&window.lodash.isArray(u[0]))return l=u,(g=Creator.getStandardQuery(e,Session.get("standard_query")))&&g.length&&(l=l?[l,"and",g]:g),(m=Session.get("grid_sidebar_filters"))&&m.length&&(l=l?[l,"and",m]:m),l||(l=null),l;i=[],_.forEach(u,(function(t){var r,o,a,n,c,l,u,d,p,f,m;if(void 0!==t.value)if(r=s[null!=t?t.field:void 0],o=Creator.getFieldDataType(s,null!=t?t.field:void 0),["text","textarea","html","code"].includes(o)){if(_.isString(t.value)&&(m=t.value.trim().split(" "),l=[],m.forEach((function(e){return e=encodeURIComponent(Creator.convertSpecialCharacter(e)),l.push([t.field,t.operation,e])})),l.length>0))return c=!1,["<>","notcontains"].includes(t.operation)&&(c=!1),i.push(Creator.formatFiltersToDev(l,e,{is_logic_or:c}))}else{if(!["lookup","master_detail"].includes(o))return i.push(t);if(a=null!=r?r.reference_to:void 0,_.isFunction(a)&&(a=a()),!_.isArray(a))return i.push(t);if((null!=(u=t.value)?u.ids:void 0)&&i.push({field:t.field+".ids",operation:t.operation,value:null!=(d=t.value)?d.ids:void 0}),null!=(p=t.value)?p.o:void 0)return n=Creator.getObject(null!=(f=t.value)?f.o:void 0),i.push({field:t.field+".o",operation:t.operation,value:n._collection_name})}})),i.length>0&&(f={filter_logic:d,filter_scope:p,filters:i}),l=Creator.getODataFilter(t,e,f),(g=Creator.getStandardQuery(e,Session.get("standard_query")))&&g.length&&(l=l?[l,"and",g]:g),r||(m=Session.get("grid_sidebar_filters"))&&m.length&&(l=l?[l,"and",m]:m)}return l||(l=null),l},Creator.getODataEndpointUrl=function(e,t,r,o){var a,n;return r?(a=Creator.formatObjectName(o),n=Creator.getListViewIsRecent(e,t)?"/api/v4/"+a+"/recent":"/api/v4/"+a):(a=Creator.formatObjectName(e),n=Creator.getListViewIsRecent(e,t)?"/api/v4/"+a+"/recent":"/api/v4/"+a),Steedos.absoluteUrl(n)},Creator.getListviewColumns=function(e,t,r,a,n,s){var c,l;return c=e.name,l=Tracker.nonreactive((function(){return o(c,a,s)})),n&&n.customRelatedListObject&&(n.columns&&(l=n.columns),s&&n.mobile_columns&&(l=n.mobile_columns),l&&(l=l.map((function(e){return _.isObject(e)?e.field:_.isString(e)?e:void 0})),l=_.uniq(_.compact(l)))),l=i(c,l,t,r)}},views:{"_helpers.coffee":function e(){var r=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Creator.helpers={object_name:function(){return Session.get("object_name")},object:function(){return Creator.getObject(Session.get("object_name"))},object_listviews:function(){return Creator.getObject("object_listviews")},objectLabel:function(e){return Creator.getObject(e).label},getOperationLabel:function(e){switch(e){case"=":return t("creator_filter_operation_equal");case"<>":return t("creator_filter_operation_unequal");case"<":return t("creator_filter_operation_less_than");case">":return t("creator_filter_operation_greater_than");case"<=":return t("creator_filter_operation_less_or_equal");case">=":return t("creator_filter_operation_greater_or_equal");case"contains":return t("creator_filter_operation_contains");case"notcontains":return t("creator_filter_operation_does_not_contain");case"startswith":return t("creator_filter_operation_starts_with");case"between":return t("creator_filter_operation_between")}},isMobile:function(){return Steedos.isMobile()}}},"template.page_template.js":function e(){Template.__checkName("page_template"),Template.page_template=new Template("Template.page_template",(function(){var e=this;return HTML.Raw('
')}))},"page_template.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Template.page_template.onRendered((function(){var e,t;return t=this,e=Session.get("app_id"),this.containerList=[],this.autorun((function(){var r;if(r=Steedos.Page.App.render(t,Session.get("pageApiName"),e))return t.containerList.push(r)}))})),Template.page_template.onDestroyed((function(){return _.each(this.containerList,(function(e){if(e)return ReactDOM.unmountComponentAtNode(e)}))}))},"template.page_object.js":function e(){Template.__checkName("page_object"),Template.page_object=new Template("Template.page_object",(function(){var e=this;return HTML.Raw('
')}))},"page_object.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Template.page_object.onRendered((function(){var e;return e=this,Steedos.Page.Object.Template.onRendered.apply(this)})),Template.page_object.onDestroyed((function(){var e;return e=this,Steedos.Page.Object.Template.onDestroyed.apply(this)}))},"template.page_record_view.js":function e(){Template.__checkName("page_record_view"),Template.page_record_view=new Template("Template.page_record_view",(function(){var e=this;return HTML.Raw('
')}))},"page_record_view.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Template.page_record_view.onRendered((function(){var e,t,r;return r=this,e=Session.get("object_name"),t=Session.get("record_id"),this.containerList=[],this.pageName=null,this.autorun((function(){var o,a,n,i,s,c,l,u,d,p;if(d=!0,(l=r.data.regions()).objectName!==(null!=(i=this.lastRegions)?i.objectName:void 0)&&(d=!1),this.lastRegions=l,d&&r.pageName)try{if(SteedosUI.refs[r.pageName])return(p={objectName:e}).recordId=Tracker.nonreactive((function(){return Session.get("record_id")})),n=(null!=(s=SteedosUI.refs[r.pageName])&&null!=(c=s.__$schema)?c.data:void 0)||{},SteedosUI.refs[r.pageName].updateProps({data:window._.defaultsDeep(p,n)})}catch(f){a=f,console.error(r.pageName+": "+a)}if(!d&&r.pageName&&SteedosUI.refs[r.pageName])try{SteedosUI.refs[r.pageName].unmount()}catch(f){a=f,console.error(r.pageName+": "+a)}if(r.data.regions&&(l=Tracker.nonreactive(r.data.regions),this.lastRegions=l,l&&l.page&&l.page.schema&&(u=l.page.schema,_.isString(u)&&(u=JSON.parse(u)),r.pageName=u.name)),e=Tracker.nonreactive((function(){return Session.get("object_name")})),t=Tracker.nonreactive((function(){return Session.get("record_id")})),o=Steedos.Page.Record.render(r,e,t))return r.containerList.push(o)}))})),Template.page_record_view.onDestroyed((function(){var e;try{SteedosUI.refs[this.pageName].unmount()}catch(t){e=t,console.error(this.pageName+": "+e)}return _.each(this.containerList,(function(e){if(e)return ReactDOM.unmountComponentAtNode(e)}))}))},"template.page_list_view.js":function e(){Template.__checkName("page_list_view"),Template.page_list_view=new Template("Template.page_list_view",(function(){var e=this;return HTML.Raw('
')}))},"page_list_view.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Template.page_list_view.onRendered((function(){var e,t;return t=this,e=Session.get("object_name"),this.containerList=[],this.pageName=null,this.autorun((function(){var r,o,a,n;if(t.pageName)try{SteedosUI.refs[t.pageName].unmount()}catch(i){o=i,console.error(t.pageName+": "+o)}if(t.data.regions&&(a=t.data.regions())&&a.page&&a.page.schema&&(n=a.page.schema,_.isString(n)&&(n=JSON.parse(n)),t.pageName=n.name),r=Steedos.Page.Listview.render(t,e))return t.containerList.push(r)}))})),Template.page_list_view.onDestroyed((function(){var e;try{SteedosUI.refs[this.pageName].unmount()}catch(t){e=t,console.error(this.pageName+": "+e)}return _.each(this.containerList,(function(e){if(e)return ReactDOM.unmountComponentAtNode(e)}))}))},"template.page_related_list_view.js":function e(){Template.__checkName("page_related_list_view"),Template.page_related_list_view=new Template("Template.page_related_list_view",(function(){var e=this;return HTML.Raw('')}))},"page_related_list_view.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Template.page_related_list_view.onRendered((function(){var e,t,r;return r=this,e=Session.get("object_name"),t=Session.get("record_id"),this.containerList=[],this.pageName=null,this.autorun((function(){var o,a,n,i;if(r.pageName)try{SteedosUI.refs[r.pageName].unmount()}catch(s){a=s,console.error(r.pageName+": "+a)}if(r.data.regions&&(n=r.data.regions())&&n.page&&n.page.schema&&(i=n.page.schema,_.isString(i)&&(i=JSON.parse(i)),r.pageName=i.name),o=Steedos.Page.RelatedListview.render(r,e,t))return r.containerList.push(o)}))})),Template.page_related_list_view.onDestroyed((function(){var e;try{SteedosUI.refs[this.pageName].unmount()}catch(t){e=t,console.error(this.pageName+": "+e)}return _.each(this.containerList,(function(e){if(e)return ReactDOM.unmountComponentAtNode(e)}))}))},"template.app_home.js":function e(){Template.__checkName("creator_app_home"),Template.creator_app_home=new Template("Template.creator_app_home",(function(){var e=this;return""}))},"app_home.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},r;r=function(e){var t,r,o,a,n;return(null!=(t=Creator.getApp(e))?t.isExternalUrl:void 0)?/^http(s?):\/\//.test(t.path)?t.blank?window.open(t.path):window.location.href=t.path:FlowRouter.go(t.path):(a=Creator.getAppMenus(e),(r=_.first(a))?"url"===(o=Object.assign({},r,{target:!1})).type&&o.is_use_iframe?FlowRouter.go(o.path):(n=Creator.getAppMenuUrl(o),FlowRouter.go(n)):FlowRouter.go("/app/"+e))},Template.creator_app_home.onRendered((function(){return this.autorun((function(){var e,t,o;if(o=Creator.bootstrapLoaded.get(),_.has(FlowRouter.current().params,"app_id")){if(e=Session.get("app_id"),o&&e)return r(e)}else if(t=Steedos.getFirstApp(),o&&t)return r(t.code||t.id)}))}))},"template.app_iframe.js":function e(){Template.__checkName("creator_app_iframe"),Template.creator_app_iframe=new Template("Template.creator_app_iframe",(function(){var e=this;return Blaze.If((function(){return Spacebars.call(e.lookup("subsReady"))}),(function(){return["\n\t\t",HTML.IFRAME({id:"app_iframe",src:function(){return Spacebars.mustache(e.lookup("url"))},style:"width: 100%; height: 100%;"}),"\n\t"]}))}))},"app_iframe.coffee":function module(){__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};var share=__coffeescriptShare;Template.creator_app_iframe.helpers({subsReady:function(){return Steedos.subsBootstrap.ready()},url:function(){var e,t;return t=Session.get("app_id"),(e=Creator.getApp(t))&&!e.on_click&&e.url?Creator.getUrlWithToken(e.url,e):""}}),Template.creator_app_iframe.events,Template.creator_app_iframe.onCreated((function(){})),Template.creator_app_iframe.onRendered((function(){var app,app_id,e,evalFunString,iframe;if(Steedos.forbidNodeContextmenu(window,"#app_iframe"),app_id=Session.get("app_id"),app=Creator.getApp(app_id),iframe=$("#app_iframe"),app&&app.on_click){evalFunString="(function(){"+app.on_click+"})()";try{return eval(evalFunString)}catch(error){return e=error,console.error("catch some error when eval the on_click script for app link:"),console.error(e.message+"\r\n"+e.stack)}}})),Template.creator_app_iframe.onDestroyed((function(){}))},"template.page_iframe.js":function e(){Template.__checkName("page_iframe"),Template.page_iframe=new Template("Template.page_iframe",(function(){var e=this;return HTML.IFRAME({name:"pageIframe",src:function(){return Spacebars.mustache(e.lookup("url"))},style:function(){return Spacebars.mustache(e.lookup("style"))},class:function(){return Spacebars.mustache(e.lookup("className"))}})}))},"page_iframe.js":function e(){var t=function(e){const{data:t}=e;"nav.click"===t.type&&FlowRouter.current().params.tab_id==t.data.id&&$("[name='pageIframe']").attr("src",$("[name='pageIframe']").attr("src"))};Template.page_iframe.helpers({url:()=>{if(Template.instance().data.regions){var e,t=Template.instance().data.regions().queryParams.url;return t.startsWith("https:/")&&!t.startsWith("https://")&&(t=t.replace("https:/","https://")),t.startsWith("http:/")&&!t.startsWith("http://")&&(t=t.replace("http:/","http://")),!Meteor.isCordova||t.startsWith("http:")||t.startsWith("!https:")||(t=Meteor.absoluteUrl(t)),t}},className:()=>{if(Template.instance().data.regions)return(regions=Template.instance().data.regions()).queryParams.className||""},style:()=>Template.instance().data.regions&&(regions=Template.instance().data.regions()).queryParams.style||"width: 100%; height: 100%;"}),Template.page_iframe.onCreated((function(){window.addEventListener("message",t)})),Template.page_iframe.onDestroyed((function(){window.removeEventListener("message",t)})),Template.page_iframe.onRendered((function(){window.Steedos.setDocumentTitle({pageName:null,tabName:null})}))},"template.initiate_approval.js":function e(){Template.__checkName("initiate_approval"),Template.initiate_approval=new Template("Template.initiate_approval",(function(){var e=this;return HTML.DIV({class:"modal fade creator-modal",id:"initiate_approval"},"\n\t\t",HTML.DIV({class:"modal-dialog slds-modal slds-fade-in-open"},"\n\t\t\t",HTML.DIV({class:"slds-modal__container"},"\n\t\t\t\t",HTML.HEADER({class:"slds-modal__header"},"\n\t\t\t\t\t",HTML.DIV({"data-dismiss":"modal"},"\n\t\t\t\t\t\t",Blaze._TemplateWith((function(){return{className:Spacebars.call("slds-modal__close slds-button__icon"),iconSize:Spacebars.call("large"),inverse:Spacebars.call(!0),iconCategory:Spacebars.call("utility"),iconName:Spacebars.call("close"),title:Spacebars.call(Spacebars.dataMustache(e.lookup("_"),"close")),variant:Spacebars.call("icon")}}),(function(){return Spacebars.include(e.lookupTemplate("steedos_button"))})),"\n\t\t\t\t\t"),"\n\t\t\t\t\t",HTML.Raw('

\n\t\t\t\t\t\t选择流程发起审批\n\t\t\t\t\t

'),"\n\t\t\t\t"),"\n\n\t\t\t\t",HTML.DIV({class:"slds-modal__content slds-p-around_medium",style:"font-size: 17px;"},"\n\t\t\t\t\t",Blaze.Each((function(){return Spacebars.call(e.lookup("flows"))}),(function(){return["\n\t\t\t\t\t",HTML.DIV({class:"weui_cells_weui_cells_access"},"\n\t\t\t\t\t\t",HTML.A({class:"weui_cell","data-flow":function(){return Spacebars.mustache(e.lookup("flow_id"))}},"\n\t\t\t\t\t\t\t",HTML.I({class:"ion ion-ios-compose-outline"}),HTML.CharRef({html:" ",str:" "}),HTML.CharRef({html:" ",str:" "}),Blaze.View("lookup:flow_name",(function(){return Spacebars.mustache(e.lookup("flow_name"))})),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t"),"\n\t\t\t\t\t"]})),"\n\n\t\t\t\t"),"\n\n\t\t\t"),"\n\t\t"),"\n\t")}))},"initiate_approval.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Template.initiate_approval.helpers({flows:function(){return _.where(Creator.object_workflows,{object_name:this.object_name,can_add:!0})}}),Template.initiate_approval.events({"click .weui_cell":function(e,t){var r,o,a,n,i,s,c;o=e.currentTarget.dataset.flow,a=t.data.object_name,n=t.data.record_id,i=[{o:a,ids:[n]}],(s={}).methodOverride="POST",s["X-User-Id"]=Meteor.userId(),s["X-Auth-Token"]=Accounts._storedLoginToken(),c=Steedos.absoluteUrl()+"api/object/workflow/drafts?"+$.param(s),r={Instances:[{flow:o,applicant:Meteor.userId(),space:Session.get("spaceId"),record_ids:i}]},r=JSON.stringify(r),$(document.body).addClass("loading"),$.ajax({url:c,type:"POST",async:!0,data:r,dataType:"json",processData:!1,contentType:"application/json",success:function(e,r){var o;$(document.body).removeClass("loading"),e.errors?e.errors.forEach((function(e){toastr.error(e.errorMessage)})):(o=e.inserts[0],Steedos.openWindow(Steedos.absoluteUrl("/app/"+FlowRouter.current().params.app_id+"/instances/view/"+o._id+"?display="+FlowRouter.current().queryParams.display+"&side_object=instances&side_listview_id=draft")),Modal.hide(t),SteedosUI.reloadRecord(a,n),FlowRouter.reload())},error:function(e,t,r){$(document.body).removeClass("loading"),toastr.error(t)}})}})},"template.amis_action.js":function e(){Template.__checkName("amis_action"),Template.amis_action=new Template("Template.amis_action",(function(){var e=this;return HTML.LI({class:function(){return["steedos-amis-button steedos-button-",Spacebars.mustache(e.lookup("objectName")),"-",Spacebars.mustache(e.lookup("name"))," ",Spacebars.mustache(e.lookup("buttonClassName"))]}})}))},"amis_action.js":function e(){const t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location;(e=e||"")&&"#"===e[0]?e=t.pathname+t.search+e:e&&"?"===e[0]&&(e=t.pathname+e);const r=e.indexOf("?"),o=e.indexOf("#");let a=~r?e.substring(0,r):~o?e.substring(0,o):e,n=~r?e.substring(r,~o?o:void 0):"",i=~o?e.substring(o):t.hash;if(a){if("/"!=a[0]&&!/^https?\:\/\//.test(a)){let e;const r=t.pathname.split("/");let o;for(r.pop();o=/^\.\.?\//.exec(a);)"../"===o[0]&&r.pop(),a=a.substring(o[0].length);a=r.concat(a).join("/")}}else a=t.pathname;return a+n+i},r=()=>({theme:"antd",getModalContainer:e=>{let t=document.querySelector("#amisModalContainer");return t||((t=document.createElement("div")).className="amis-scope",t.style.height="0px",t.id="amisModalContainer",document.body.appendChild(t)),t},notify:(e,t)=>{var r,o;(null===(r=t.props)||void 0===r?void 0:r.schema.tpl)?SteedosUI.message[e](null===(o=t.props)||void 0===o?void 0:o.schema.tpl):"string"==typeof t?SteedosUI.message[e](t):console.warn("notify",e,t)},confirm:e=>new Promise((t,r)=>SteedosUI.Modal.confirm({title:e,onOk:()=>{t(!0)},okText:"确认",cancelText:"取消"})),jumpTo:(e,r)=>{if("goBack"===e)return window.history.back();e=t(e),r&&"url"===r.actionType?!1===r.blank?FlowRouter.go(e):window.open(e):r&&e&&r.target?window.open(e,r.target):/^https?:\/\//.test(e)?window.location.replace(e):FlowRouter.go(e)},requestAdaptor:e=>(e.url&&!/^http[s]?:\/\//i.test(e.url)?(Meteor.isCordova&&(e.url=Meteor.absoluteUrl(e.url)),e.headers||(e.headers={}),!e.headers.Authorization&&Builder.settings.context&&Builder.settings.context.tenantId&&Builder.settings.context.authToken&&(e.headers.Authorization="Bearer ".concat(Builder.settings.context.tenantId,",").concat(Builder.settings.context.authToken))):e.url&&Meteor.isCordova&&Builder.settings.context&&Builder.settings.context.rootUrl&&e.url.startsWith(Builder.settings.context.rootUrl)&&Meteor.isCordova&&(e.headers||(e.headers={}),!e.headers.Authorization&&Builder.settings.context&&Builder.settings.context.tenantId&&Builder.settings.context.authToken&&(e.headers.Authorization="Bearer ".concat(Builder.settings.context.tenantId,",").concat(Builder.settings.context.authToken))),console.log("env.requestAdaptor=action==",e),e)});Template.amis_action.helpers({objectName:()=>{var e=Template.instance().data;return e.button.object||e.button.object_name},name:()=>{var e;return Template.instance().data.button.name},buttonClassName:()=>{var e;return Template.instance().data.buttonClassName}}),Template.amis_action.onRendered(()=>{var e=Template.instance().data,t=e.button,o=e.buttonClassName,a=e.inMore,n=e.data,i=e.env,s=".steedos-button-"+(t.object||e.button.object_name)+"-"+t.name;const c=()=>{var e=Creator.USER_CONTEXT?Creator.USER_CONTEXT.user.language:null;return e?e="cn"===(e="zh"===(e="en"===(e=e.replace("_","-"))?"en-US":e)?"zh-CN":e)?"zh-CN":e:"zh-CN"};Promise.all([waitForThing(window,"amis")]).then(()=>{var e=amisRequire("amis/embed"),o=t.amis_schema?_.isString(t.amis_schema)?JSON.parse(t.amis_schema):t.amis_schema:{type:"service",bodyClassName:"p-0",body:[{type:"button",label:t.label}],regions:["body"]};const a=__meteor_runtime_config__.ROOT_URL,l=lodash.defaultsDeep({},{data:n},{data:{app_id:n.appId,object_name:n.objectName,record_id:n.recordId,formFactor:Steedos.isMobile()?"SMALL":"LARGE",context:{rootUrl:Meteor.isCordova?a.endsWith("/")?a.substr(0,a.length-1):a:"",tenantId:Creator.USER_CONTEXT.spaceId,userId:Creator.USER_CONTEXT.userId,authToken:Creator.USER_CONTEXT.user.authToken,user:Creator.USER_CONTEXT.user},global:{userId:Creator.USER_CONTEXT.userId,spaceId:Creator.USER_CONTEXT.spaceId,user:Creator.USER_CONTEXT.user,now:new Date},scopeId:o.name||o.id,$scopeId:o.name||o.id}});return o=lodash.defaultsDeep(l,o),e.embed(s,o,{locale:c()},Object.assign(r(),i))})})}},layout:{"template.layout.js":function e(){Template.__checkName("creatorLayout"),Template.creatorLayout=new Template("Template.creatorLayout",(function(){var e=this;return Blaze.If((function(){return Spacebars.call(e.lookup("isloading"))}),(function(){return"\n\t"}),(function(){return["\n\t\t",HTML.DIV({class:"steedos skin-blue-light creator h-full flex flex-col relative overflow-hidden"},"\n\t\t\t\n\n\t\t\t",HTML.HEADER({id:"header",class:"steedos-global-header-root flex-none"}),"\n\n\t\t\t\t\n\t\t\t",HTML.DIV({id:"main",class:function(){return["creator-content-wrapper ",Blaze.If((function(){return Spacebars.call(e.lookup("split"))}),(function(){return"split"}))]}},"\n\n\n\n\t\t\t\t",HTML.Comment(' {{#if split}}\n\t\t\t\t\t
\n\t\t\t\t\t\t{{> Template.dynamic template="creatorSidebar"}}\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t{{> Template.dynamic template=main}}\n\t\t\t\t\t
\n\t\t\t\t{{else}} '),"\n\t\t\t\t\t",Blaze._TemplateWith((function(){return{template:Spacebars.call(e.lookup("main"))}}),(function(){return Spacebars.include((function(){return Spacebars.call(Template.__dynamic)}))})),"\n\t\t\t\t",HTML.Comment(" {{/if}} "),"\n\t\t\t"),"\n\t\t\t",HTML.FOOTER({id:"footer",class:"steedos-global-footer-root flex-none"}),"\n\t\t"),"\n",HTML.Comment(' \n\t\t
\n\t\t\t{{> status}}\n\t\t
'),"\n\t\t"]}))}))},"layout.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},r,o;Template.creatorLayout.helpers(Creator.helpers),Template.creatorLayout.helpers({isloading:function(){return Creator.isloading()},collection:function(){return Session.get("action_collection")},fields:function(){return Session.get("action_fields")},collectionName:function(){return Session.get("action_collection_name")},doc:function(){return Session.get("action_record_id")},saveAndInsert:function(){var e,t,r,o;return!!(e=Session.get("action_save_and_insert"))&&(r=(t=Session.get("action_collection")).replace(/Creator.Collections./,""),null!=(o=Creator.getPermissions(r))?o.allowCreate:void 0)},split:function(){var e,t,r;return!(!(e=Creator.getApp())||"admin"!==e._id)&&(r=/\/app\/\w+\/search\//,t=Session.get("router-path"),!r.test(t))},object_name:function(){return Session.get("object_name")},recordId:function(){return Session.get("recordId")},title:function(){return"编辑"},triggerLabel:function(){return"编辑"},onAddFinish:function(){return function(e){var t,r,o,a,n;return a=e[0],n="/app/"+(t=Session.get("app_id"))+"/"+(r=Session.get("object_name"))+"/view/"+(o=a._id),FlowRouter.go(n),!0}},onEditFinish:function(){return function(){return setTimeout((function(){return FlowRouter.reload()}),1),!0}}}),Template.creatorLayout.onRendered((function(){var e;return e=Session.get("pageApiName")||Session.get("object_name")||Session.get("tab_name"),this.autorun((function(){return Steedos.Page.Header.render(Session.get("app_id"),e)})),this.autorun((function(){return Steedos.Page.Footer.render(Session.get("app_id"),e)})),this.autorun((function(){var e,t;if(t=Session.get("pageApiName")||Session.get("object_name")||Session.get("tab_name"),window.SteedosUI&&(e=SteedosUI.refs.globalHeader))return Meteor.setTimeout((function(){var t;try{return e.updateProps({location:FlowRouter.current()},(function(){return console.log("amisScope.updateProps callback.......")}))}catch(r){t=r}}),100)})),this.autorun((function(){var e,t;if(t=Session.get("pageApiName")||Session.get("object_name")||Session.get("tab_name"),window.SteedosUI&&(e=SteedosUI.refs.globalFooter))return Meteor.setTimeout((function(){var t;try{return e.updateProps({location:FlowRouter.current()},(function(){return console.log("amisScope.updateProps callback.......")}))}catch(r){t=r}}),100)}))})),r=function(){var e;return"calendar"===(null!=(e=Creator.getListView(Session.get("object_name",Session.get("list_view_id"))))?e.type:void 0)},AutoForm.hooks({creatorAddForm:{onSuccess:function(e,t){var o,a,n,i;if($("#afModal").modal("hide"),"/app/:app_id/:object_name/calendar/"!==FlowRouter._current.route.path&&!r())return"post"===t.type?(i="/app/"+(o=Session.get("app_id"))+"/"+(a=t.object_name)+"/view/"+(n=t._id),FlowRouter.go(i)):void 0}}},!1),AutoForm.hooks({creatorEditForm:{onSuccess:function(e,t){var o,a,n,i,s,c;if($("#afModal").modal("hide"),!r())return"post"===t.type&&(c="/app/"+(o=Session.get("app_id"))+"/"+(a=t.object_name)+"/view/"+(s=t._id),FlowRouter.go(c)),this.docId&&t.object_name?(i=Creator.getObjectUrl(t.object_name,this.docId),n=Creator.getObjectRecordName(this.updateDoc.$set,t.object_name),Creator.updateTempNavLabel(t.object_name,i,n)):void 0}}},!1),AutoForm.hooks({creatorCellEditForm:{onSuccess:function(e,t){var r,o;if($("#afModal").modal("hide"),this.docId&&t.object_name)return o=Creator.getObjectUrl(t.object_name,this.docId),r=Creator.getObjectRecordName(this.updateDoc.$set,t.object_name),Creator.updateTempNavLabel(t.object_name,o,r)}}},!1),o=function(e,t){return FlowRouter.current().route.path.endsWith("/:record_id")?FlowRouter.reload():window.refreshGrid()},AutoForm.hooks({creatorAddRelatedForm:{onSuccess:o}},!1)},"template.loading.js":function e(){Template.__checkName("creatorLoading"),Template.creatorLoading=new Template("Template.creatorLoading",(function(){var e=this;return HTML.Raw('
\n
\n Loading\n
\n
\n
\n
')}))},"template.empty_layout.js":function e(){Template.__checkName("empty_layout"),Template.empty_layout=new Template("Template.empty_layout",(function(){var e=this;return Blaze._TemplateWith((function(){return{template:Spacebars.call(e.lookup("main"))}}),(function(){return Spacebars.include((function(){return Spacebars.call(Template.__dynamic)}))}))}))}},mobile:{"template.admin.js":function e(){Template.__checkName("adminMenu"),Template.adminMenu=new Template("Template.adminMenu",(function(){var e=this;return HTML.DIV({class:"admin-menu mobile-template-container",id:"admin_menu"},"\n\n ",HTML.DIV({class:"admin-menu-content mobile-template-content"},"\n\t\t\t",HTML.DIV({class:"weui-panel weui-panel_access user-info"},"\n\t\t\t\t",HTML.A({class:"weui-media-box weui-media-box_appmsg"},"\n\t\t\t\t\t",HTML.DIV({class:"weui-media-box__hd",style:function(){return["background: url(",Spacebars.mustache(e.lookup("avatarURL")),")"]}},"\n\t\t\t\t\t\t",HTML.Raw('\x3c!-- --\x3e'),"\n\t\t\t\t\t"),"\n\t\t\t\t\t",HTML.DIV({class:"weui-media-box__bd"},"\n\t\t\t\t\t\t",HTML.H4({class:"weui-media-box__title"},Blaze.View("lookup:name",(function(){return Spacebars.mustache(e.lookup("name"))}))),"\n\t\t\t\t\t\t",HTML.P({class:"weui-media-box__desc"},"\n\t\t\t\t\t\t\t",Blaze.View("lookup:_",(function(){return Spacebars.mustache(e.lookup("_"),"Company")})),":",Blaze.View("lookup:spaceName",(function(){return Spacebars.mustache(e.lookup("spaceName"))})),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t"),"\n\t\t\t\t"),"\n\t\t\t"),"\n\n\t\t\t",HTML.DIV({class:"weui-panel"},"\n\t\t\t\t",HTML.DIV({class:"weui-panel__bd"},"\n\t\t\t\t\t",HTML.DIV({class:"weui-media-box weui-media-box_small-appmsg"},"\n\t\t\t\t\t\t",HTML.DIV({class:"weui-cells"},"\n\t\t\t\t\t\t\t",HTML.A({class:"weui-cell weui-cell_access btn-switch-space"},"\n\t\t\t\t\t\t\t\t",HTML.DIV({class:"weui-cell__bd weui-cell_primary"},"\n\t\t\t\t\t\t\t\t\t",HTML.P(Blaze.View("lookup:_",(function(){return Spacebars.mustache(e.lookup("_"),"Switch Company")}))),"\n\t\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t\t\t",HTML.SPAN({class:"space-name"},Blaze.View("lookup:spaceName",(function(){return Spacebars.mustache(e.lookup("spaceName"))}))),"\n\t\t\t\t\t\t\t\t",HTML.Raw(''),"\n\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t"),"\n\n\n\n\t\t\t\t\t",HTML.DIV({class:"weui-media-box weui-media-box_small-appmsg"},"\n\t\t\t\t\t\t",HTML.DIV({class:"weui-cells"},"\n\t\t\t\t\t\t\t",HTML.A({class:"weui-cell weui-cell_access btn-change-password"},"\n\t\t\t\t\t\t\t\t",HTML.DIV({class:"weui-cell__bd weui-cell_primary"},"\n\t\t\t\t\t\t\t\t\t",HTML.P(Blaze.View("lookup:_",(function(){return Spacebars.mustache(e.lookup("_"),"Change Password")}))),"\n\t\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t\t\t",HTML.Raw(''),"\n\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t"),"\n\t\t\t"),"\n\t\t\t"),"\n\n ",HTML.DIV({class:"weui-panel"},"\n\t\t\t\t",HTML.DIV({class:"weui-panel__bd"},"\n\t\t\t\t\t",HTML.DIV({class:"weui-media-box weui-media-box_small-appmsg"},"\n\t\t\t\t\t\t",HTML.DIV({class:"weui-cells"},"\n\t\t\t\t\t\t\t",HTML.A({class:"weui-cell weui-cell_access log-out steedos-logout"},"\n\t\t\t\t\t\t\t\t",HTML.DIV({class:"weui-cell__bd weui-cell_primary"},"\n\t\t\t\t\t\t\t\t\t",HTML.P(Blaze.View("lookup:_",(function(){return Spacebars.mustache(e.lookup("_"),"Logout")}))),"\n\t\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t"),"\n\t\t\t\t"),"\n\t\t\t"),"\n "),"\n ")}))},"admin.coffee":function e(){var r=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Template.adminMenu.helpers({avatarURL:function(e,t,r,o){var a,n;return n=Meteor.userId(),(e=null!=(a=Creator.getCollection("users").findOne({_id:n}))?a.avatar:void 0)?Steedos.absoluteUrl("avatar/"+Meteor.userId()+"?avatar="+e):Creator.getRelativeUrl("/images/default-avatar.png")},name:function(){var e;return null!=(e=Creator.getCollection("users").findOne())?e.name:void 0},logoutUrL:function(){return Creator.getRelativeUrl("/accounts/a/#/logout")},spaceName:function(){var e;return Session.get("spaceId")&&(e=db.spaces.findOne(Session.get("spaceId")))?e.name:t("none_space_selected_title")}}),Template.adminMenu.events({"click .steedos-logout":function(){return Steedos.logout()},"click .admin-menu-back":function(e,t){var r;return r=urlQuery[urlQuery.length-2],urlQuery.pop(),t.$("#admin_menu").animateCss("fadeOutRight",(function(){return Blaze.remove(t.view),r?FlowRouter.go(r):FlowRouter.go("/app")}))},"click .btn-switch-space":function(e,t){return FlowRouter.go("/user_settings/switchspace")},"click .btn-change-password":function(e,t){return Modal.show("reset_password_modal")},"click .btn-change-avatar":function(e,t){return t.$("#mobile-avator-upload").click()},"change #mobile-avator-upload":function(e,r){var o;if(o=e.target.files[0])return $("body").addClass("loading"),db.avatars.insert(o,(function(e,r){return e?(console.error(e),toastr.error(t(e.reason)),$(document.body).removeClass("loading")):setTimeout((function(){return Meteor.call("updateUserAvatar",r._id,(function(e,r){return(null!=r?r.error:void 0)?($(document.body).removeClass("loading"),toastr.error(t(r.message))):$(document.body).removeClass("loading")}))}),3e3)}))}})},"template.switch_space.js":function e(){Template.__checkName("switchSpace"),Template.switchSpace=new Template("Template.switchSpace",(function(){var e=this;return HTML.DIV({class:"switch-space mobile-template-container",id:"switch_space"},"\n\t\t\n\t\t",HTML.DIV({class:"switch-space-content mobile-template-content"},"\n\t\t\t",HTML.DIV({class:"weui-panel"},"\n\t\t\t\t",HTML.DIV({class:"weui-panel__bd"},"\n\t\t\t\t\t",HTML.DIV({class:"weui-media-box weui-media-box_small-appmsg"},"\n\t\t\t\t\t\t",HTML.DIV({class:"weui-cells"},"\n\t\t\t\t\t\t\t",Blaze.Each((function(){return Spacebars.call(e.lookup("spaces"))}),(function(){return["\n\t\t\t\t\t\t\t",HTML.A({class:"weui-cell weui-cell_access switchSpace"},"\n\t\t\t\t\t\t\t\t",HTML.DIV({class:"weui-cell__bd weui-cell_primary"},"\n\t\t\t\t\t\t\t\t\t",HTML.P(Blaze.View("lookup:name",(function(){return Spacebars.mustache(e.lookup("name"))}))),"\n\t\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t\t\t",Blaze.If((function(){return Spacebars.dataMustache(e.lookup("current_space"),e.lookup("_id"))}),(function(){return["\n\t\t\t\t\t\t\t\t\t",HTML.SPAN({class:"weui-icon-success-no-circle"}),"\n\t\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t\t"),"\n\t\t\t\t\t\t\t"]})),"\n\t\t\t\t\t\t"),"\n\t\t\t\t\t"),"\n\t\t\t\t"),"\n\t\t\t"),"\n\t\t"),"\n\t")}))},"switch_space.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};Template.switchSpace.helpers({spaces:function(){return db.spaces.find()},current_space:function(e){return e===Session.get("spaceId")}}),Template.switchSpace.events({"click .switchSpace":function(e,t){return Steedos.setSpaceId(this._id),FlowRouter.go("/app")},"click .switch-space-back":function(e,t){var r;return r=urlQuery[urlQuery.length-2],urlQuery.pop(),t.$("#switch_space").animateCss("fadeOutRight",(function(){return Blaze.remove(t.view),r?FlowRouter.go(r):FlowRouter.go("/app")}))}})}},"core.coffee":function e(){var r=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},o;Creator.Pages={},o=["owner","company_id","company_ids","locked"],Steedos.addPage=function(e,t){if(e)return Creator.Pages[e]=t},Creator.getLayout=function(e){return e||(e=Session.get("app_id")),"steedos"===e?"steedosLayout":"creatorLayout"},Creator.createObject=function(e,t){var r,o;return o=Creator.getObject(e),r="Creator.Collections."+e,Session.set("action_collection",r),Session.set("action_save_and_insert",!0),Session.set("action_collection_name",o.label),Session.set("action_object_name",e),Session.set("action_fields",void 0),Session.set("cmDoc",t),Meteor.defer((function(){return $(".creator-add").click()}))},Meteor.isClient&&(Creator.TabularSelectedIds={},Meteor.autorun((function(){var e,t;if(e=Session.get("list_view_id"),t=Session.get("object_name"))return Creator.TabularSelectedIds[t]=[]})),Creator.remainCheckboxState=function(e){var t,r,o,a,n,i,s;if((t=e.find(".select-all")).length&&(a=(o=null!=(n=t[0])?n.dataset:void 0).objectName,i=Creator.TabularSelectedIds[a]))return(r=e.find(".select-one")).each((function(e,t){var r;return r=i.indexOf(t.dataset.id)>-1,$(t).prop("checked",r)})),(s=i.length)>0&&r.length!==s?t.prop("indeterminate",!0):(t.prop("indeterminate",!1),0===s?t.prop("checked",!1):s===r.length?t.prop("checked",!0):void 0)},Creator.isListViewFilterEditable=function(e){return!e.shared||e.shared&&e.owner===Steedos.userId()},Creator.getODataFilter=function(e,t,r){var o,a,n,i,s,c,l,u,d,p,f,m,g;if(g=Meteor.userId(),m=Session.get("spaceId"),a=Creator.Collections.object_listviews.findOne(e))(l=Creator.isListViewFilterEditable(a))||((o={}).filter_scope=a.filter_scope,o.filters=a.filters);else if(o={},m&&g){if(!(u=Creator.getListView(t,e)))return["_id","=",-1];o.filter_scope=u.filter_scope,o.filters=u.filters}if(Creator.isCloudAdminSpace(m)&&_.include(["users","space_users","spaces"],t)&&delete o.filters,o&&(r?(o.filter_scope&&(r.filter_scope=o.filter_scope),_.isFunction(r.filters)||(null!=(d=r.filters)?d.length:void 0)?(_.isFunction(o.filters)||(null!=(p=o.filters)?p.length:void 0))&&(r.filters=[[r.filters,"and",o.filters]]):r.filters=o.filters):r=o),r||(r={}),n=r.filter_logic,i=r.filter_scope,s=r.filters,f=[],_.isFunction(s)&&(s=s()),a?n?(c=Creator.formatLogicFiltersToDev(s,n),f.length?f.push("and",c):f.push(c)):s&&s.length>0&&(f.length>0&&f.push("and"),(s=Creator.formatFiltersToDev(s,t))&&s.length>0&&(s=[s]),_.each(s,(function(e){return f.push(e)}))):m&&g&&("users"!==t||Creator.isCloudAdminSpace(m)||f.push(["_id","=",g]),s&&(s=Creator.formatFiltersToDev(s,t))&&s.length>0&&(s=[s],f.length>0&&f.push("and"),_.each(s,(function(e){if("spaces"!==t||e.length>0&&"_id"!==e[0])return f.push(e)})))),"mine"===i&&(f.length>0&&f.push("and"),f.push(["owner","=",g])),0!==f.length)return f},Creator.getODataRelatedFilter=function(e,t,r,o,a){var n,i,s,c,l,u,d,p,f,m,g,h,v,b,w,S,C;if(r&&(S=Steedos.spaceId(),C=Meteor.userId(),v=a?[a]:Creator.getRelatedList(e,r),h="",u="",w=[],n=function(e){return w.length>0&&w.push("and"),w.push(e)},_.each(v,(function(e){if(e.object_name===t)return e.filtersFunction?u=e.filtersFunction:h=e.related_field_name})),h||u)){if(h=h.replace(/\./g,"/"),o&&(i=Creator.getListView(t,o))){if(s=i.filter_logic,c=i.filter_scope,l=i.filters,u)return l=u(Creator.odata.get(e,r));s?(d=Creator.formatLogicFiltersToDev(l,s),n(d)):l&&l.length>0&&(l=_.map(l,(function(e){return _.isObject(e)&&!_.isArray(e)?Meteor.isClient&&_.isString(null!=e?e._value:void 0)?[e.field,e.operation,Creator.eval("("+e._value+")")()]:[e.field,e.operation,e.value]:e})),(l=Creator.formatFiltersToDev(l,t))&&l.length>0&&(l=[l]),_.each(l,(function(e){return n(e)})))}if("cfs.files.filerecord"===t&&n(["metadata/space","=",S]),m=Creator.getObject(t),p=t===e&&(null!=m?m.enable_tree:void 0),"cms_files"===t?(n(["parent/o","=",e]),n(["parent/ids","=",r])):"objects"===e?n([h,"=",r]):p||((b=null!=m?m.fields:void 0)&&(g=b[h]),g&&g.reference_to_field&&(f=Creator.odata.get(e,r,g.reference_to_field),"permission_fields"===t&&"object_fields"===e&&n(["object_name","=",f.object]),f&&f[g.reference_to_field]&&(r=f[g.reference_to_field])),!g||"master_detail"!==g.type&&"lookup"!==g.type?g&&"grid"===g.type?(n([h+".o","=",e]),n([h+".ids","=",r])):n([h,"=",r]):_.isFunction(g.reference_to)?_.isArray(g.reference_to())?n([h+".ids","=",r]):n([h,"=",r]):_.isArray(g.reference_to)?n([h+".ids","=",r]):n([h,"=",r])),"mine"===c&&n(["owner","=",C]),0!==w.length)return w}},Creator.getJsReportUrlQuery=function(){var e,t,r;return r="?space_id="+Steedos.getSpaceId(),(t=Tracker.nonreactive((function(){return Session.get("filter_items")})))&&(r+="&user_filters="+(e=encodeURI(JSON.stringify(t)))),r},Creator.getJsReportViewUrl=function(e){var t;return t=Creator.getRelativeUrl("/plugins/jsreport/web/viewer_db/"+e),t+=Creator.getJsReportUrlQuery()},Creator.getJsReportExcelUrl=function(e){var t;return t=Creator.getRelativeUrl("/plugins/jsreport/api/report_db/"+e+"/excel"),t+=Creator.getJsReportUrlQuery()},Creator.getJsReportPdfUrl=function(e){var t;return t=Creator.getRelativeUrl("/plugins/jsreport/api/report_db/"+e+"/pdf"),t+=Creator.getJsReportUrlQuery()},Creator.getStimulsoftReportViewUrl=function(e){var t;return t=Creator.getRelativeUrl("/plugins/stimulsoft/web/viewer_db/"+e),t+=Creator.getJsReportUrlQuery()},Creator.getStimulsoftReportDesignerUrl=function(e){var t;return t=Creator.getRelativeUrl("/plugins/stimulsoft/web/designer_db/"+e),t+=Creator.getJsReportUrlQuery()},Creator.objectOdataSelectFields=function(e){var t,r;return t=e.fields,r=(r=_.keys(t)).filter((function(e){return e.indexOf(".")<0})),e&&["default","meteor"].indexOf(e.database_name||"default")>-1&&(r=_.union(r.concat(o))),r.join(",")},Creator.objectOdataExpandFields=function(e,t){var r,o;return r=[],o=e.fields,t||(t=_.keys(o)),_.each(t,(function(e){var t,a,n;if(("master_detail"===(null!=(a=o[e])?a.type:void 0)||"lookup"===(null!=(n=o[e])?n.type:void 0))&&(o[e].reference_to?(t=o[e].reference_to,_.isFunction(t)&&(t=t())):_.isFunction(o[e].optionsFunction)&&(t=o[e].optionsFunction({}).getProperty("value")),_.isArray(t)||(t=[t]),t=_.map(t,(function(e){var t,r;return t=(null!=(r=Creator.getObject(e))?r.NAME_FIELD_KEY:void 0)||"name"})),t=_.compact(t),(t=(t=_.uniq(t)).join(","))&&e.indexOf("$")<0))return e.indexOf(".")<0?r.push(e):r.push(e.replace(".","/"))})),r.join(",")},Creator.relatedObjectFileUploadHandler=function(e,r){var o,a,n,i,s,c,l,u,d,p;for(u=null!=(o=e.currentTarget.dataset)?o.parent:void 0,s=e.currentTarget.files,c=0,d=Session.get("record_id"),l=Session.get("object_name"),p=Session.get("spaceId");c0&&(t=!0),!t})),t},Creator.pushCurrentPathToUrlQuery=function(){var e;if((e=FlowRouter.current().path)!==urlQuery[urlQuery.length-1])return urlQuery.push(e)},Creator.getStandardQuery=function(e,t){var r,o,a,n,i,s;if(o=Creator.getObject(e).fields,t&&t.query&&_.size(t.query)&&t.object_name===e)return a=t.object_name,i=t.query,s=[],t.is_mini?_.each(i,(function(e,t){var r,n,i,c;if(o[t])if(r=Creator.getFieldDataType(o,t),["currency","number"].includes(r)){if(!_.isString(e))return s.push([t,"=",e]);if(c=e.trim().split(" "),n=[],c.forEach((function(e){var r,o;try{if(o=Number(e),_.isNumber(o)&&!_.isNaN(o))return n.push([t,"=",o])}catch(a){return r=a,console.error(r)}})),n.length>0)return s.push(Creator.formatFiltersToDev(n,a,{is_logic_or:!1}))}else if(["text","textarea","html","select","autonumber","url","email"].includes(r))if(_.isString(e)){if(c=e.trim().split(" "),i=[],c.forEach((function(e){return e=encodeURIComponent(Creator.convertSpecialCharacter(e)),"select"===r&&o[t].multiple?i.push([t,"=",e]):i.push([t,"contains",e])})),i.length>0)return s.push(Creator.formatFiltersToDev(i,a,{is_logic_or:!1}))}else if(_.isArray(e))return s.push([t,"=",e])})):_.each(i,(function(e,t){var r,n,i,c,l,u;if(o[t]){if(n=Creator.getFieldDataType(o,t),["date","datetime","time","currency","number"].includes(n))return s.push([t,">=",e]);if(["text","textarea","html"].includes(n)){if(_.isString(e)){if(u=e.trim().split(" "),l=[],u.forEach((function(e){return e=encodeURIComponent(Creator.convertSpecialCharacter(e)),l.push([t,"contains",e])})),l.length>0)return s.push(Creator.formatFiltersToDev(l,a,{is_logic_or:!1}))}else if(_.isArray(e))return s.push([t,"=",e])}else{if(["boolean"].includes(n))return s.push([t,"=",JSON.parse(e)]);if(!["lookup","master_detail"].includes(n))return s.push([t,"=",e]);if(i=null!=(r=o[t])?r.reference_to:void 0,_.isFunction(i)&&(i=i()),!_.isArray(i))return s.push([t,"=",e]);if((null!=e?e.ids:void 0)&&s.push({field:t+".ids",operation:"=",value:null!=e?e.ids:void 0}),null!=e?e.o:void 0)return c=Creator.getObject(null!=e?e.o:void 0),s.push({field:t+".o",operation:"=",value:c._collection_name})}}else if(t=t.replace(/(_endLine)$/,""),n=Creator.getFieldDataType(o,t),o[t]&&["date","datetime","time","currency","number"].includes(n))return s.push([t,"<=",e])})),n={is_logic_or:r=!!t.is_mini},Creator.formatFiltersToDev(s,a,n);delete Session.keys.standard_query},Creator.getSafeObjectUrl=function(e,t,r){var o;return _.isString(e)?(o="users"===e?Creator.getObject("space_users"):Creator.getObject(e)).permissions.get().allowRead?Creator.getObjectUrl(e,t,r):void 0:""},Creator.formatFileSize=function(e){var t,r;return r="KB",(t=e/1024)>1024&&(t/=1024,r="MB"),t>1024&&(t/=1024,r="GB"),t.toFixed(2)+r},Creator.getTableCellData=function(e){var r,o,a,n,i,s,c,l,u,d,p,f,m,g,h,v,b,w,S,C,y,j,T,R;if(d=[],R=e.val,g=e.object_name,y=(j=Creator.getObject(g)).NAME_FIELD_KEY,"organizations"===g&&(y="name"),o=e.field){if(a=o.type,"formula"===o.type)a=o.data_type;else if("select"===o.type&&o.data_type&&"text"!==o.data_type)a=o.data_type;else if("summary"===o.type)if("count"===o.summary_type)a="number";else{if(!(C=Creator.getObject(o.summary_object)))throw new Meteor.Error(500,"The summary_object '"+o.summary_object+"' is not found for the field '"+o.name+"'");if(!(S=C.fields[o.summary_field]))throw new Meteor.Error(500,"The summary_field '"+o.summary_field+"' is not found for the field '"+o.name+"'");"formula"!==(a=S.type)&&"summary"!==a||(a=S.data_type),_.isNumber(o.scale)||(r=function(e){var t,o;return _.isNumber(e.scale)?e.scale:"summary"===e.type&&(o=Creator.getObject(e.summary_object))?(t=o.fields[e.summary_field])?r(t):null:void 0},o.scale=r(S))}return v=null!=(h=e.field)?h.reference_to:void 0,_.isFunction(v)&&(v=v()),"grid"===a?d.push({isTable:!0}):"location"===a?d.push({value:(null!=R?R.address:void 0)||"",id:e._id}):"lookup"!==a&&"master_detail"!==a||_.isEmpty(R)?"image"===a?"string"==typeof R?d.push({value:R,id:e._id,isImage:!0,baseUrl:Creator.getRelativeUrl("/api/files/images")}):d.push({value:R,id:e._id,isImages:!0,baseUrl:Creator.getRelativeUrl("/api/files/images")}):"avatar"===a?"string"==typeof R?d.push({value:R,id:e._id,isImage:!0,baseUrl:Creator.getRelativeUrl("/api/files/avatars")}):d.push({value:R,id:e._id,isImages:!0,baseUrl:Creator.getRelativeUrl("/api/files/avatars")}):"code"===a?(R=R?"...":"",d.push({value:R,id:e._id})):"password"===a?(R=R?"******":"",d.push({value:R,id:e._id})):"url"===a?((null!=(f=R)?f.startsWith("http"):void 0)||(f=Steedos.absoluteUrl(encodeURI(f))),d.push({value:R,href:f,id:e._id,isUrl:!0})):"email"===a?d.push({value:R,href:f,id:e._id,isEmail:!0}):"boolean"===a||"toggle"===a?(R=e.val?t("YES"):t("NO"),d.push({value:R,checked:e.val,id:e._id,isBoolean:!0})):"select"===a?(s=o.allOptions||o.options,u=e.doc||{},c=e.record_val,_.isFunction(o.options)&&(s=o.options(c||u)),_.isFunction(o.optionsFunction)&&(s=o.optionsFunction(c||u)),w=e.val,_.isArray(w)||(w=[w]),m=[],_.each(s,(function(e){if(_.indexOf(w,e.value)>-1)return m.push({label:e.label,value:e.value})})),R=(R=m.map((function(e){return e.label}))).join(","),d.push({value:R,items:m,id:e._id,isSelects:!0})):(R&&["datetime","date","time"].indexOf(a)>=0?"odata"===e.agreement?"datetime"===a?"string"==typeof e.val&&/\d+Z$/.test(e.val)?R=moment(e.val).format("YYYY-MM-DD H:mm"):(T=moment().utcOffset()/60,R=moment(e.val).add(T,"hours").format("YYYY-MM-DD H:mm")):"date"===a&&(R="string"==typeof e.val&&/\d+Z$/.test(e.val)?moment.utc(e.val).format("YYYY-MM-DD"):moment(e.val).format("YYYY-MM-DD")):"datetime"===a?R=moment(e.val).format("YYYY-MM-DD H:mm"):"date"===a?R=moment.utc(e.val).format("YYYY-MM-DD"):"time"===a&&(R=moment.utc(e.val).format("HH:mm")):null===e.val?R="":"lookup"===a?_.isFunction(o.optionsFunction)&&(u=e.doc||{},(l=R)&&(_.isArray(l)||(l=[l]),(b=_.filter(o.optionsFunction(u),(function(e){return l.indexOf(e.value)>-1})))&&(R=b.getProperty("label")))):"filesize"===a?R=Creator.formatFileSize(R):["number","currency","percent"].indexOf(a)>-1&&_.isNumber(R)?(p=0,p=_.isNumber(o.scale)?o.scale:"currency"===a?2:0,"percent"===a&&(R*=100),R=Steedos.numberToString(R,p),"percent"===a&&(R+="%")):"markdown"===a?_.isEmpty(R)||(R=Spacebars.SafeString(marked(R))):"html"===a?_.isEmpty(R)||(R=Spacebars.SafeString(R)):"textarea"===a&&R&&(R=(R=R.replace(/\n/g,"\n
")).replace(/ /g," ")),"record_details"!==e.parent_view&&e.field_name===y&&(f=Creator.getObjectUrl(e.object_name,e._id)),d.push({value:R,href:f,id:e._id,type:a})):_.isFunction(o.optionsFunction)&&"company"!==v?(u=e.doc||{},c=e.record_val,(l=R)&&(l=_.isArray(l)?l.map((function(e){return _.isObject(e)?e._id:e})):_.isObject(l)?[l._id]:[l],i=o.optionsFunction(c||u),(b=_.filter(i,(function(e){return l.indexOf(null!=e?e.value:void 0)>-1})))&&(R&&_.isArray(R)&&_.isArray(b)&&(b=Creator.getOrderlySetByIds(b,R,"value")),R=b.getProperty("label"))),v?"objects"===v?_.each(b,(function(t){var r,o,a;return a=t.label,(null!=(r=Creator.getObject(t.value))?r._id:void 0)?(o=Creator.getSafeObjectUrl(v,r._id),d.push({reference_to:v,rid:a,value:a,id:e._id,href:o})):d.push({value:R,id:e._id})})):(n=e.val,_.isArray(n)||(n=n?[n]:[]),_.each(n,(function(t){var r,o,a;return _.isString(t)?(b=_.filter(i,(function(e){return t===(null!=e?e.value:void 0)})),d.push({value:b.getProperty("label"),id:e._id})):(v=t["reference_to._o"]||v,o=t._id,a=t._NAME_FIELD_VALUE,r=Creator.getSafeObjectUrl(v,o),d.push({reference_to:v,rid:o,value:a,href:r,id:e._id}))}))):d.push({value:R,id:e._id})):(_.isArray(R)||(R=R?[R]:[]),_.each(R,(function(t){var r,o,a;if(t)return v=t["reference_to._o"]||v,o=t._id,a=t._NAME_FIELD_VALUE,_.isString(t)&&(o=t,a=t),r=Creator.getSafeObjectUrl(v,o),d.push({reference_to:v,rid:o,value:a,href:r,id:e._id})}))),d}},Creator.openSafeObjectUrl=function(e,t){var r;return Steedos.isMobile()||(r=Creator.getSafeObjectUrl(e,t,"-"))&&window.open(r,"_blank","width=800, height=600, left=50, top= 50, toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes"),"undefined"!=typeof event&&null!==event&&event.stopPropagation(),"undefined"!=typeof event&&null!==event&&event.preventDefault(),!1},Creator.getAppLabel=function(e){return e||(e=Creator.getApp()),e?e.label?t(e.label):t(e.name):""},Creator.measureWidth=_.memoize((function(e,t,r){var o,a,n,i;return(o=arguments.callee.canvas)||(o=document.createElement("canvas"),(n=document.createDocumentFragment()).appendChild(o),arguments.callee.canvas=o),(a=o.getContext("2d")).font=t,i=a.measureText(e).width,r&&i>r?r:i})),Creator.showPreviewButton=function(e){var t,r,o,a,n;return!!((null!=(n=null!=(t=Meteor.settings)&&null!=(r=t.public)?r.webservices:void 0)&&null!=(o=n.officeOnline)?o.url:void 0)&&Steedos.isOfficeFile(e)||(null!=n&&null!=(a=n.pdfOnline)?a.url:void 0)&&Steedos.isPdfFile(e))},Creator.officeOnlinePreview=function(e,t){var r,o,a,n,i,s,c,l,u,d,p,f,m,_,g,h;return a=null!=(s=Meteor.settings)&&null!=(c=s.public)&&null!=(l=c.webservices)&&null!=(u=l.officeOnline)?u.url:void 0,i=null!=(d=Meteor.settings)&&null!=(p=d.public)&&null!=(f=p.webservices)&&null!=(m=f.pdfOnline)?m.url:void 0,a&&""!==a||i&&""!==i?(h=Meteor.userId(),_=Steedos.spaceId(),r={authToken:o=Accounts._storedLoginToken()},e=e+"?token="+(g=window.btoa(JSON.stringify(r))),Steedos.isPdfFile(t)?(n=e,i&&""!==i&&(n=i+encodeURIComponent(e)),Steedos.openWindow(n)):(n=a+encodeURIComponent(e),Steedos.openWindow(n))):(toastr.error(TAPi18n.__("creator_office_online_web_url_required")),!1)},Creator.isImageAttachment=function(e){var t,r;return!(e.split(".").length<2)&&(t=e.split(".").pop().toLowerCase(),-1!==(r=["png","jpg","jpeg","bmp","gif","webp","psd","svg","tiff"]).indexOf(t))},Creator.isHtmlAttachment=function(e){var t,r;return!(e.split(".").length<2)&&(t=e.split(".").pop().toLowerCase(),-1!==(r=["html","htm"]).indexOf(t))}),Meteor.startup((function(){return $(document).on("click",(function(e){return $(e.target).closest(".slds-table td").length<1?$(".slds-table").addClass("slds-no-cell-focus"):$(".slds-table").removeClass("slds-no-cell-focus")})),$(window).resize((function(){if($(".list-table-container table.dataTable").length)return $(".list-table-container table.dataTable thead th").each((function(){var e;return e=$(this).outerWidth(),$(".slds-th__action",this).css("width",e+"px")}))})),$(document).keydown((function(e){if("13"===e.keyCode||"Enter"===e.key){if($(".modal").length>1)return;if("TEXTAREA"!==e.target.tagName||$(e.target).closest("div").hasClass("bootstrap-tagsinput")){if("update"===Session.get("cmOperation"))return e.preventDefault(),e.stopPropagation(),$(".creator-auotform-modals .btn-update").click();if("insert"===Session.get("cmOperation"))return e.preventDefault(),e.stopPropagation(),$(".creator-auotform-modals .btn-insert").click()}}}))}))},"colors.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},r,o,a,n,i;n="border-radius: 10px;padding: 1px 6px;display: inline-block;",i=function(e){return 3===(e=e.slice(1)).length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),{r:Number.parseInt(e.slice(0,2),16),g:Number.parseInt(e.slice(2,4),16),b:Number.parseInt(e.slice(4,6),16)}},a=function(e,t,r){var o,a,n,s;return.299*(n=(s=i(e)).r)+.587*(a=s.g)+.114*(o=s.b)>186?r:t},o=function(e,t,r){var o,a,n,s,c,l,u;return(o=.2126*(n=(u=[(c=(l=i(e)).r)/255,(s=l.g)/255,(a=l.b)/255]).map((function(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})))[0]+.7152*n[1]+.0722*n[2])>.179?r:t},r=function(e){var t,r;return r=[],t=e.fields,_.each(t,(function(t,a){var i;if(i=t.options,_.isFunction(i)&&(i=i({})),"select"===t.type&&(null!=i?i.length:void 0))return _.each(i,(function(t){var i,s;if(t.color)return i=t.color,/^#/.test(i)||(i="#"+i),s=o(i,"#fff","#333"),r.push(".creator-cell-color-"+e.name+"-"+a+"-"+t.value+"{"+n+"background:"+i+";color:"+s+";}")}))})),r},Creator.appendObjectFieldsColorStyles=function(){var e,t;return $("#object_fields_color_styles").remove(),t=[],_.each(Creator.Objects,(function(e){return t=_.union(t,r(e))})),t.push(".creator-cell-multiple-color{\n\tmargin-right:1px;\n}\n@media (max-width:767px) {\n\t.creator-cell-multiple-color{\n\t\tmargin-right:4px;\n\t}\n}"),e=$('"),$("head").append(e)}},"temp_navs.coffee":function e(){var r=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},o,a,n,i,s,c,l,u,d,p;s=!1,a=function(){var e;if(e=sessionStorage.getItem("temp_navs"))return e.split(",").map((function(e){var t;return{name:(t=e.split(":"))[0],url:t[1],label:t[2],is_temp:!0}}))},n=function(e,t,r){return sessionStorage.getItem("temp_navs_id")},d=function(e){return sessionStorage.setItem("temp_navs_id",e)},p=function(e){var t,r;return e||(e=[]),t=(r=e.map((function(e){var t;return t=e.name,e.url&&(t+=":"+e.url),e.label&&(t+=":"+e.label),t}))).join(","),sessionStorage.setItem("temp_navs",t)},c=[],o=function(e,t){var r;return r=t||Creator.getObjectUrl(e),c.push(r)},u=function(e,t){var r,o;if(o=t||Creator.getObjectUrl(e),(r=c.indexOf(o))>-1)return c.splice(r,1)},i=function(e,t){var r,o,a,n,i,s;for(r=t||Creator.getObjectUrl(e),o=2,s=6,i=!1;!i&&o<8&&!((a=urlQuery.length-o)<0);)n=urlQuery[a],__meteor_runtime_config__.ROOT_URL_PATH_PREFIX+n!==r?(i=n&&c.indexOf(__meteor_runtime_config__.ROOT_URL_PATH_PREFIX+n)<0,o++):o++;return i?n:null},l=function(e,t,r,a){var n,s,c,l,u,d,p,f,m;return n=Session.get("object_name"),s=Session.get("record_id"),t?(l=(c=Creator.getObjectUrl(n,s))===t)||(l=FlowRouter.current().path===t):l=n===e,l?(d=i(e,t),o(e,t),d?(FlowRouter.go(d),urlQuery.pop(),urlQuery.pop()):((f=r[a])||(f=r[a-1]),f?(m=f.url?f.url:Creator.getObjectUrl(f.name),FlowRouter.redirect(m)):(u=(p=Creator.getAppMenus())[p.length-1],FlowRouter.redirect(u.path)))):o(e,t)},Creator.getTempNavs=function(){var e;return(e=Session.get("temp_navs"))||(e=a())&&Session.set("temp_navs",e),e},Creator.getTempNavsId=function(){var e;return(e=Session.get("temp_navs_id"))||(e=n())&&Session.set("temp_navs_id",e),e},Creator.createTempNav=function(e,t,r){var o,a;if(t||!(["users","cms_files","cfs.files.filerecord"].indexOf(e)>-1))return(a=Creator.getTempNavs())||(a=[]),(o=a.find((function(r){return t?r.name===e&&r.url===t:r.name===e})))?void 0:(a.push({name:e,url:t,label:r,is_temp:!0}),Session.set("temp_navs",a),p(a),u(e,t))},Creator.updateTempNavLabel=function(e,t,r){var o,a;if(t&&r)return(a=Creator.getTempNavs())||(a=[]),(o=a.find((function(r){return r.name===e&&r.url===t})))?(o.label=r,Session.set("temp_navs",a),p(a)):void 0},Creator.removeTempNavItem=function(e,t){var r,o,a;if((a=Session.get("temp_navs"))&&(o=null,r=a.filter((function(r,a){var n;return(n=t?r.name===e&&r.url===t:r.name===e)&&(o=a),!n})),_.isNumber(o)))return s=!0,l(e,t,r,o),Meteor.defer((function(){return Session.set("temp_navs",r),p(r),s=!1})),!0},Creator.resetTempNavsIfNeeded=function(){var e,t,r;if((t=(r=Creator.getTempNavsId())!==(e=Meteor.userId()+":"+Steedos.spaceId()+":"+Session.get("app_id")))&&(Session.set("temp_navs",null),p(null),c.length=0),t||!Session.get("temp_navs_id"))return Session.set("temp_navs_id",e),d(e)},Meteor.startup((function(){if(!Steedos.isMobile())return Tracker.autorun((function(){var e,t;if(Creator.bootstrapLoaded.get()&&(t=Session.get("spaceId"),e=Session.get("app_id"),t&&e))return Creator.resetTempNavsIfNeeded()})),Tracker.autorun((function(e){var r,o,a,n,i,c,l,u,d,p,f,m,g,h,v;if(u=Session.get("object_name"),h=Session.get("tab_name"),p=Session.get("record_id"),i=Creator.getAppMenus(),u&&i&&i.length&&(f=Session.get("record_name"),n=_.pluck(i,"id"),o=Session.get("temp_navs_force_create"),(null!=n?n.indexOf(u||h):void 0)<0||o)){if(o&&s)return void Session.set("temp_navs_force_create",!1);if(!(l=Creator.getObject(u)))return;if(p){if(!(d=Creator.getObjectRecord()))return;if(v=Creator.getObjectUrl(u,p),o&&(r=urlQuery[urlQuery.length-3])&&(g=new RegExp(r+"$")).test(v))return void Session.set("temp_navs_force_create",!1);a=f||("cfs.files.filerecord"===u?t("cfs_files_filerecord__object")+"-"+(null!=d&&null!=(m=d.original)?m.name:void 0):d[c=l.NAME_FIELD_KEY||"name"]),Creator.createTempNav(u,v,a)}else Creator.createTempNav(u);if(o)return Session.set("temp_navs_force_create",!1)}}))}))},"router.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{},r,o,a,n;this.urlQuery=new Array,o=function(e,t){var r,o;Meteor.userId()&&(Creator.pushCurrentPathToUrlQuery(),"-"!==(r=e.params.app_id)&&r&&Session.get("app_id")!==r?Session.set("app_id",r):"-"!==r||Session.get("app_id")||(o=Steedos.getFirstApp(),Session.set("app_id",o.id)))},n=function(e,t){var r,o,a,n;if(o=Tracker.nonreactive((function(){return Session.get("object_name")})),a=Tracker.nonreactive((function(){return Session.get("record_id")})),r=e.params.object_name,n=e.params.record_id,Session.set("object_name",r),Session.set("tab_name",null),Session.set("pageApiName",null),Session.set("record_id",n),Session.set("record_name",null),n&&(o&&o!==r||a&&n!==a))return Session.set("temp_navs_force_create",!0)},r=function(e,t){var r;if("admin"===(r=e.params.app_id)&&Steedos.isMobile())return t("/user_settings"),urlQuery.pop()},FlowRouter.route("/app",{triggersEnter:[o],action:function(e,t){return BlazeLayout.render(Creator.getLayout(),{main:"creator_app_home"})}}),FlowRouter.route("/app/menu",{triggersEnter:[o],action:function(e,t){var r;return r="app_object_menu",Session.set("hidden_header",!0),BlazeLayout.render(Creator.getLayout(),{main:r})},triggersExit:[function(e,t){if(Steedos.isMobile())return Session.set("hidden_header",void 0)}]}),FlowRouter.route("/app/:app_id",{triggersEnter:[o],action:function(e,t){var r,o,a;return"-"!==(o=FlowRouter.getParam("app_id"))&&(Session.set("object_name",null),Session.set("record_id",null),Session.set("app_id",o)),Session.set("admin_template_name",null),a=(r=Creator.getApp(o))&&r.is_use_iframe?"creator_app_iframe":"creator_app_home",BlazeLayout.render(Creator.getLayout(),{main:a})}}),FlowRouter.route("/app/:app_id/page/:page_id",{triggersEnter:[o],action:function(e,t){var r,o;return console.log("params",e),r=FlowRouter.getParam("app_id"),o=null!=e?e.page_id:void 0,Session.set("pageApiName",o),Session.set("object_name",null),BlazeLayout.render(Creator.getLayout(),{main:"page_template",regions:{appId:r,pageId:o}})},triggersExit:[function(e,t){return Session.set("pageApiName",null)}]}),FlowRouter.route("/page/:page_id/",{action:function(e,t){return BlazeLayout.render(Creator.getLayout(),{main:"page"})}}),FlowRouter.route("/app/:app_id/tab_iframe/:tab_id",{triggersEnter:[o],action:function(e,t){var r;return r=FlowRouter.getParam("tab_id"),Session.set("tab_name",r),Session.set("object_name",null),BlazeLayout.render(Creator.getLayout(),{main:"page_iframe",regions:{params:e,queryParams:t}})},triggersExit:[function(e,t){return Session.set("tab_name",null)}]}),(a=FlowRouter.group({prefix:"/app/:app_id/:object_name",name:"objectRoutes",triggersEnter:[o,n]})).route("/",{triggersEnter:[function(e,t){var r,o,a,n,i;return n=e.params.object_name,o=(null!=(a=window.getFirstListView(n))?a.name:void 0)||(null!=a?a._id:void 0),t(i="/app/"+(r=e.params.app_id)+"/"+n+"/grid/"+o)}],action:function(e,t){return BlazeLayout.render(Creator.getLayout(),{main:"object_home"})}}),a.route("/:record_id/:related_object_name/grid",{action:function(e,t){var r,o,a,n,i,s,c,l;return o={app_id:r=Session.get("app_id"),object_name:n=FlowRouter.getParam("object_name"),record_id:s=FlowRouter.getParam("record_id"),related_object_name:l=FlowRouter.getParam("related_object_name")},Session.set("related_object_name",l),a="related_object_list",(i=Steedos.Page.getPage("related_list",r,l))&&(a="page_related_list_view",c={page:i,appId:Session.get("app_id"),objectName:n,recordId:s,relatedObjectName:l,__timestamp:(new Date).getTime()}),Meteor.setTimeout((function(){return BlazeLayout.render(Creator.getLayout(),{main:a,regions:c})}),10)}}),a.route("/view/:record_id",{action:function(e,t){var r,o,a,n,i,s,c;return t["X-Space-Id"]&&Steedos.setSpaceId(t["X-Space-Id"]),o={app_id:r=FlowRouter.getParam("app_id"),object_name:n=FlowRouter.getParam("object_name"),record_id:s=FlowRouter.getParam("record_id")},ObjectRecent.insert(n,s),Session.set("detail_info_visible",!0),a="creator_view",(i=Steedos.Page.getPage("record",Session.get("app_id"),n,s))&&(a="page_object",c=window._.defaultsDeep({display:Steedos.Page.getDisplay(n)},FlowRouter.current().queryParams,{page:i,appId:Session.get("app_id"),recordId:s,objectName:n,pageType:"record",__timestamp:(new Date).getTime()})),Meteor.setTimeout((function(){return BlazeLayout.render(Creator.getLayout(),{main:a,regions:c})}),10)},triggersExit:[function(e,t){var r,o,a,n,i;if(Session.get("instance_change")&&("instances"===(null!=(o=e.params)?o.object_name:void 0)&&"draft"===(null!=(a=e.queryParams)?a.side_listview_id:void 0)||"instance_tasks"===(null!=(n=e.params)?n.object_name:void 0)&&"inbox"===(null!=(i=e.queryParams)?i.side_listview_id:void 0))&&("draft"===(r=WorkflowManager.getInstance()).state||"draft"!==Session.get("box")))return InstanceManager.saveIns(!1)}]}),a.route("/grid/:list_view_id",{action:function(e,t){var r,o,a,n,i;return Session.set("record_id",null),Session.get("object_name")===FlowRouter.getParam("object_name")&&Session.get("list_view_id")===FlowRouter.getParam("list_view_id")||(Session.set("filter_target",null),Session.set("filter_items",null)),Session.get("object_name")!==FlowRouter.getParam("object_name")&&Session.set("list_view_id",null),"true"===(null!=t?t.hidden_header:void 0)&&Session.set("hidden_header",!0),"-"!==(r=FlowRouter.getParam("app_id"))&&Session.set("app_id",r),a=FlowRouter.getParam("object_name"),Session.set("object_name",a),Session.set("list_view_id",FlowRouter.getParam("list_view_id")),Session.set("list_view_visible",!1),Tracker.afterFlush((function(){return Session.set("list_view_visible",!0)})),(n=Steedos.Page.getPage("list",Session.get("app_id"),a))&&(o="page_object",i=window._.defaultsDeep({display:Steedos.Page.getDisplay(a)},FlowRouter.current().queryParams,{page:n,appId:Session.get("app_id"),objectName:a,listViewId:Session.get("list_view_id"),pageType:"list",__timestamp:(new Date).getTime()})),BlazeLayout.render(Creator.getLayout(),{main:o,regions:i})}}),FlowRouter.notFound={action:function(e,t){var r;try{throw new Error("404 not found:"+window.location.href)}catch(o){r=o,console.log(r,window.location.href)}return BlazeLayout.render("empty_layout",{main:"notFound"})}}},"tenant.coffee":function e(){var t=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};$.getJSON("/accounts/settings",(function(e){return(null!=e?e.tenant:void 0)&&Session.set("tenant_settings",e.tenant),Steedos.settings=Object.assign(Steedos.settings,e.settings||{})}))},"animate.js":function e(){$.fn.extend({animateCss:function(e,t){var r=function(e){var t={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(var r in t)if(void 0!==e.style[r])return t[r]}(document.createElement("div"));return this.addClass("animated "+e).one(r,(function(){$(this).removeClass("animated "+e),"function"==typeof t&&t()})),this}})},"colResizable-1.6.js":function e(){!function(e){var t=e(document),r=e("head"),o=null,a={},n=0,i="id",s="px",c="JColResizer",l="JCLRFlex",u=parseInt,d=Math,p=navigator.userAgent.indexOf("Trident/4.0")>0,f;try{f=sessionStorage}catch(T){}r.append("");var m=function(t,o){var s=e(t);if(s.opt=o,s.mode=o.resizeMode,s.dc=s.opt.disabledColumns,s.opt.disable)return _(s);var l=s.id=s.attr(i)||c+n++;s.p=s.opt.postbackSafe,!s.is("table")||a[l]&&!s.opt.partialRefresh&&s.prev(".JCLRgrips").length>0||("col-resize"!==s.opt.hoverCursor&&r.append(""),s.addClass(c).attr(i,l).before('
'),s.g=[],s.c=[],s.w=s.width(),s.gc=s.prev(),s.f=s.opt.fixed,o.marginLeft&&s.gc.css("marginLeft",o.marginLeft),o.marginRight&&s.gc.css("marginRight",o.marginRight),s.cs=u(p?t.cellSpacing||t.currentStyle.borderSpacing:s.css("border-spacing"))||2,s.b=u(p?t.border||t.currentStyle.borderLeftWidth:s.css("border-left-width"))||1,a[l]=s,g(s))},_=function(e){var t=e.attr(i),e;(e=a[t])&&e.is("table")&&(e.removeClass(c+" "+l).gc.remove(),delete a[t])},g=function(t){var r=t.find(">thead>tr:first>th,>thead>tr:first>td");r.length||(r=t.find(">tbody>tr:first>th,>tr:first>th,>tbody>tr:first>td, >tr:first>td")),r=r.filter(":visible"),t.cg=t.find("col"),t.ln=r.length,t.p&&f&&f[t.id]&&h(t,r),r.each((function(r){var o=e(this),a=-1!=t.dc.indexOf(r),n=e(t.gc.append('
')[0].lastChild);n.append(a?"":t.opt.gripInnerHtml).append('
'),r==t.ln-1&&(n.addClass("JCLRLastGrip"),t.f&&n.html("")),n.bind("touchstart mousedown",y),a?n.addClass("JCLRdisabledGrip"):n.removeClass("JCLRdisabledGrip").bind("touchstart mousedown",y),n.t=t,n.i=r,n.c=o,o.w=o.width(),t.g.push(n),t.c.push(o),o.width(o.w).removeAttr("width"),n.data(c,{i:r,t:t.attr(i),last:r==t.ln-1})})),t.cg.removeAttr("width"),t.find("td, th").not(r).not("table th, table td").each((function(){e(this).removeAttr("width")})),t.f||t.removeAttr("width").addClass(l),v(t)},h=function(e,t){var r,o=0,a=0,n=[],i;if(t){if(e.cg.removeAttr("width"),e.opt.flush)return void(f[e.id]="");for(i=(r=f[e.id].split(";"))[e.ln+1],!e.f&&i&&(e.width(i*=1),e.opt.overflow&&(e.css("min-width",i+s),e.w=i));a*{cursor:"+s.opt.dragCursor+"!important}"),l.addClass(s.opt.draggingClass),o=l,s.c[i.i].l)for(var d=0,p;d=1,a=arguments.length>=2;if(!(this instanceof r))return n?a?new r(t,e):new r(t):new r;if(void 0===t){if(n)throw new TypeError("undefined is not a valid argument for URI");t="undefined"!=typeof location?location.href+"":""}return this.href(t),void 0!==e?this.absoluteTo(e):this}r.version="1.17.0";var s=r.prototype,i=Object.prototype.hasOwnProperty;function l(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(t){return void 0===t?"Undefined":String(Object.prototype.toString.call(t)).slice(8,-1)}function u(t){return"Array"===c(t)}function d(t,e){var n={},a,o;if("RegExp"===c(e))n=null;else if(u(e))for(a=0,o=e.length;a]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/},r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.invalid_hostname_characters=/[^a-zA-Z0-9\.-]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(t){if(t&&t.nodeName){var e=t.nodeName.toLowerCase();if("input"!==e||"image"===t.type)return r.domAttributes[e]}},r.encode=b,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=b,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(t,e){var n=r.encode(t+"");return void 0===e&&(e=r.escapeQuerySpace),e?n.replace(/%20/g,"+"):n},r.decodeQuery=function(t,e){t+="",void 0===e&&(e=r.escapeQuerySpace);try{return r.decode(e?t.replace(/\+/g,"%20"):t)}catch(n){return t}};var g={encode:"encode",decode:"decode"},h,w=function(t,e){return function(n){try{return r[e](n+"").replace(r.characters[t][e].expression,(function(n){return r.characters[t][e].map[n]}))}catch(a){return n}}};for(h in g)r[h+"PathSegment"]=w("pathname",g[h]),r[h+"UrnPathSegment"]=w("urnpath",g[h]);var S=function(t,e,n){return function(a){var o;o=n?function(t){return r[e](r[n](t))}:r[e];for(var s=(a+"").split(t),i=0,l=s.length;i-1&&(e.fragment=t.substring(n+1)||null,t=t.substring(0,n)),(n=t.indexOf("?"))>-1&&(e.query=t.substring(n+1)||null,t=t.substring(0,n)),"//"===t.substring(0,2)?(e.protocol=null,t=t.substring(2),t=r.parseAuthority(t,e)):(n=t.indexOf(":"))>-1&&(e.protocol=t.substring(0,n)||null,e.protocol&&!e.protocol.match(r.protocol_expression)?e.protocol=void 0:"//"===t.substring(n+1,n+3)?(t=t.substring(n+3),t=r.parseAuthority(t,e)):(t=t.substring(n+1),e.urn=!0)),e.path=t,e},r.parseHost=function(t,e){var n=(t=t.replace(/\\/g,"/")).indexOf("/"),a,o;if(-1===n&&(n=t.length),"["===t.charAt(0))a=t.indexOf("]"),e.hostname=t.substring(1,a)||null,e.port=t.substring(a+2,n)||null,"/"===e.port&&(e.port=null);else{var r=t.indexOf(":"),s=t.indexOf("/"),i=t.indexOf(":",r+1);-1!==i&&(-1===s||i-1?n:t.length-1),o;return a>-1&&(-1===n||a-1||(null!=t?t.indexOf("{signature.traces."):void 0)>-1||(null!=t?t.indexOf("{yijianlan:"):void 0)>-1||(null!=t?t.indexOf('{"yijianlan":'):void 0)>-1||(null!=t?t.indexOf("{'yijianlan':"):void 0)>-1},InstanceSignText.includesOpinionField=function(t,e){var n,a,o;return a=new Array,n={},(o=(null!=(n=Meteor.isServer?uuflowManager.getFormVersion(db.forms.findOne({_id:t}),e):db.form_versions.findOne({_id:e,form:t}))?n.fields:void 0)||[]).forEach((function(t){var e;return"table"===t.type?console.log("ignore opinion field in table"):"section"===t.type?null!=t&&null!=(e=t.fields)?e.forEach((function(t){return a.push(t.formula)})):void 0:a.push(t.formula)})),_.some(a,(function(t){return InstanceformTemplate.helpers.isOpinionField_from_string(t)}))}},models:{"forms.coffee":function t(){var e=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{}},"flows.coffee":function t(){var e=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{}},"flow_roles.coffee":function t(){var e=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{}},"flow_positions.coffee":function t(){var e=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{}},"instance_tasks.coffee":function t(){var e=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};db.instance_tasks=new Meteor.Collection("instance_tasks"),db.instance_tasks._simpleSchema=new SimpleSchema({instance:{type:String},trace:{type:String},is_finished:{type:String},user:{type:String},user_name:{type:String},handler:{type:String},handler_name:{type:String},handler_organization:{type:String},handler_organization_name:{type:String},handler_organization_fullname:{type:String},start_date:{type:Date},due_date:{type:Date},is_read:{type:Boolean},is_error:{type:Boolean},values:{type:Object},deadline:{type:Date},remind_date:{type:Date},reminded_count:{type:Number},read_date:{type:Date},description:{type:String},modified:{type:Date},modified_by:{type:String},sign_show:{type:Boolean},judge:{type:String},next_steps:{type:Array},"next_steps.$":{type:Object},"next_steps.$.step":{type:String},"next_steps.$.users":{type:[String]},finish_date:{type:Date},cost_time:{type:Number},space:{type:String},instance_name:{type:String},submitter:{type:String},submitter_name:{type:String},applicant:{type:String},applicant_name:{type:String},applicant_organization_name:{type:String},submit_date:{type:Date},flow:{type:String},flow_name:{type:String},form:{type:String},step:{type:String},step_name:{type:String},category_name:{type:String},instance_state:{type:String},distribute_from_instance:{type:String},forward_from_instance:{type:String},keywords:{type:String},is_archived:{type:Boolean},category:{type:String}})},"instances.coffee":function t(){var e=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{}},"categories.coffee":function t(){var e=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{}},"spaces.coffee":function t(){var e=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{}},"deleted_instances.coffee":function t(){var e=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{}},"auth_tokens.coffee":function t(){var e=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};db.auth_tokens=new Meteor.Collection("auth_tokens")},"webhooks.coffee":function t(){var e=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{}},"space_user_signs.coffee":function t(){var e=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{}},"space_users.coffee":function t(){var e=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{}}},cfs:{"instances.coffee":function t(){var e=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{}}},"admin.coffee":function t(){var e=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{}}},client:{"api.js":function t(){Workflow.getInstance=function(){var t=WorkflowManager.getInstance();if(t){if("draft"==t.state){var e=InstanceManager.getInstanceFormApplicant();if(t.applicant!=e){var n=t.space,a=SteedosDataManager.spaceUserRemote.findOne({space:n,user:e},{fields:{organization:1,name:1}}),o=a.organization,r=SteedosDataManager.organizationRemote.findOne(o,{fields:{name:1,fullname:1}});t.applicant=e,t.applicant_name=a.name,t.applicant_organization=o,t.applicant_organization_name=r.name,t.applicant_organization_fullname=r.fullname}}return t}},Workflow.getMyApprove=function(){return InstanceManager.getMyApprove()},Workflow.getInstanceAttachments=function(t,e){return e?cfs.instances.find({"metadata.instance":t}).fetch():cfs.instances.find({"metadata.approve":e}).fetch()}},lib:{"traces_manager.coffee":function t(){var e=__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};TracesManager.getStepLastHandlers=function(t,e){var n,a,o;return n=[],o=_.clone(e.traces),(a=_.filter(o,(function(e){return e.step===t}))).reverse(),_.some(a,(function(t){var e;if(t.is_finished&&((e=(null!=t?t.approves:void 0)||[]).reverse(),e.forEach((function(t){if((null!=t?t.is_finished:void 0)&&"cc"!==(null!=t?t.type:void 0)&&"distribute"!==(null!=t?t.type:void 0)&&["approved","rejected","submitted","readed"].includes(t.judge))return n.push(t.handler)})),n.length>0))return!0})),n},TracesManager.getHandlerSignShowApproves=function(t,e,n){var a,o,r,s,i,l,c,u,d;if(a=InstanceManager.getCurrentApprove())return c=_.clone(t.traces),o=_.find(c,(function(t){return t._id===(null!=a?a.trace:void 0)})),i=[],o&&null!=(l=(u=_.groupBy(c,"step"))[o.step])&&l.forEach((function(t){return i=i.concat(t.approves)})),r=(d=_.groupBy(i,"handler"))[e],s=_.filter(r,(function(t){return n?t.is_finished&&!1!==t.sign_show&&t.description:t.is_finished&&t.description}))},TracesManager.getTracesListData=function(t){var e;return(null!=(e=db.instance_traces.findOne({_id:t._id}))?e.traces:void 0)||t.traces}},"instance_event.js":function module(){function getFlowEvent(t){var e=WorkflowManager.getFlow(t);if(e)return e.events}InstanceEvent={},InstanceEvent.before={},InstanceEvent.initEvents=function(flowId){$(".instance-form").unbind("instance-before-submit"),$(".instance-form").unbind("instance-before-save"),$("#ins_upload_main_attach").unbind("instance-before-upload"),$("#ins_attach_version").unbind("instance-before-upload"),$("#ins_upload_normal_attach").unbind("instance-before-upload"),$("#ins_attach_version").unbind("instance-before-upload"),$(".instance-forward-modal").unbind("onload"),$(".instance-distribute-modal").unbind("onload"),$("body").unbind("after-save");var eventStr=getFlowEvent(flowId);if(eventStr)try{eval(eventStr)}catch(e){toastr.error(TAPi18n.__("flows_events_error")+e),console.error("flow Event Error: "+e)}},InstanceEvent.run=function(t,e,n){var a=WorkflowManager.getInstance(),o;if(!a)return!0;if(!getFlowEvent(a.flow))return!0;n||(n={});var r=jQuery.Event(e,n);return t.trigger(r),!r.isDefaultPrevented()},InstanceEvent.before.instanceSubmit=function(){var t=WorkflowManager.getInstance(),e;if(!t)return!0;if(!getFlowEvent(t.flow))return!0;var n=jQuery.Event("instance-before-submit",{});return $(".instance-form").trigger(n),!n.isDefaultPrevented()}},"1_form_formula.js":function module(){function sum(t){var e=0;if(!t||0==t.length)return e;for(var n=0;n0?t.sort(sortNumber)[count(t)-1]:void 0}function min(t){if(!t||0==t.length)return"";for(var e=0;e0?t.sort(sortNumber)[0]:void 0}function numToRMB(t){if(isNaN(t))return"无效数值!";var e="";if(t<0&&(e="(负)"),(t=Math.abs(t))>=1e12)return"无效数值!";var n="",a="仟佰拾亿仟佰拾万仟佰拾元角分",o="零壹贰叁肆伍陆柒捌玖",r=(t+="00").indexOf(".");r>=0&&(t=t.substring(0,r)+t.substr(r+1,2)),a=a.substr(a.length-t.length);for(var s=0;s0?eval(form_script):console.log("脚本为空, 退出运算程序")}catch(e){console.log("初始化表单脚本出错,错误信息: \n"+e)}},Form_formula.runFormScripts=function(formKey,eventName){try{form_version=WorkflowManager.getInstanceFormVersion(),form_script=form_version.form_script,form_script&&form_script.replace(/\n/g,"").replace(/\s/g,"").length>0?(CoreForm.form_OnLoad instanceof Function&&eval("CoreForm.form_OnLoad();"),CoreForm[formKey]&&CoreForm[formKey][eventName]instanceof Function&&eval("CoreForm."+formKey+"."+eventName+"();")):console.log("脚本为空, 退出运算程序")}catch(e){console.log("初始化表单脚本出错,错误信息: \n"+e)}},Form_formula.prependPrefixForFormula=function(t,e){var n=1*new Date,a=/(\{[^{}]*\})/g;return rev=e.replace(a,(function(e,n){return t+n.replace(/\{\s*/,'["').replace(/\s*\}/,'"]').replace(/\s*\.\s*/g,'"]["')}))},Form_formula.getFormulaFieldVariable=function(t,e){var n=1*new Date;if(e){for(var a=new Array,o=0;o0;){for(c=0;cn.length)for(var a,o=(a=e.split(n)).length-2;o>=0;o--){var r=e.search(n),s=e.charAt(r-1),i=e.charAt(r+n.length);if(null==s.match(/\w/)&&null==i.match(/\w/))return!0}var l="{"+t+".";if(e.length>l.length)for(var a,o=(a=e.split(l)).length-2;o>=0;o--){var r=e.search(l),s;if(null==(s=e.charAt(r-1)).match(/\w/))return!0}}return!1},Form_formula.mixin=function(t,e){for(var n in e)t[n]=e[n];return t},Form_formula.field_values=null,Form_formula.run=function(code,field_prefix,formula_fields,autoFormDoc,fields){var startTrack=1*new Date,run=!1;if(formula_fields&&!(formula_fields.length<1)){Form_formula.field_values,console.debug("消耗时间s0 :"+(1*new Date-startTrack)+"ms"),Form_formula.field_values=Form_formula.init_formula_values(fields,autoFormDoc),console.debug("消耗时间s1 :"+(1*new Date-startTrack)+"ms");for(var i=0;i==/g,">=").replace(/\<==/g,"<=").replace(/\======/g,"===").replace(/\====/g,"=="),conditionStr=Form_formula.prependPrefixForFormula("Form_formula.field_values",conditionStr);try{eval(conditionStr.replace(/[\r\n]+/g,"\\n"))&&next_steps.push(WorkflowManager.getInstanceStep(line.to_step))}catch(err){console.log("脚本["+conditionStr+"]执行异常:"+err.message)}}})),next_steps},Form_formula.runFormulaScript=function(script,fieldValues){Form_formula.field_values=fieldValues;var conditionStr=script.toString();conditionStr=conditionStr.replace(/\=/g,"==").replace(/\>==/g,">=").replace(/\<==/g,"<=").replace(/\======/g,"===").replace(/\====/g,"=="),conditionStr=Form_formula.prependPrefixForFormula("Form_formula.field_values",conditionStr);try{if(eval(conditionStr.replace(/[\r\n]+/g,"\\n")))return!0}catch(err){console.log("脚本["+conditionStr+"]执行异常:"+err.message)}return!1},Form_formula.init_formula_values=function(t,e){var n=Meteor.userId(),a=InstanceManager.getApplicantUserId(),o;return a?o=Formula_data.getInstanceValues(t,e,n,a,Session.get("spaceId")):{}},Array.prototype.getEach=function(t){for(var e=[],n=0;n0){for(var e="0.",n=0;n0&&(r=o.split("\n"));var s="editable"==n.permission?"editable":"readonly",i=n.is_multiselect;"odata"!=n.type&&n.formula&&(s="readonly");var l={};switch(a){case"input":t.type=String,l.disabled="readonly"==s,null!=o&&o.length>0?l.type="typeahead":n.is_textarea?(l.type="coreform-textarea",l.rows=n.rows):l.type="text";break;case"section":t.type=String,l.disabled=!0,l.type="section";break;case"geolocation":t.type=String,l.disabled="readonly"==s,l.type="text";break;case"number":t.type=Number,l.disabled="readonly"==s,l.type="coreform-number",l.step=e(n.digits),n.is_percent&&(l.type="steedos-field",l.fieldType="percent",l.config=JSON.stringify({scale:n.digits||2}));break;case"date":t.type=String,l.disabled="readonly"==s,Steedos.isMobile()||Steedos.isPad()?l.type="date":(l.type="coreform-datepicker",l.outFormat="yyyy-MM-dd",l.dateTimePickerOptions={showClear:!0,format:"YYYY-MM-DD",locale:Session.get("steedos-locale"),widgetPositioning:{}});break;case"dateTime":t.type=Date,l.disabled="readonly"==s,Steedos.isMobile()||Steedos.isPad()?l.type="datetime-local":(l.type="bootstrap-datetimepicker",l.dateTimePickerOptions={showClear:!0,format:"YYYY-MM-DD HH:mm",locale:Session.get("steedos-locale"),keepOpen:!0,widgetPositioning:{}});break;case"checkbox":t.type=Boolean,l.disabled="readonly"==s,l.type="coreform-checkbox";break;case"select":i?(t.type=[String],l.multiple=!0):t.type=String,l.readonly="readonly"==s,l.type="select",l.disabled="readonly"==s;break;case"radio":t.type=[String],l.disabled="readonly"==s,l.type="coreform-radio";break;case"multiSelect":t.type=[String],l.disabled="readonly"==s,l.type="coreform-multiSelect";break;case"user":i?(t.type=[String],l.multiple=!0):t.type=String,l.disabled="readonly"==s,l.type="selectuser";break;case"email":t.type=String,l.type="steedosEmail",l.readonly="readonly"==s,l.disabled="readonly"==s;break;case"url":t.type=String,l.type="steedosUrl",l.readonly="readonly"==s,l.disabled="readonly"==s;break;case"group":i?(t.type=[String],l.multiple=!0):t.type=String,l.disabled="readonly"==s,l.type="selectorg";break;case"odata":i?(t.type=[Object],l.multiple=!0):t.type=Object,t.blackbox=!0,l.type="steedos-selectize",l.readonly="readonly"===s,l.disabled="readonly"===s,l.related_object=n.related_object,l.url=n.url,l.detail_url=n.detail_url,l.filters=n.filters,l.formula=n.formula,l.search_field=n.search_field;break;case"html":t.type=String,l.readonly="readonly"===s,l.disabled="readonly"===s,l.type="steedosHtml";break;case"image":i?(t.type=[String],l.multiple=!0):t.type=String,l.readonly="readonly"==s,l.disabled="readonly"==s,l.type="steedos-field",l.fieldType="image";break;case"file":i?(t.type=[String],l.multiple=!0):t.type=String,l.readonly="readonly"==s,l.disabled="readonly"==s,l.type="steedos-field",l.fieldType="file";break;case"lookup":i?(t.type=[String],l.multiple=!0):t.type=String,l.readonly="readonly"==s,l.disabled="readonly"==s,l.type="steedos-field",l.fieldType="lookup",l.reference_to=n.reference_to,l.reference_to_field=n.reference_to_field,l.filters=n.filters,l.config=n.config;break;case"time":t.type=String,l.readonly="readonly"==s,l.disabled="readonly"==s,l.type="steedos-field",l.fieldType="time";break;default:t.type=String,l.readonly="readonly"==s,l.disabled="readonly"==s,l.type=a}if(null!=r&&r.length>0){for(var c=new Array,u=0;u1?itemSplits[0]:r[u],value:itemSplits.length>1?itemSplits[1]:r[u]});l.options=c}return l},a=function(t,e){var a=e.type,o=e.is_required;return(schema={}).label=t,schema.optional="readonly"==e.permission||!o,"email"==a?schema.regEx=SimpleSchema.RegEx.Email:"url"==a&&(schema.regEx=SimpleSchema.RegEx.Url),schema.autoform=new n(schema,e),0==schema.autoform.disabled&&((!e.default_value||_.isString(e.default_value)&&e.default_value.indexOf("auto_number(")<0)&&(schema.autoform.defaultValue=e.default_value),(InstanceMacro.check(e.default_value)||_.isFunction(e.default_value))&&(schema.autoform.defaultValue=InstanceMacro.run(e.default_value)),e.default_value&&_.isString(e.default_value)&&e.default_value.indexOf("auto_number(")>-1&&(schema.autoform["data-new-number"]=!0,schema.autoform["data-formula"]=e.default_value,schema.autoform.defaultValue="")),"section"===a&&(schema.autoform.description=e.description,schema.autoform.label=e.name),schema.autoform.title=e.description||schema.label,schema};(WorkflowManager_format={}).getTableItemSchema=function(t){var e={};if("table"==t.type){var n=null!=t.name&&t.name.length>0?t.name:t.code;e[t.code]={type:Object,optional:"readonly"==t.permission||!t.is_required,label:n},t.sfields.forEach((function(o){n=null!=o.name&&o.name.length>0?o.name:o.code,(sfields_schema=new a(n,o)).autoform.__formId=t.__formId,e[t.code+"."+o.code]=sfields_schema}))}return console.log("getTableItemSchema fieldSchema",e),e},WorkflowManager_format.getAutoformSchema=function(t){for(var e={},n=t.fields,o=ApproveManager.isReadOnly(),r=0;r0?s.name:s.code;if(o&&(s.permission="readonly"),"table"==s.type){let t=!1,n=s.sfields;if(n)for(let e=0;e0?c.name:c.code,tableField_schema=new a(i,c),e[s.code+".$."+c.code]=tableField_schema}}else e[s.code]=new a(i,s)}return e},WorkflowManager_format.getAutoformSchemaValues=function(){var t=InstanceManager.getCurrentValues();return t||(t={}),t}},"approve_manager.js":function e(n,a,e){let o;e.link("@babel/runtime/helpers/objectSpread2",{default(t){o=t}},0),(ApproveManager={}).error={nextSteps:"",nextStepUsers:""},ApproveManager.isReadOnly=function(){var t=WorkflowManager.getInstance();if(InstanceManager.isCC(t)&&!InstanceManager.ccHasEditPermission())return!0;if(Session.get("instancePrint"))return!0;if(!t)return!0;var e=db.flows.findOne(t.flow);return!e||("completed"==t.state||("draft"!=Session.get("box")||"enabled"!=e.state)&&"inbox"!=Session.get("box"))};var r=function(t,e){return _.contains(t.skip_steps,e._id)};ApproveManager.getNextSteps=function(t,e,n,a,o,s){if(ApproveManager.error.nextSteps="",!e)return;if(!t)return[];var i=new Array,l=e.lines;switch(e.step_type){case"condition":(i=Form_formula.getNextStepsFromCondition(e,a,o)).length||(ApproveManager.error.nextSteps="未能根据条件找到下一步");break;case"end":return i;case"sign":if("approved"==n)l.forEach((function(t){"approved"==t.state&&i.push(WorkflowManager.getInstanceStep(t.to_step))}));else if("rejected"==n){var c;l.forEach((function(t){if("rejected"==t.state){var e=WorkflowManager.getInstanceStep(t.to_step);e&&"condition"!=e.step_type&&i.push(e)}})),(c=t.traces).forEach((function(t){if(1==t.is_finished){var n=WorkflowManager.getInstanceStep(t.step);"condition"!=n.step_type&&e.id!=n.id&&i.push(n)}}));var u,d=(u=WorkflowManager.getInstanceSteps()).findPropertyByPK("step_type","end");i.push(d)}break;default:if("counterSign"===e.step_type&&e.oneClickRejection&&"rejected"===n){var c;l.forEach((function(t){if("rejected"==t.state){var e=WorkflowManager.getInstanceStep(t.to_step);e&&"condition"!=e.step_type&&i.push(e)}})),(c=t.traces).forEach((function(t){if(1==t.is_finished){var n=WorkflowManager.getInstanceStep(t.step);"condition"!=n.step_type&&e.id!=n.id&&i.push(n)}}));var u,d=(u=WorkflowManager.getInstanceSteps()).findPropertyByPK("step_type","end");i.push(d)}else l.forEach((function(t){if("submitted"==t.state){var e=WorkflowManager.getInstanceStep(t.to_step);e&&i.push(e)}}))}i=i.uniqById();var p=new Array;i.forEach((function(e){"condition"==e.step_type&&(n||"sign"!=e.step_type||(n="approved"),p=p.concat(ApproveManager.getNextSteps(t,e,n,a,o,s)))})),i=i.concat(p);var f=new Array;i.forEach((function(i){if("condition"!=i.step_type)if(!s&&r(t,i)){n||"sign"!=i.step_type||(n="approved");let r=ApproveManager.getNextSteps(t,i,n,a,o,s),l=[];for(const t of r)e.id!=t.id&&l.push(t);f=f.concat(l)}else f.push(i)})),f=f.uniqById(),"counterSign"==e.step_type&&f.length>1&&!e.oneClickRejection&&(f=[]);const m={},b={};for(const r of f)ApproveManager.caculateNextStepsByEnterStepCondition(t,r,a,o,m,b);if(!_.isEmpty(m)&&!_.isEmpty(b)){for(const t in b)if(Object.hasOwnProperty.call(b,t)){const e=f.findIndex(e=>e.id==t);-1===e&&f.push(b[t])}for(const t in m)if(Object.hasOwnProperty.call(m,t)){const e=f.findIndex(e=>e.id==t);-1!=e&&f.splice(e,1)}var g=new Array;f.forEach((function(e,r){"condition"==e.step_type&&(n||"sign"!=e.step_type||(n="approved"),g=g.concat(ApproveManager.getNextSteps(t,e,n,a,o,s)),f.splice(r,1))})),f=(f=f.concat(g)).uniqById()}return f},ApproveManager.caculateNextStepsByEnterStepCondition=function(t,e,n,a){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if(!1===e.always_enter_step){const i=e.id,l=ApproveManager.getStepApproveUsers(t,i),c=t.space,u=[];l.forEach(t=>{u.push(Formula_data.getUser(c,t.id))});let d=e.enter_step_condition;const p=Form_formula.init_formula_values(a,n);let f;if(p.step=o({},e,{approvers:u}),!1===Form_formula.runFormulaScript(d,p)){if(r[e.id]=e,e.lines&&e.lines.length>0){const o=e.lines.map((function(t){return t.to_step}));for(const e of o){const o=WorkflowManager.getInstanceStep(e);o&&ApproveManager.caculateNextStepsByEnterStepCondition(t,o,n,a,r,s)}}}else s[e.id]=e}else s[e.id]=e},ApproveManager.getStepApproveUsers=function(e,n){var a=new Array,o=WorkflowManager.getInstanceStep(n);if(o){var r=InstanceManager.getApplicantUserId();switch(o.step_type){case"condition":break;case"start":var s=WorkflowManager.getUser(r);a.push(s);break;default:if(a=[],_.isEmpty(a))switch(o.deal_type){case"pickupAtRuntime":a=[];break;case"specifyUser":var i,l={specifyUserIds:o.approver_users};a=UUflow_api.caculate_nextstep_users("specifyUser",Session.get("spaceId"),l,n);break;case"applicantRole":var c,l={applicantId:r,approveRoleIds:o.approver_roles};(a=UUflow_api.caculate_nextstep_users("applicantRole",Session.get("spaceId"),l,n)).length||console.error("not find step",n,a);break;case"hrRole":var u,l={approveHrRoleIds:o.approver_hr_roles};(a=UUflow_api.caculate_nextstep_users("hrRole",Session.get("spaceId"),l,n)).length||console.error("not find step approve users",n,a);break;case"applicantSuperior":var l={applicantId:r};(a=UUflow_api.caculate_nextstep_users("applicantSuperior",Session.get("spaceId"),l,n))&&0!=a.length||console.error(TAPi18n.__("next_step_users_not_found.aplicant_superior"));break;case"applicant":var l={applicantId:r};a=UUflow_api.caculate_nextstep_users("applicant",Session.get("spaceId"),l,n);break;case"userField":var d=o.approver_user_field,p,f;if(p=InstanceManager.getFormField(d))if(f=InstanceManager.getFormFieldValue(p.code)){var l={userField:p,userFieldValue:f};a=UUflow_api.caculate_nextstep_users("userField",Session.get("spaceId"),l,n)}a.length||console.error("步骤: "+o.name+"fieldId is "+d);break;case"orgField":var m=o.approver_org_field,b=InstanceManager.getFormField(m),g=new Array;if(b){var h=InstanceManager.getFormFieldValue(b.code),w=new Array;if(h)var l={orgField:b,orgFieldValue:h};if(h){var l={orgField:b,orgFieldValue:h};a=(caculateNextstepUsers=UUflow_api.caculateNextstepUsers("orgField",Session.get("spaceId"),l,n)).nextStepUsers,caculateNextstepUsers.error&&console.error("caculateNextstepUsers.error",caculateNextstepUsers.error)}}a.length||(g.length?console.error(t("next_step_users_not_found.org_no_members",b.code)):console.error(t("next_step_users_not_found.field_value_empty")));break;case"specifyOrg":var S=o.approver_orgs,l={specifyOrgIds:S};if(!(a=UUflow_api.caculate_nextstep_users("specifyOrg",Session.get("spaceId"),l,n)).length){var v=WorkflowManager.getOrganizations(S),k=WorkflowManager.getOrganizationsChildrens(e.space,S);console.error(TAPi18n.__("next_step_users_not_found.org_no_members",{step_name:o.name,org_name:v.concat(k).getProperty("fullname").toString()}))}break;case"userFieldRole":var T=o.approver_roles,d=o.approver_user_field,p,f;if(p=InstanceManager.getFormField(d)){if(f=InstanceManager.getFormFieldValue(p.code))var l={userField:p,userFieldValue:f,approverRoleIds:T};if(f){var l={userField:p,userFieldValue:f,approverRoleIds:T};a=(caculateNextstepUsers=UUflow_api.caculateNextstepUsers("userFieldRole",Session.get("spaceId"),l,n)).nextStepUsers,caculateNextstepUsers.error&&console.error("caculateNextstepUsers.error",caculateNextstepUsers.error)}}if(!a.length)if(f){var M=WorkflowManager.getRoles(T);console.error('"'+M.getProperty("name").toString()+'"审批岗位未指定审批人')}else console.error('"'+p.code+'"字段没有值');break;case"orgFieldRole":var T=o.approver_roles,m=o.approver_org_field,b,h;if(b=InstanceManager.getFormField(m)){if(h=InstanceManager.getFormFieldValue(b.code))var l={orgField:b,orgFieldValue:h,approverRoleIds:T};if(h){var l={orgField:b,orgFieldValue:h,approverRoleIds:T};a=(caculateNextstepUsers=UUflow_api.caculateNextstepUsers("orgFieldRole",Session.get("spaceId"),l,n)).nextStepUsers,caculateNextstepUsers.error&&console.error("caculateNextstepUsers.error",caculateNextstepUsers.error)}}if(a<1)if(h){var M=WorkflowManager.getRoles(T);console.error('"'+M.getProperty("name").toString()+'"审批岗位未指定审批人')}else console.error('"'+b.code+'"字段没有值')}}return(a=a.uniqById()).sort((function(t,e){return t.name.localeCompare(e.name)})),a}},ApproveManager.getNextStepUsers=function(e,n,a){ApproveManager.error.nextStepUsers="",ApproveManager.error.type="",ApproveManager.error.code="",InstanceManager._setError_next_step_users("");var o=new Array,r=WorkflowManager.getInstanceStep(n);if(r){if(e.step_approve&&e.step_approve[n]){Session.set("next_step_users_showOrg",!1);var s=e.step_approve[n],i,l;if(_.isArray(s)||(s=[s]),i=InstanceManager.getCurrentApprove())(l=i.next_steps)&&l.length>0&&l[0].step==n&&"start"!=InstanceManager.getCurrentStep().step_type&&(s=_.uniq((l[0].users||[]).concat(s)));return WorkflowManager.getUsers(s)}var c=InstanceManager.getApplicantUserId();Session.set("next_step_users_showOrg",!1);var u="",d=r.name,p={};switch(r.step_type){case"condition":break;case"start":var f=WorkflowManager.getUser(c);o.push(f);break;default:if(o=[],_.isEmpty(o))switch(r.deal_type){case"pickupAtRuntime":var i;if(Session.set("next_step_users_showOrg",!0),!(i=InstanceManager.getCurrentApprove()))break;var l,m=(l=i.next_steps)&&l[0]?l[0].users:[];_.isEmpty(m)||(o=WorkflowManager.getUsers(m));break;case"specifyUser":var b,g={specifyUserIds:r.approver_users};o=UUflow_api.caculate_nextstep_users("specifyUser",Session.get("spaceId"),g,n);break;case"applicantRole":var h=r.approver_roles,g={applicantId:c,approveRoleIds:h};if(!(o=UUflow_api.caculate_nextstep_users("applicantRole",Session.get("spaceId"),g,n)).length){var w=WorkflowManager.remoteFlowRoles.find({_id:{$in:h}},{fields:{name:1}}),S=_.pluck(w,"name").toString();ApproveManager.error.nextStepUsers=TAPi18n.__("next_step_users_not_found.applicant_role",{step_name:r.name,role_name:S})}break;case"hrRole":var v=r.approver_hr_roles,g={approveHrRoleIds:v};if(!(o=UUflow_api.caculate_nextstep_users("hrRole",Session.get("spaceId"),g,n)).length){var w=WorkflowManager.remoteHrRoles.find({_id:{$in:v}},{fields:{name:1}}),k=_.pluck(w,"name").toString();ApproveManager.error.nextStepUsers=TAPi18n.__("next_step_users_not_found.hr_role",{step_name:r.name,role_name:k})}break;case"applicantSuperior":var g={applicantId:c};(o=UUflow_api.caculate_nextstep_users("applicantSuperior",Session.get("spaceId"),g,n))&&0!=o.length||(ApproveManager.error.nextStepUsers=TAPi18n.__("next_step_users_not_found.aplicant_superior"));break;case"applicant":var g={applicantId:c};o=UUflow_api.caculate_nextstep_users("applicant",Session.get("spaceId"),g,n);break;case"userField":var T=r.approver_user_field,M;if(M=InstanceManager.getFormField(T)){var y=null;if(y="relocate"==a?M.is_multiselect?lodash.map(e.values[M.code],"id"):lodash.get(e.values[M.code],"id"):InstanceManager.getFormFieldValue(M.code)){console.log("if ....");var g={userField:M,userFieldValue:y};o=UUflow_api.caculate_nextstep_users("userField",Session.get("spaceId"),g,n)}}o.length||(ApproveManager.error.nextStepUsers='"'+M.code+'"字段没有值',console.error("步骤: "+r.name+"fieldId is "+T));break;case"orgField":var I=r.approver_org_field,x=InstanceManager.getFormField(I),L=new Array;if(x){var H=InstanceManager.getFormFieldValue(x.code),A=new Array;if(H)var g={orgField:x,orgFieldValue:H};if(H){var g={orgField:x,orgFieldValue:H};o=(caculateNextstepUsers=UUflow_api.caculateNextstepUsers("orgField",Session.get("spaceId"),g,n)).nextStepUsers,ApproveManager.error.code=caculateNextstepUsers.error}}o.length||(L.length?ApproveManager.error.nextStepUsers=t("next_step_users_not_found.org_no_members",x.code):ApproveManager.error.nextStepUsers=t("next_step_users_not_found.field_value_empty"));break;case"specifyOrg":var B=r.approver_orgs,g={specifyOrgIds:B};if(!(o=UUflow_api.caculate_nextstep_users("specifyOrg",Session.get("spaceId"),g,n)).length){var V=WorkflowManager.getOrganizations(B),C=WorkflowManager.getOrganizationsChildrens(e.space,B);ApproveManager.error.nextStepUsers=TAPi18n.__("next_step_users_not_found.org_no_members",{step_name:r.name,org_name:V.concat(C).getProperty("fullname").toString()})}break;case"userFieldRole":var z=r.approver_roles,T=r.approver_user_field,M,y;if(M=InstanceManager.getFormField(T)){if(y=InstanceManager.getFormFieldValue(M.code))var g={userField:M,userFieldValue:y,approverRoleIds:z};if(y){var g={userField:M,userFieldValue:y,approverRoleIds:z};o=(caculateNextstepUsers=UUflow_api.caculateNextstepUsers("userFieldRole",Session.get("spaceId"),g,n)).nextStepUsers,ApproveManager.error.code=caculateNextstepUsers.error}}if(!o.length)if(y){var D=WorkflowManager.getRoles(z);ApproveManager.error.nextStepUsers='"'+D.getProperty("name").toString()+'"审批岗位未指定审批人'}else ApproveManager.error.nextStepUsers='"'+M.code+'"字段没有值';break;case"orgFieldRole":var z=r.approver_roles,I=r.approver_org_field,x,H;if(x=InstanceManager.getFormField(I)){if(H=InstanceManager.getFormFieldValue(x.code))var g={orgField:x,orgFieldValue:H,approverRoleIds:z};if(H){var g={orgField:x,orgFieldValue:H,approverRoleIds:z};o=(caculateNextstepUsers=UUflow_api.caculateNextstepUsers("orgFieldRole",Session.get("spaceId"),g,n)).nextStepUsers,ApproveManager.error.code=caculateNextstepUsers.error}}if(o<1)if(H){var D=WorkflowManager.getRoles(z);ApproveManager.error.nextStepUsers='"'+D.getProperty("name").toString()+'"审批岗位未指定审批人'}else ApproveManager.error.nextStepUsers='"'+x.code+'"字段没有值'}}return(o=o.uniqById()).sort((function(t,e){return t.name.localeCompare(e.name)})),ApproveManager.error.nextStepUsers&&(ApproveManager.error.type=r.deal_type),InstanceManager.handleErrorMessage(),o}},ApproveManager.getNextStepsSelectValue=function(){return $("[name=instance_suggestion_next_step]:checked").val()},ApproveManager.getNextStepUsersSelectValue=function(){var t=$("input[name='nextStepUsers']")[0].dataset.values;return t?t.split(","):[]},ApproveManager.checkAndSetCounterSignNextStepUsers=function(t){var e=new Array,n=InstanceManager.getCurrentStep();if(n&&"counterSign"==n.step_type){var a=WorkflowManager.getInstance(),o=TracesManager.getStepLastHandlers(t,a);e=WorkflowManager.getUsers(o)}return e},ApproveManager.getRelatedInstancesFromDescription=function(t){var e=new Array,n;t&&t.split(")").forEach((function(t){(foo2=t.indexOf(Meteor.absoluteUrl("workflow/space/")))>-1&&(foo3=t.substring(foo2,t.length),2==(foo4=foo3.split("/view/readonly/")).length&&e.push(foo4[1]))}));return e}},"instance_manager.js":function e(){function n(t,e){t.addClass("has-error"),$(".help-block",t).html(e),e&&e.length>0&&toastr.error(e)}function a(t,e){t.addClass("has-error"),$(".help-block",t).html(e)}function o(t){t.removeClass("has-error"),$(".help-block",t).html("")}function r(t,e){if(InstanceManager.isAmisForm()&&t.steedos_field)return e;if(!e&&0!=e)return e;var n;if(["number","multiSelect","radio","checkbox","dateTime","user","group"].includes(t.type))switch(t.type){case"number":case"multiSelect":case"radio":case"checkbox":e=e.toString();break;case"dateTime":e=e;break;case"group":e=CFDataManager.getFormulaOrganizations(e)||"";break;case"user":e=WorkflowManager.getFormulaUserObjects(e)||""}return e}(InstanceManager={}).runFormula=function(t){var e=WorkflowManager.getInstanceFormVersion(),n=[];e&&(n=Form_formula.getFormulaFieldVariable("Form_formula.field_values",e.fields));var a=AutoForm.getFormValues("instanceform",void 0,void 0,!1);Form_formula.run(t,"",n,a,e.fields),Session.set("instance_form_values",{instanceId:Session.get("instanceId"),values:a})},InstanceManager.isTableStyle=function(t){return!Steedos.isMobile()&&!(!(form=WorkflowManager.getForm(t))||"table"!=form.instance_style)},InstanceManager.getFormField=function(t){var e,n=WorkflowManager.getInstanceFields().filterProperty("_id",t);return n.length>0?n[0]:null},InstanceManager.getNextStepOptions=function(){if(ApproveManager.isReadOnly())return[];var t=WorkflowManager.getInstance(),e=InstanceManager.getCurrentApprove(),n;e&&(n=e.next_steps);var a=Session.get("judge"),o=InstanceManager.getCurrentStep(),r=WorkflowManager.getInstanceFormVersion(),s={},i=AutoForm.getFormValues("instanceform",void 0,void 0,!1);i?s=i:Session.get("instance_form_values")&&(s=Session.get("instance_form_values").values);var l=ApproveManager.getNextSteps(t,o,a,s,r&&r.fields),c=function(){return Session.get("next_step_id")},u=Tracker.nonreactive(c),d=[];if(l&&l.length>0){var p=u,f=null;l.forEach((function(t){var e={id:t.id,text:t.name,type:t.step_type};d.push(e)}));var m=_.find(d,(function(t){return t.id===u})),b=!_.isEmpty(m);if(1==d.length)d[0].selected="selected",p=d[0].id,Session.set("next_step_id",p);else if("rejected"!=Session.get("judge")||b){var g=$("[name=instance_suggestion_next_step]:checked"),h;if(g&&g.val()&&(h=d.findPropertyByPK("id",g.val())),_.isObject(h))p=g.val();else if(n&&n.length>0){var w=d.findPropertyByPK("id",n[0].step);_.isObject(w)&&(p=w.id,Session.set("next_step_id",p))}else"rejected"==Session.get("judge")||b||(p=o.lines[0].to_step,Session.set("next_step_id",p))}else start_option=d.findPropertyByPK("type","start"),p=start_option.id,Session.set("next_step_id",p);d.forEach((function(t){t.id==p&&(t.selected="selected",f=t.type)})),Session.set("next_step_multiple",!1),p&&("counterSign"==f?Session.set("next_user_multiple",!0):Session.set("next_user_multiple",!1))}else Session.set("next_step_id",null);return d},InstanceManager.nextStepUsersWillUpdate=function(t,e){"use strict";return!(!t||!e)&&("applicant"===t.name&&("applicant"===e.deal_type||"applicantRole"===e.deal_type||"applicantSuperior"===e.deal_type)||("user"===t.type&&t._id===e.approver_user_field&&("userField"===e.deal_type||"userFieldRole"===e.deal_type)||"group"===t.type&&t._id===e.approver_org_field&&("orgField"===e.deal_type||"orgFieldRole"===e.deal_type)))},InstanceManager.getStepApproveSelectedHandlerIds=function(){var t,e=WorkflowManager.getInstance();if(e){var n=e.step_approve;if(n){var a=InstanceManager.getCurrentStep();_.isEmpty(n[a._id])||(t=n[a._id])}}return t},InstanceManager.getNextUserOptions=function(){var t=[],e=Session.get("next_step_id"),n=Session.get("next_user_multiple"),a=InstanceManager.getStepApproveSelectedHandlerIds();if(e){var o=WorkflowManager.getInstance(),r=InstanceManager.getCurrentApprove();if(!r)return t;var s=r.next_steps,i=[],l=ApproveManager.getNextStepUsers(o,e),c=TracesManager.getStepLastHandlers(e,o);if(l){var u=WorkflowManager.getInstanceStep(e);0==l.length&&"pickupAtRuntime"==u.deal_type&&("counterSign"!=u.step_type?l=WorkflowManager.getUsers(c):a&&(l=a)),l.forEach((function(n){var o={id:n.id,name:n.name};s&&s.length>0?s[0].step==e&&_.contains(s[0].users,n.id)&&(o.selected=!0,i.push(n.id)):l.length>1&&("counterSign"!=u.step_type?c.includes(n.id)&&(o.selected=!0):a&&(o.selected=!0)),t.push(o)}))}}return t},InstanceManager.getFormFieldByCode=function(t){var e,n=WorkflowManager.getInstanceFields().filterProperty("code",t);return n.length>0?n[0]:null},InstanceManager.getApplicantUserId=function(){var t=WorkflowManager.getInstance();if(t){var e=$("#ins_applicant");return"draft"==t.state&&e&&1==e.length&&e[0]&&e[0].dataset.values?e[0].dataset.values:t.applicant}},InstanceManager.checkFormValue=async function(){if(ApproveManager.isReadOnly())return!0;if(!InstanceManager.isCC(WorkflowManager.getInstance())){if(InstanceManager.checkNextStep(),InstanceManager.checkNextStepUser(),InstanceManager.checkSuggestion(),InstanceManager.isAmisForm())return await SteedosUI.refs.instanceAmisView.getComponentById("instanceForm").validate();var t=WorkflowManager.getInstanceFieldPermission();for(var e in t)"editable"==t[e]&&InstanceManager.checkFormFieldValue($("[name='"+e+"']",$("#instanceform"))[0],e)}},InstanceManager.checkNextStep=function(){var t=$("[name=instance_suggestion_next_step]").closest(".form-group");if(""!=ApproveManager.error.nextSteps)return n(t,ApproveManager.error.nextSteps),void(ApproveManager.error.nextSteps="");var e=ApproveManager.getNextStepsSelectValue();e&&"-1"!=e?o(t):n(t,TAPi18n.__("instance_select_next_step"))},InstanceManager._setError_next_step_users=function(t,e,n){var a=$("input[name='nextStepUsers']");a.length>0&&(a[0].dataset.error=t,a[0].dataset.error_type=e,a[0].dataset.error_code=n)},InstanceManager.handleErrorMessage=function(){if(!($("input[name='nextStepUsers']").length<1)){var t=$("#nextStepUsers").closest(".form-group");return InstanceManager._setError_next_step_users("","",""),""!=ApproveManager.error.nextStepUsers?(t.addClass("has-error"),InstanceManager._setError_next_step_users(ApproveManager.error.nextStepUsers,ApproveManager.error.type,ApproveManager.error.code),void(ApproveManager.error.nextStepUsers="")):void 0}},InstanceManager.checkNextStepUser=function(){if(!($("input[name='nextStepUsers']").length<1)){var t=$("#nextStepUsers").closest(".form-group");if(!(t.length<1)){var e=ApproveManager.getNextStepUsersSelectValue(),a=ApproveManager.getNextStepsSelectValue(),r=WorkflowManager.getInstanceStep(a),s;if(e.length>0||r&&"end"==r.step_type)o(t);else"counterSign"==InstanceManager.getCurrentStep().step_type?n(t,TAPi18n.__("instance_next_step_user_countersign")):n(t,TAPi18n.__("instance_next_step_user"))}}},InstanceManager.nextStepUserErrorClass=function(){if(!($("input[name='nextStepUsers']").length<1)){var t=$("#nextStepUsers").closest(".form-group");if(!(t.length<1)){var e=ApproveManager.getNextStepUsersSelectValue(),n=ApproveManager.getNextStepsSelectValue(),r=WorkflowManager.getInstanceStep(n);e.length>0||r&&"end"==r.step_type?o(t):a(t,TAPi18n.__("instance_next_step_user"))}}},InstanceManager.checkSuggestion=function(t){var e=$("[name='judge']").filter(":checked").val(),r=$("#suggestion").parent();e&&"rejected"==e?$("#suggestion").val()?o(r):0==t?a(r,TAPi18n.__("instance_reasons_reject")):n(r,TAPi18n.__("instance_reasons_reject")):o(r)},InstanceManager.checkFormFieldValue=function(t,e,a){if(t){!t.name&&e&&(t.name=e);var r=/^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$/,s=$("#"+t.id).parent(),i="",l=$("[name='"+t.dataset.schemaKey+"']"),c=l.closest(".form-group");if(s.hasClass("twitter-typeahead")&&(s=s.parent().parent()),"table"!=l.attr("type")&&"true"==t.parentNode.dataset.required||("checkbox"==t.type||"radio"==t.type)&&"true"==t.parentNode.parentNode.parentNode.dataset.required||1==c.length&&"true"==c[0].dataset.required){var u="";if(!(u="checkbox"==t.type||"radio"==t.type?$("[name='"+t.name+"']:checked").val():t.value)&&e&&(u=a||InstanceManager.getInstanceValuesByAutoForm()[e]),!u||""==u||u.length<1){var d=InstanceManager.getFormFieldByCode(t.name),p=t.name;d&&(p=d.name?d.name:d.code),"rejected"!=Session.get("judge")&&(i=n(s,TAPi18n.__("instance_field")+"‘"+p+"’"+TAPi18n.__("instance_is_required")))}}if("table"==l.attr("type")&&"true"==t.parentNode.parentNode.parentNode.parentNode.dataset.required){var f=AutoForm.getFieldValue(t.dataset.schemaKey,"instanceform");s=l.parent().parent().parent().parent(),(!f||f.length<1)&&"rejected"!=Session.get("judge")&&(i=n(s,TAPi18n.__("instance_field")+"‘"+t.dataset.label+"’"+TAPi18n.__("instance_is_required")))}if("email"==t.type&&""!=t.value&&(r.test(t.value)||(i=TAPi18n.__("instance_email_format_error"))),"url"==t.type&&""!=t.value){var _=t.value,m;0!=t.value.indexOf("http")&&(_="http://"+encodeURI(_)),new URI(_).username()&&(i=TAPi18n.__("url_invalid"))}return""==i?(o(s),!0):(n(s,i),!1)}},InstanceManager.getFormFieldValue=function(t){if(InstanceManager.isAmisForm()){const e=InstanceManager.getInstanceFormValue()||{};return e[t]}return AutoForm.getFieldValue(t,"instanceform")},InstanceManager.getInstanceFormValue=function(){var t={};if(InstanceManager.isAmisForm()&&SteedosUI.refs.instanceAmisView)t=SteedosUI.refs.instanceAmisView.getComponentById("instanceForm")?SteedosUI.refs.instanceAmisView.getComponentById("instanceForm").props.data:SteedosUI.refs.instanceAmisView.parent.getComponentById("instanceForm").props.data;else{var e=AutoForm.getFormValues("instanceform");if(!e)return;t=_.extend(e.insertDoc,e.updateDoc.$unset);const n=WorkflowManager.getInstance();if(n&&"draft"==Session.get("box")&&"draft"!=n.state&&!t["文件标题"]&&("4c0acf34-aaa2-4834-a189-dd742e987382"==n.flow||"fd456ae72001cb119a7a9076"==n.flow)){const e=InstanceManager.getCurrentApprove();Sentry.captureMessage("申请单值丢失",{contexts:{flowId:n.flow,instanceId:n._id,userId:Meteor.userId(),box:Session.get("box"),currentApprove:e,autoFormValue:t,instanceValues:n.values},user:{id:Meteor.userId()},level:"error"})}}return t},InstanceManager.getInstanceValuesByAutoForm=function(){var t=WorkflowManager.getInstanceFields(),e=InstanceManager.getInstanceFormValue(),n={};return t.forEach((function(t){if("table"==t.type){if(t_values=new Array,t.sfields){if(!e[t.code])return void(n[t.code]=t_values);e[t.code].forEach((function(e){t.sfields.forEach((function(t){e[t.code]=r(t,e[t.code])})),t_values.push(e)}))}n[t.code]=t_values}else"section"!=t.type&&(n[t.code]=r(t,e[t.code]))})),n},InstanceManager.getCurrentStep=function(){var t=WorkflowManager.getInstance();if(t&&t.traces){var e,n=t.traces[t.traces.length-1].step;return WorkflowManager.getInstanceStep(n)}},InstanceManager.getCurrentTrace=function(){var t=WorkflowManager.getInstance();if(t&&t.traces)return t.traces[t.traces.length-1]},InstanceManager.getStartStep=function(){var t=WorkflowManager.getInstance();if(t&&t.traces)return WorkflowManager.getInstanceStep(t.traces[0].step)},InstanceManager.getCurrentValues=function(){var t=Session.get("box"),e,n,a=WorkflowManager.getInstance();if(InstanceManager.isCC(a))n=a.values;else if("draft"==t){if((e=InstanceManager.getCurrentApprove())&&e.values)return e.values}else if("inbox"==t){var o=InstanceManager.getCurrentStep();if(e=InstanceManager.getCurrentApprove(),o&&"counterSign"==o.step_type||InstanceManager.ccHasEditPermission())return e.values=InstanceManager.clone(a.values),e.values;if(e&&e.values)return _.isEmpty(e.values)&&(e.values=InstanceManager.clone(WorkflowManager.getInstance().values)),e.values}else n=a.values;return n},InstanceManager.clone=function(t){if(t)return JSON.parse(JSON.stringify(t))},InstanceManager.getCurrentApprove=function(){var t=WorkflowManager.getInstance();if(t&&t.traces&&!(t.traces.length<1)){var e=t.traces.filterProperty("is_finished",!1);if(e.length){var n=e[0].approves.filterProperty("is_finished",!1).filterProperty("handler",Meteor.userId()),a=n.length>0?n[0]:null;if(Session.get("instanceTaskId")){var o=_.find(n,t=>t._id===Session.get("instanceTaskId"));o&&(a=o)}}if(a&&"cc"!=a.type||(_.each(t.traces,(function(t){_.each(t.approves,(function(t){"cc"==t.type&&t.handler==Meteor.userId()&&0==t.is_finished&&(a=t)}))})),Session.get("instanceTaskId")&&_.each(t.traces,(function(t){_.each(t.approves,(function(t){t._id===Session.get("instanceTaskId")&&(a=t)}))}))),a)return a._id&&(a.id=a._id),a}},InstanceManager.getMyApprove=function(){var t=InstanceManager.getCurrentApprove();if(t){t.description=$("#suggestion").val();var e=$("[name='judge']").filter(":checked").val();e&&(t.judge=e);var n=ApproveManager.getNextStepsSelectValue();if(n){var a=ApproveManager.getNextStepUsersSelectValue(),o=new Array;a instanceof Array?a.forEach((function(t){o.push(t)})):a&&o.push(a),t.next_steps=[{step:n,users:o}]}return InstanceManager.isAmisForm()?t.values=InstanceManager.getInstanceFormValue():t.values=InstanceManager.getInstanceValuesByAutoForm(),t}return{}},InstanceManager.isAmisForm=function(){var t=WorkflowManager.getInstance();if(t){var e=db.flows.findOne({_id:t.flow},{fields:{enable_amisform:1}});return e&&e.enable_amisform}},InstanceManager.getInstanceFormApplicant=function(){var t;return InstanceManager.isAmisForm()?WorkflowManager.getInstance().applicant:$("input[name='ins_applicant']")[0].dataset.values},InstanceManager.setInstanceFormApplicant=function(t,e){$("input[name='ins_applicant']")[0].dataset.values=t,$("input[name='ins_applicant']").val(e)},InstanceManager.saveIns=function(t){t||$("body").addClass("loading");var e=WorkflowManager.getInstance(),n;if(e&&(n=InstanceManager.getInstanceValuesByAutoForm(),"draft"!=e.state&&InstanceManager.updateApproveSign("",$("#suggestion").val(),"update",InstanceSignText.helpers.getLastSignApprove()),InstanceManager.isCC(e))){var a=$("#suggestion").val(),o=InstanceManager.ccHasEditPermission(),r=InstanceManager.getMyApprove();Meteor.call("cc_save",e._id,a,r,o,(function(e,n){$("body").removeClass("loading"),!t&&e&&toastr.error(e),1==n&&(WorkflowManager.instanceModified.set(!1),t||toastr.success(TAPi18n.__("Saved successfully")))}))}else if(InstanceManager.getInstanceFormValue())if(e){var s=e.state;if("draft"==s){e.traces[0].approves[0]=InstanceManager.getMyApprove();var i=InstanceManager.getInstanceFormApplicant();if(e.applicant!=i){var l=e.space,c=SteedosDataManager.spaceUserRemote.findOne({space:l,user:i},{fields:{organization:1,name:1}}),u=c.organization,d=SteedosDataManager.organizationRemote.findOne(u,{fields:{name:1,fullname:1}});e.applicant=i,e.applicant_name=c.name,e.applicant_organization=u,e.applicant_organization_name=d.name,e.applicant_organization_fullname=d.fullname}Meteor.call("draft_save_instance",e,(function(e,n){$("body").removeClass("loading"),WorkflowManager.instanceModified.set(!1),1==n?t||toastr.success(TAPi18n.__("Saved successfully")):"upgraded"==n?(toastr.info(TAPi18n.__("Flow upgraded")),setTimeout((function(){FlowRouter.reload()}),2e3),console.log("upgraded")):(toastr.error(e.reason),FlowRouter.go("/workflow/space/"+Session.get("spaceId")+"/draft/"))}))}else if("pending"==s){var r;(r=InstanceManager.getMyApprove()).values=n,_.isEmpty(r)||_.isEmpty(r._id)?$("body").removeClass("loading"):Meteor.call("inbox_save_instance",r,(function(e,n){$("body").removeClass("loading"),WorkflowManager.instanceModified.set(!1),1==n?t||toastr.success(TAPi18n.__("Saved successfully")):(toastr.error(e.reason),FlowRouter.go("/workflow/space/"+Session.get("spaceId")+"/inbox/"))}))}}else $("body").removeClass("loading")},InstanceManager.newIns=function(t){UUflow_api.post_draft(t)},InstanceManager.deleteIns=function(){var t=WorkflowManager.getInstance();t&&UUflow_api.delete_draft(t._id)},InstanceManager.submitIns=function(){if(InstanceEvent.before.instanceSubmit()&&InstanceManager.isCCMustFinished()){var t=WorkflowManager.getInstance();if(t)if("draft"!=t.state&&InstanceManager.updateApproveSign("",$("#suggestion").val(),"update",InstanceSignText.helpers.getLastSignApprove()),InstanceManager.isCC(t)){if(Session.get("instance_submitting"))return;Session.set("instance_submitting",!0);var e=$("#suggestion").val(),n=InstanceManager.ccHasEditPermission(),a=InstanceManager.getMyApprove();$(document.body).addClass("loading"),Meteor.call("cc_submit",t._id,e,a,n,(function(t,e){$(document.body).removeClass("loading"),t&&(toastr.error(t),Session.set("instance_submitting",!1)),1==e&&(WorkflowManager.instanceModified.set(!1),toastr.success(TAPi18n.__("Submitted successfully")),Session.set("instance_submitting",!1),window.goBack(),Session.set("instanceId",null))}))}else{var o=t.state;if("draft"==o){var r=InstanceManager.getInstanceFormApplicant();if(t.applicant!=r){var s=t.space,i=SteedosDataManager.spaceUserRemote.findOne({space:s,user:r},{fields:{organization:1,name:1}}),l=i.organization,c=SteedosDataManager.organizationRemote.findOne(l,{fields:{name:1,fullname:1}});t.applicant=r,t.applicant_name=i.name,t.applicant_organization=l,t.applicant_organization_name=c.name,t.applicant_organization_fullname=c.fullname}t.traces[0].approves[0]=InstanceManager.getMyApprove(),UUflow_api.post_submit(t)}else if("pending"==o){var a;(a=InstanceManager.getMyApprove()).values=InstanceManager.getInstanceValuesByAutoForm(),UUflow_api.post_engine(a)}}}},InstanceManager.terminateIns=function(t){var e=WorkflowManager.getInstance();e&&UUflow_api.post_terminate({_id:e._id,terminate_reason:t})},InstanceManager.exportIns=function(t){spaceId=Session.get("spaceId"),flowId=Session.get("flowId"),spaceId&&flowId&&UUflow_api.get_export(spaceId,flowId,t)},InstanceManager.reassignIns=function(t,e){var n=WorkflowManager.getInstance();n&&(n.inbox_users=t,n.reassign_reason=e,UUflow_api.put_reassign(n))},InstanceManager.relocateIns=function(t,e,n){var a=WorkflowManager.getInstance();a&&UUflow_api.put_relocate({_id:a._id,relocate_next_step:t,relocate_inbox_users:e,relocate_comment:n})},InstanceManager.archiveIns=function(t){var e=WorkflowManager.getInstance();if(e){if(1==e.is_archived)return;UUflow_api.post_archive(t)}},InstanceManager.addAttach=function(t,e){var n=WorkflowManager.getInstance();if(n){var a=n.state,o=new Date,r=Meteor.userId(),s=t.name;s||(s=Session.get("filename"));var i=n.attachments||[],l=!1,c=Session.get("attach_id");if(i.forEach((function(n){if(n.filename==s||1==e&&n._id==c){l=!0;var a=n.historys;a instanceof Array||(a=[]);var i=InstanceManager.getMyApprove().id;n.current.approve!=i&&a.unshift(n.current),n.historys=a,n.current={_id:(new Mongo.ObjectID)._str,_rev:t._id,length:t.size,approve:i,created:o,created_by:r,created_by_name:Meteor.user().name,filename:s},n.filename=s}})),!l){var u={_id:(new Mongo.ObjectID)._str,filename:s,contentType:t.type,modified:o,modified_by:r,created:o,created_by:r,current:{_id:(new Mongo.ObjectID)._str,_rev:t._id,length:t.size,approve:InstanceManager.getMyApprove().id,created:o,created_by:r,created_by_name:Meteor.user().name,filename:s}};i?i.push(u):i=[u]}if(WorkflowManager.instanceModified.set(!0),"draft"==a)n.attachments=i,n.traces[0].approves[0]=InstanceManager.getMyApprove(),Meteor.call("draft_save_instance",n,(function(t,e){Session.set("change_date",new Date),WorkflowManager.instanceModified.set(!1),1==e?toastr.success(TAPi18n.__("Attachment was added successfully")):toastr.error(t)}));else if("pending"==a)if(InstanceManager.isCC(n))toastr.success(TAPi18n.__("Attachment was added successfully"));else{var d={};$.extend(d,InstanceManager.getMyApprove()),d.attachments=i,d.values=InstanceManager.getInstanceValuesByAutoForm(),Meteor.call("inbox_save_instance",d,(function(t,e){Session.set("change_date",new Date),WorkflowManager.instanceModified.set(!1),1==e?toastr.success(TAPi18n.__("Attachment was added successfully")):toastr.error(t)}))}}},InstanceManager.removeAttach=function(){var t=WorkflowManager.getInstance();if(t){var e=t.state,n=t.attachments,a=Session.get("file_id"),o=n.filter((function(t){if(t.current._rev!=a)return t;var e=t.historys;return e&&e.length>0?(t.current=t.historys.shift(),t.filename=t.current.filename,t):void 0}));if(WorkflowManager.instanceModified.set(!0),"draft"==e)t.attachments=o,t.traces[0].approves[0]=InstanceManager.getMyApprove(),Meteor.call("draft_save_instance",t,(function(t,e){Session.set("change_date",new Date),WorkflowManager.instanceModified.set(!1),1==e?toastr.success(TAPi18n.__("Attachment deleted successfully")):toastr.error(t)}));else if("pending"==e)if(InstanceManager.isCC(t))toastr.success(TAPi18n.__("Attachment deleted successfully"));else{t.attachments=o;var r={};$.extend(r,InstanceManager.getMyApprove()),r.attachments=o,r.values=InstanceManager.getInstanceValuesByAutoForm(),Meteor.call("inbox_save_instance",r,(function(t,e){Session.set("change_date",new Date),WorkflowManager.instanceModified.set(!1),1==e?toastr.success(TAPi18n.__("Attachment deleted successfully")):toastr.error(t)}))}}},InstanceManager.uploadAttach=function(e,n,a){var o,r;check(n,Boolean),check(a,Boolean),$(document.body).addClass("loading"),$(".loading-text").text(TAPi18n.__("workflow_attachment_uploading"));var s=100,i,l,c,u;for(Meteor.settings.public&&Meteor.settings.public.cfs&&Meteor.settings.public.cfs.size_limit&&(s=Meteor.settings.public.cfs.size_limit),o=1024*s*1024,r=t("workflow_attachment_paid_size_limit")+s+"MB",u=0;uo)return $("body").removeClass("loading"),$(".loading-text").text(""),void swal({title:r,type:"warning",confirmButtonText:t("OK"),closeOnConfirm:!0},(function(){$(document.body).removeClass("loading"),$(".loading-text").text("")}));l.name&&(c=l.name,["image.jpg","image.gif","image.jpeg","image.png"].includes(c.toLowerCase())&&(c="image-"+moment(new Date).format("YYYYMMDDHHmmss")+"."+c.split(".").pop()),Session.set("filename",c),$(".loading-text").text(TAPi18n.__("workflow_attachment_uploading")+c+"..."),(i=new FormData).append("Content-Type",cfs.getContentType(c)),i.append("file",l),i.append("instance",Session.get("instanceId")),i.append("space",Session.get("spaceId")),i.append("approve",InstanceManager.getMyApprove().id),i.append("owner",Meteor.userId()),i.append("owner_name",Meteor.user().name),i.append("is_private",l.is_private||!1),n&&(i.append("isAddVersion",n),i.append("parent",Session.get("attach_parent_id"))),a&&i.append("main",a),$.ajax({url:Steedos.absoluteUrl("api/v4/instances/s3/"),type:"POST",async:!0,data:i,dataType:"json",processData:!1,contentType:!1,beforeSend:function(t){t.setRequestHeader("Authorization","Bearer "+Session.get("spaceId")+","+Accounts._storedLoginToken())},success:function(t,e){var n;$(document.body).removeClass("loading"),$(".loading-text").text(""),t.errors?t.errors.forEach((function(t){toastr.error(t.errorMessage)})):toastr.success(TAPi18n.__("Attachment was added successfully"))},error:function(t,e,n){$(document.body).removeClass("loading"),$(".loading-text").text(""),toastr.error(e)}}),u++)}},InstanceManager.lockAttach=function(t){Meteor.call("cfs_instances_lock",t,Meteor.userId(),Meteor.user().name)},InstanceManager.isInbox=function(){var t=WorkflowManager.getInstance(),e=Meteor.userId();if(t&&e&&"inbox"==Session.get("box")){if(t.inbox_users&&t.inbox_users.includes(e))return!0;if(InstanceManager.isCC(t))return!0}return!1},InstanceManager.isCC=function(t){if(!t)return!1;var e=Meteor.userId(),n=InstanceManager.getCurrentApprove();return(!n||"cc"==n.type)&&!(!t.cc_users||!t.cc_users.includes(e))},InstanceManager.getCCApprove=function(t,e){var n=WorkflowManager.getInstance(),a=n.traces,o={};return a.forEach((function(n){n.approves&&n.approves.forEach((function(n){n.handler==t&&"cc"==n.type&&n.is_finished==e&&(o=n)}))})),Session.get("instanceTaskId")&&_.each(n.traces,(function(t){_.each(t.approves,(function(t){t._id===Session.get("instanceTaskId")&&(o=t)}))})),o},InstanceManager.unlockAttach=function(t){Meteor.call("cfs_instances_unlock",t)},InstanceManager.forwardIns=function(t,e,n,a,o,r,s,i,l){if(!Session.get("instance_submitting")){Session.set("instance_submitting",!0),$("body").addClass("loading");var c=WorkflowManager.getInstance(),u=null;InstanceManager.isInbox()&&"pending"==c.state?InstanceManager.getCurrentApprove()&&(u=InstanceManager.getCurrentApprove()._id):"outbox"==Session.get("box")&&"pending"==c.state&&InstanceManager.getLastCCApprove(c.traces)&&(u=InstanceManager.getLastCCApprove(c.traces)._id),Meteor.call("forward_instance",t,e,n,a,o,r,s,i,l,u,(function(t,e){$("body").removeClass("loading"),Session.set("instance_submitting",!1),t&&("no_permission"==t.error?"forward"==i?toastr.error(TAPi18n.__("instance_no_add_permission",{actiontype:TAPi18n.__("instance_forward_title"),usernames:t.details})):"distribute"==i&&toastr.error(TAPi18n.__("instance_no_add_permission",{actiontype:TAPi18n.__("instance_distribute_title"),usernames:t.details})):toastr.error(t.message)),_.isEmpty(e)||("forward"==i?toastr.success(TAPi18n.__("forward_instance_success")):"distribute"==i&&toastr.success(TAPi18n.__("instance_distribute_success")))}))}},InstanceManager.getUserInboxInstances=function(){var t={};return t.$or=[{inbox_users:Meteor.userId()},{cc_users:Meteor.userId()}],db.instances.find(t).fetch()},InstanceManager.retrieveIns=function(t){var e=WorkflowManager.getInstance();e&&(e.retrieve_comment=t,UUflow_api.post_retrieve(e))},InstanceManager.fixInstancePosition=function(t){if($(".instance-wrapper .instance-view").hasClass("suggestion-active")){var e=$(".instance-wrapper .instance-suggestion").height();$(".instance-wrapper .instance").css("bottom",e+2)}else $(".instance-wrapper .instance").css("bottom",0);t&&setTimeout((function(){$(".instance").scrollTop($(".instance .instance-form").height()+$(".instance-traces").height())}),1)},InstanceManager.setApproveHaveRead=function(t){var e=WorkflowManager.getInstance(),n=InstanceManager.getCurrentApprove();if(n&&!n.is_read)Meteor.call("set_approve_have_read",e._id,n.trace,n.id,(function(t,e){}));else{var a=InstanceManager.getCCApprove(Meteor.userId(),!1);_.isEmpty(a)||a.is_read||Meteor.call("cc_read",a,(function(t,e){console.log("set read")}))}},InstanceManager.instanceformChangeEvent=function(t){var e,n,a,o,r;if(!ApproveManager.isReadOnly()){if(e=t.target.name,"number"===(o=t.target.type)){r=t.target.value;try{r||(r=0),"string"==typeof r&&(r=parseFloat(r)),r=(a=t.target.step)?r.toFixed(a.length-2):r.toFixed(0),t.target.value=r}catch(l){n=l,console.log(r+n)}}if(InstanceManager.checkFormFieldValue(t.target),InstanceManager.runFormula(e),"ins_applicant"===e)Session.set("ins_applicant",InstanceManager.getApplicantUserId()),InstanceManager.nextStepUsersWillUpdate({name:"applicant"},WorkflowManager.getInstanceStep(Session.get("next_step_id")))&&Session.set("instance_next_user_recalculate",Random.id());else{var s,i=WorkflowManager.getInstanceFields().filterProperty("code",e);i.length>0&&InstanceManager.nextStepUsersWillUpdate(i[0],WorkflowManager.getInstanceStep(Session.get("next_step_id")))&&Session.set("instance_next_user_recalculate",Random.id())}}},InstanceManager.isCCMustFinished=function(){var t=InstanceManager.getCurrentStep();if(t&&1==t.cc_must_finished){var e=WorkflowManager.getInstance();if(e){var n=_.find(e.traces,(function(e){return e.step==t._id})),a=new Array,o=Meteor.userId();if(InstanceManager.isCC(e)?_.each(n.approves,(function(t){"cc"==t.type&&t.from_user==o&&1!=t.is_finished&&t.handler!=o&&a.push(t.handler_name)})):_.each(n.approves,(function(t){"cc"==t.type&&t.from_user==o&&1!=t.is_finished&&a.push(t.handler_name)})),!_.isEmpty(a))return toastr.error(TAPi18n.__("instance_cc_must_finished",{not_finished_users_name:a.toString()})),!1}}return!0},InstanceManager.getLastApprove=function(t){var e,n,a;for(a=Meteor.userId(),e=null,n=t.length-1;n>=0;)!e&&t[n].is_finished&&_.each(t[n].approves,(function(t){e||!t.is_finished||t.user!==a||t.type&&"reassign"!=t.type||!["approved","submitted","rejected"].includes(t.judge)||(e=t)})),n--;return e},InstanceManager.getLastTraceStepId=function(t){var e,n,a,o;for(o=Meteor.userId(),a=null,n=null,e=t.length-1;e>=0;)!a&&t[e].is_finished&&_.each(t[e].approves,(function(r){a||(!r.is_finished||r.user!==o||r.type&&"reassign"!=r.type||!["approved","submitted","rejected"].includes(r.judge)||(a=r.trace),a&&(n=t[e].step))})),e--;return n},InstanceManager.getLastCCTraceStepId=function(t){var e,n,a,o;for(o=Meteor.userId(),a=null,n=null,e=t.length-1;e>=0;)!a&&t[e].is_finished&&_.each(t[e].approves,(function(r){a||(!r.is_finished||r.user!==o||r.type&&"cc"!=r.type||!["approved","submitted","rejected"].includes(r.judge)||(a=r.trace),a&&(n=t[e].step))})),e--;return n},InstanceManager.getLastCCApprove=function(t){var e,n,a;for(a=Meteor.userId(),e=null,n=t.length-1;n>=0;)!e&&t[n].is_finished&&_.each(t[n].approves,(function(t){e||!t.is_finished||t.handler!==a||t.type&&"cc"!=t.type||!["approved","submitted","rejected"].includes(t.judge)||(e=t)})),n--;return e},InstanceManager.isAttachLocked=function(t,e){return!!cfs.instances.find({"metadata.instance":t,"metadata.current":!0,"metadata.locked_by":e}).count()},InstanceManager.getCCStep=function(){var t=InstanceManager.getCurrentApprove();if(!t)return!1;var e=WorkflowManager.getInstance(),n;if(!e)return!1;var a=_.find(e.traces,(function(e){return e._id==t.trace}));return a&&(n=WorkflowManager.getInstanceStep(a.step)),n},InstanceManager.updateApproveSign=function(t,e,n,a){!(myApprove=InstanceManager.getCurrentApprove())||1==myApprove.sign_show&&e||Meteor.call("update_approve_sign",myApprove.instance,myApprove.trace,myApprove._id,t,e,n||"update",a)},InstanceManager.getDistributeStep=function(){var t;if(InstanceManager.isInbox())t=InstanceManager.getCurrentStep();else if("outbox"==Session.get("box")){var e=WorkflowManager.getInstance();if(e&&"pending"==e.state){var n=InstanceManager.getLastTraceStepId(e.traces);n&&(t=WorkflowManager.getInstanceStep(n))}}return t};var s=function(t,e){var n=Session.get("instance_form_values");t||(t=InstanceManager.getStartStep()),e||(e=[]);var a=[],o="approved",r=WorkflowManager.getInstanceFormVersion(),i={},l=AutoForm.getFormValues("instanceform",void 0,void 0,!1);l?i=l:n&&(i=n.values),a.push(t);var c=ApproveManager.getNextSteps(WorkflowManager.getInstance(),t,o,i,r.fields,!0);return _.each(c,(function(t){_.contains(e,t._id)||(a=a.concat(s(t,e.concat(_.pluck(a,"_id")))))})),a=a.uniqById()};InstanceManager.pickApproveSteps=function(){return s()},InstanceManager.ccHasEditPermission=function(){var t=InstanceManager.getCCStep(),e=InstanceManager.getCurrentApprove();if(!e)return!1;var n=WorkflowManager.getInstance();if(!n)return!1;var a=_.find(n.traces,(function(t){return t._id==e.trace}));return t&&t.cc_has_edit_permission&&!a.is_finished},InstanceManager.getOpinionFieldsCode=function(){let t="",e=$("[name=opinion_fields_code]");if(e&&e.length>0){let n=0,a=e.length;for(;n0)return _.each(t.result,(function(t){t.alerts&&toastr.info(t.alerts)})),void FlowRouter.go("/workflow/space/"+Session.get("spaceId")+"/draft/");FlowRouter.go("/workflow/space/"+Session.get("spaceId")+"/"+Session.get("box")),toastr.success(TAPi18n.__("Submitted successfully")),Session.set("instance_submitting",!1);var n=SteedosUI.refs.serviceSteedosKeyvaluesSubscribe,a=n&&n.getComponentByName("serviceSteedosKeyvaluesSubscribe.buttonTriggerDataChange");a&&a.props.dispatchEvent("click",{})}},error:function(t,e,n){$(document.body).removeClass("loading"),toastr.error(e),Session.set("instance_submitting",!1)}})}},UUflow_api.post_engine=function(t){if(!Session.get("instance_submitting")){Session.set("instance_submitting",!0);var e={methodOverride:"POST"};e["X-User-Id"]=Meteor.userId(),e["X-Auth-Token"]=Accounts._storedLoginToken(),e.insId=t.instance;var n=Steedos.absoluteUrl()+"api/workflow/engine?"+$.param(e),a={Approvals:[t]};a=JSON.stringify(a),$(document.body).addClass("loading"),$.ajax({url:n,type:"POST",async:!0,data:a,dataType:"json",processData:!1,contentType:"application/json",beforeSend:function(t){t.setRequestHeader("Authorization","Bearer "+Session.get("spaceId")+","+Accounts._storedLoginToken())},success:function(t,e){$(document.body).removeClass("loading"),t.errors?t.errors.forEach((function(t){toastr.error(t.errorMessage)})):(Session.set("instance_change",!1),window.goBack(),toastr.success(TAPi18n.__("Submitted successfully")),Session.set("instance_submitting",!1))},error:function(t,e,n){$(document.body).removeClass("loading"),toastr.error(e),Session.set("instance_submitting",!1)}})}},UUflow_api.post_terminate=function(t){if(!Session.get("instance_submitting")){Session.set("instance_submitting",!0);var e={methodOverride:"POST"};e["X-User-Id"]=Meteor.userId(),e["X-Auth-Token"]=Accounts._storedLoginToken();var n=Steedos.absoluteUrl()+"api/workflow/terminate?"+$.param(e),a={Instances:[t]};a=JSON.stringify(a),$(document.body).addClass("loading"),$.ajax({url:n,type:"POST",async:!0,data:a,dataType:"json",processData:!1,contentType:"application/json",beforeSend:function(t){t.setRequestHeader("Authorization","Bearer "+Session.get("spaceId")+","+Accounts._storedLoginToken())},success:function(t,e){if($(document.body).removeClass("loading"),t.errors)t.errors.forEach((function(t){toastr.error(t.errorMessage)}));else{FlowRouter.go("/workflow/space/"+Session.get("spaceId")+"/"+Session.get("box")),toastr.success(TAPi18n.__("Canceled successfully")),Session.set("instance_submitting",!1);var n=SteedosUI.refs.serviceSteedosKeyvaluesSubscribe,a=n&&n.getComponentByName("serviceSteedosKeyvaluesSubscribe.buttonTriggerDataChange");a&&a.props.dispatchEvent("click",{})}},error:function(t,e,n){$(document.body).removeClass("loading"),toastr.error(e),Session.set("instance_submitting",!1)}})}},UUflow_api.put_reassign=function(t){if(!Session.get("instance_submitting")){Session.set("instance_submitting",!0);var e={methodOverride:"PUT"};e["X-User-Id"]=Meteor.userId(),e["X-Auth-Token"]=Accounts._storedLoginToken();var n=Steedos.absoluteUrl()+"api/workflow/reassign?"+$.param(e),a={Instances:[t]};a=JSON.stringify(a),$(document.body).addClass("loading"),$.ajax({url:n,type:"POST",async:!0,data:a,dataType:"json",processData:!1,contentType:"application/json",beforeSend:function(t){t.setRequestHeader("Authorization","Bearer "+Session.get("spaceId")+","+Accounts._storedLoginToken())},success:function(t,e){$(document.body).removeClass("loading"),t.errors?t.errors.forEach((function(t){toastr.error(t.errorMessage)})):(toastr.success(TAPi18n.__("Reasigned successfully")),Session.set("instance_submitting",!1))},error:function(t,e,n){$(document.body).removeClass("loading"),toastr.error(e),Session.set("instance_submitting",!1)}})}},UUflow_api.put_relocate=function(t){if(!Session.get("instance_submitting")){Session.set("instance_submitting",!0);var e={methodOverride:"PUT"};e["X-User-Id"]=Meteor.userId(),e["X-Auth-Token"]=Accounts._storedLoginToken();var n=Steedos.absoluteUrl()+"api/workflow/relocate?"+$.param(e),a={Instances:[t]};a=JSON.stringify(a),$(document.body).addClass("loading"),$.ajax({url:n,type:"POST",async:!0,data:a,dataType:"json",processData:!1,contentType:"application/json",beforeSend:function(t){t.setRequestHeader("Authorization","Bearer "+Session.get("spaceId")+","+Accounts._storedLoginToken())},success:function(t,e){$(document.body).removeClass("loading"),t.errors?t.errors.forEach((function(t){toastr.error(t.errorMessage)})):(toastr.success(TAPi18n.__("Relocated successfully")),Session.set("instance_submitting",!1))},error:function(t,e,n){$(document.body).removeClass("loading"),toastr.error(e),Session.set("instance_submitting",!1)}})}},UUflow_api.post_archive=function(t){var n={methodOverride:"POST"};n["X-User-Id"]=Meteor.userId(),n["X-Auth-Token"]=Accounts._storedLoginToken();var a=Steedos.absoluteUrl()+"api/workflow/archive?"+$.param(n),o={Instances:[{id:t}]};o=JSON.stringify(o),$(document.body).addClass("loading"),$.ajax({url:a,type:"POST",async:!0,data:o,dataType:"json",processData:!1,contentType:"application/json",beforeSend:e,success:function(t,e){$(document.body).removeClass("loading"),t.errors&&t.errors.forEach((function(t){toastr.error(t.errorMessage)}))},error:function(t,e,n){$(document.body).removeClass("loading"),toastr.error(e)}})},UUflow_api.get_export=function(t,e,n){var a={};a["X-User-Id"]=Meteor.userId(),a["X-Auth-Token"]=Accounts._storedLoginToken(),a.space_id=t,a.flow_id=e,a.timezoneoffset=(new Date).getTimezoneOffset(),a.type=n;var o=Steedos.absoluteUrl()+"api/workflow/export/instances?"+$.param(a);window.open(o,"_parent","EnableViewPortScale=yes")},UUflow_api.caculate_nextstep_users=function(t,e,n,a){var o={};o.deal_type=t,o.spaceId=e,o.insId=Session.get("instanceId"),o.nextStepId=a;var r=[],s=JSON.stringify(n);return $.ajax({url:Steedos.absoluteUrl("api/workflow/nextStepUsers")+"?"+$.param(o),type:"POST",async:!1,data:s,dataType:"json",processData:!1,contentType:"application/json",beforeSend:function(t){t.setRequestHeader("Authorization","Bearer "+e+","+Accounts._storedLoginToken())},success:function(t,e){t.errors?toastr.error(t.errors):r=t.nextStepUsers},error:function(t,e,n){toastr.error(e)}}),r},UUflow_api.caculateNextstepUsers=function(t,e,n,a){var o={};o.deal_type=t,o.spaceId=e,o.insId=Session.get("instanceId"),o.nextStepId=a;var r=[],s="",i=JSON.stringify(n);return $.ajax({url:Steedos.absoluteUrl("api/workflow/nextStepUsers")+"?"+$.param(o),type:"POST",async:!1,data:i,dataType:"json",processData:!1,contentType:"application/json",beforeSend:function(t){t.setRequestHeader("Authorization","Bearer "+e+","+Accounts._storedLoginToken())},success:function(t,e){t.errors?toastr.error(t.errors):(r=t.nextStepUsers,s=t.error)},error:function(t,e,n){toastr.error(e)}}),{nextStepUsers:r,error:s}},UUflow_api.getSpaceUsers=function(t,e){var n={};n.spaceId=t;var a={userIds:e},o;return a=JSON.stringify(a),$.ajax({url:Steedos.absoluteUrl("api/workflow/getSpaceUsers")+"?"+$.param(n),type:"POST",async:!1,data:a,dataType:"json",processData:!1,contentType:"application/json",beforeSend:function(e){e.setRequestHeader("Authorization","Bearer "+t+","+Accounts._storedLoginToken())},success:function(t,n){t.errors?toastr.error(t.errors):(_spaceUsers=t.spaceUsers,o=[],_.isArray(e)?_.each(e,(function(t){var e=_.find(_spaceUsers,(function(e){return e.id==t}));e&&o.push(e)})):o=_spaceUsers)},error:function(t,e,n){toastr.error(e)}}),o},UUflow_api.post_retrieve=function(t){if(!Session.get("instance_submitting")){Session.set("instance_submitting",!0);var n={methodOverride:"POST"};n["X-User-Id"]=Meteor.userId(),n["X-Auth-Token"]=Accounts._storedLoginToken();var a=Steedos.absoluteUrl()+"api/workflow/retrieve?"+$.param(n),o={Instances:[{_id:t._id,retrieve_comment:t.retrieve_comment}]};o=JSON.stringify(o),$(document.body).addClass("loading"),$.ajax({url:a,type:"POST",async:!0,data:o,dataType:"json",processData:!1,contentType:"application/json",beforeSend:e,success:function(t,e){$(document.body).removeClass("loading"),t.errors?t.errors.forEach((function(t){toastr.error(t.errorMessage)})):(FlowRouter.go("/workflow/space/"+Session.get("spaceId")+"/inbox"),toastr.success(TAPi18n.__("Retrieved successfully")),Session.set("instance_submitting",!1))},error:function(t,e,n){$(document.body).removeClass("loading"),toastr.error(e),Session.set("instance_submitting",!1)}})}},UUflow_api.getNameForUser=function(t){var n={},a={userId:t},o;return a=JSON.stringify(a),$.ajax({url:Steedos.absoluteUrl("api/workflow/getNameForUser")+"?"+$.param(n),type:"POST",async:!1,data:a,dataType:"json",processData:!1,contentType:"application/json",beforeSend:e,success:function(t,e){t.errors?toastr.error(t.errors):o=t.user},error:function(t,e,n){toastr.error(e)}}),o},UUflow_api.post_forward=function(t,n,a,o,r,s,i,l,c){if(!Session.get("instance_submitting")){Session.set("instance_submitting",!0),$("body").addClass("loading");var u=WorkflowManager.getInstance(),d=null;InstanceManager.isInbox()&&"pending"==u.state?InstanceManager.getCurrentApprove()&&(d=InstanceManager.getCurrentApprove()._id):"outbox"==Session.get("box")&&"pending"==u.state&&InstanceManager.getLastCCApprove(u.traces)&&(d=InstanceManager.getLastCCApprove(u.traces)._id);var p={methodOverride:"POST"};p["X-User-Id"]=Meteor.userId(),p["X-Auth-Token"]=Accounts._storedLoginToken();var f=Steedos.absoluteUrl()+"api/workflow/forward?"+$.param(p),_={instance_id:t,space_id:n,flow_id:a,hasSaveInstanceToAttachment:o,description:r,isForwardAttachments:s,selectedUsers:i,action_type:l,related:c,from_approve_id:d};_=JSON.stringify(_),$.ajax({url:f,type:"POST",async:!0,data:_,dataType:"json",processData:!1,contentType:"application/json",beforeSend:e,success:function(t,e){if(Session.set("instance_submitting",!1),$(document.body).removeClass("loading"),t.errors)t.errors.forEach((function(t){"no_permission"==t.error?"forward"==l?toastr.error(TAPi18n.__("instance_no_add_permission",{actiontype:TAPi18n.__("instance_forward_title"),usernames:t.details})):"distribute"==l&&toastr.error(TAPi18n.__("instance_no_add_permission",{actiontype:TAPi18n.__("instance_distribute_title"),usernames:t.details})):toastr.error(t.reason)}));else if("forward"==l){toastr.success(TAPi18n.__("forward_instance_success"));var n=t&&t.new_ins_ids&&t.new_ins_ids[0];if(n&&!Steedos.isMobile()){var a="/workflow/space/"+Steedos.getSpaceId()+"/inbox/"+n;a=Steedos.absoluteUrl(a),Steedos.openWindow(a)}}else"distribute"==l&&toastr.success(TAPi18n.__("instance_distribute_success"))},error:function(t,e,n){Session.set("instance_submitting",!1),$(document.body).removeClass("loading"),toastr.error(e)}})}},UUflow_api.getPDFData=function(t,e){$(document.body).addClass("loading");var n={attachmentId:t};n=JSON.stringify(n),$.ajax({url:Steedos.absoluteUrl("api/workflow/office_convert_to_pdf"),type:"POST",async:!0,data:n,dataType:"json",processData:!1,contentType:"application/json",success:function(n,a){n.errors?toastr.error(n.errors):($(document.body).removeClass("loading"),e(t,n.result.data))},error:function(t,e,n){$(document.body).removeClass("loading"),toastr.error(t.responseJSON.error)}})},UUflow_api.getContactInfoForUser=function(t,n){var a={userId:t,spaceId:n},o;return a=JSON.stringify(a),$.ajax({url:Steedos.absoluteUrl("api/workflow/getContactInfoForUser"),type:"POST",async:!1,data:a,dataType:"json",processData:!1,contentType:"application/json",beforeSend:e,success:function(t,e){t.errors?toastr.error(t.errors):o=t.user},error:function(t,e,n){toastr.error(e)}}),o}},"workflow_manager.js":function t(){WorkflowManager={instanceModified:new ReactiveVar(!1)},Meteor.isClient&&(WorkflowManager.remoteSpaceUsers=new AjaxCollection("space_users"),WorkflowManager.remoteOrganizations=new AjaxCollection("organizations"),WorkflowManager.remoteFlowRoles=new AjaxCollection("flow_roles"),WorkflowManager.remoteHrRoles=new AjaxCollection("roles")),WorkflowManager.getUrlForServiceName=function(t){var e;return{s3:"https://s3ws.steedos.com",workflow:"http://192.168.0.23"}[t]},WorkflowManager.getForm=function(t){return db.forms.findOne(t)},WorkflowManager.getFlow=function(t){return db.flows.findOne(t)},WorkflowManager.getSpaceOrganizations=function(t){var e=new Array,n;return db.organizations.find().forEach((function(t){t.id=t._id,e.push(t)})),e},WorkflowManager.getSpaceUsers=function(t){var e=new Array,n;return db.space_users.find({user_accepted:!0},{sort:{name:1}}).forEach((function(n){n.id=n.user,n.organization=WorkflowManager.getOrganization(n.organization),n.organization&&(n.roles=WorkflowManager.getUserRoles(t,n.organization.id,n.id),e.push(n))})),e},WorkflowManager.getSpacePositions=function(t){var e=new Array,n;return db.flow_positions.find().forEach((function(t){e.push(t)})),e},WorkflowManager.getSpaceRoles=function(t){var e=new Array,n;return db.flow_roles.find().forEach((function(t){t.id=t._id,e.push(t)})),e},WorkflowManager.getInstance=function(){return db.instances.findOne({_id:Session.get("instanceId")})},WorkflowManager.getInstanceFormVersion=function(){var t=[],e=null,n=WorkflowManager.getInstance();if(n){var e;if(!(e=db.form_versions.findOne({_id:n.form_version,form:n.form})))return;field_permission=WorkflowManager.getInstanceFieldPermission(),e.fields&&e.fields.forEach((function(e){e.permission="editable"==field_permission[e.code]?"editable":"readonly","table"==e.type&&(e.sfields=e.fields,e.sfields?(e.sfields.forEach((function(t){t.permission="editable"==field_permission[t.code]?"editable":"readonly"})),e.sfields.push({code:"_id",permission:"editable",type:"hidden",default_value:db.instances._makeNewID})):console.error("子表:"+e.code+" 没有字段"),delete e.fields),"section"==e.type?(t.push(e),e.fields&&e.fields.forEach((function(e){e.permission="editable"==field_permission[e.code]?"editable":"readonly",t.push(e)}))):t.push(e)})),e.fields=t}return e},WorkflowManager.getInstanceFlowVersion=function(){var t=WorkflowManager.getInstance();if(t)return db.flow_versions.findOne({_id:t.flow_version,flow:t.flow})},WorkflowManager.getInstanceFields=function(){var t;return WorkflowManager.getInstanceFormVersion().fields},WorkflowManager.getInstanceStep=function(t){var e=WorkflowManager.getInstanceFlowVersion(),n;return e?(e.steps.forEach((function(e){e._id!=t||((n=e).id=e._id)})),n):null},WorkflowManager.getInstanceSteps=function(){var t=WorkflowManager.getInstanceFlowVersion();if(!t)return null;var e=[];return t.steps.forEach((function(t){t.id=t._id,e.push(t)})),e},WorkflowManager.getInstanceFieldPermission=function(){var t=WorkflowManager.getInstance();if(!t)return{};if(InstanceManager.isCC(t)&&!InstanceManager.ccHasEditPermission())return{};var e="";t.traces&&t.traces.forEach((function(t){0!=t.is_finished||(e=t.step)}));var n=WorkflowManager.getInstanceStep(e);return n&&n.permissions||{}},WorkflowManager.getOrganizationChildrens=function(t,e){var n,a;return WorkflowManager.getSpaceOrganizations(t).filterProperty("parents",e)},WorkflowManager.getOrganizationsChildrens=function(t,e){var n=new Array;return e.forEach((function(e){n=n.concat(WorkflowManager.getOrganizationChildrens(t,e))})),n},WorkflowManager.getOrganizationsUsers=function(t,e){var n=WorkflowManager.getSpaceUsers(t),a=new Array;return e.forEach((function(t){a=a.concat(WorkflowManager.getUsers(t.users))})),a},WorkflowManager.getOrganization=function(t){if(t){var e=WorkflowManager.remoteOrganizations.findOne(t);if(e)return e.id=e._id,e}},WorkflowManager.getOrganizations=function(t){return t?"string"==typeof t?[WorkflowManager.getOrganization(t)]:WorkflowManager.remoteOrganizations.find({_id:{$in:t}}):[]},WorkflowManager.getRoles=function(t){if(!(t&&t instanceof Array))return[];var e=new Array;return t.forEach((function(t){e.push(WorkflowManager.getRole(t))})),e},WorkflowManager.getRole=function(t){if(t){var e=WorkflowManager.getSpaceRoles(),n={};return e.forEach((function(e){e.id!=t||(n=e)})),n}},WorkflowManager.getUser=function(t,e){if(t){if("string"!=typeof t)return WorkflowManager.getUsers(t,e);var n=UUflow_api.getSpaceUsers(e||Session.get("spaceId"),t);if(n){var a=n[0];if(a)return a}}},WorkflowManager.getUsers=function(t,e){if("string"==typeof t)return[WorkflowManager.getUser(t,e)];var n=new Array;return t&&(n=UUflow_api.getSpaceUsers(e||Session.get("spaceId"),t)),n},WorkflowManager.getUserRoles=function(t,e,n){var a=new Array,o,r;return WorkflowManager.getSpacePositions(t).filterProperty("users",n).forEach((function(t){a.push(WorkflowManager.getRole(t.role))})),a},WorkflowManager.getRoleUsersbyOrgAndRole=function(t,e,n){var a=new Array,o=WorkflowManager.getSpaceRoles(t),r,s,i=WorkflowManager.getSpacePositions(t).filterProperty("role",n).filterProperty("org",e);if(i.forEach((function(t){var e=t.users;a=a.concat(WorkflowManager.getUsers(e))})),0==i.length){var l=WorkflowManager.getOrganization(e);l&&""!=l.parent&&(a=a.concat(WorkflowManager.getRoleUsersbyOrgAndRole(t,l.parent,n)))}return a},WorkflowManager.getRoleUsersByOrgAndRoles=function(t,e,n){var a=new Array;return n.forEach((function(n){a=a.concat(WorkflowManager.getRoleUsersbyOrgAndRole(t,e,n))})),a},WorkflowManager.getRoleUsersByOrgsAndRoles=function(t,e,n){var a=new Array;return e&&n?(e.forEach((function(e){a=a.concat(WorkflowManager.getRoleUsersByOrgAndRoles(t,e,n))})),a):a},WorkflowManager.getRoleUsersByUsersAndRoles=function(t,e,n){var a=new Array,o;return e&&n?(WorkflowManager.getUsers(e).forEach((function(e){a=a.concat(WorkflowManager.getRoleUsersByOrgAndRoles(t,e.organization.id,n))})),a):a},WorkflowManager.getFormulaUserObjects=function(t){if(t)return CFDataManager.getFormulaSpaceUser(t)},WorkflowManager.getFormulaUserObject=function(t){return t instanceof Array?SteedosDataManager.getFormulaUserObjects(Session.get("spaceId"),t):SteedosDataManager.getFormulaUserObjects(Session.get("spaceId"),[t])[0]},WorkflowManager.getFormulaOrgObjects=function(t){if(t)return WorkflowManager.getFormulaOrgObject(t)},WorkflowManager.getFormulaOrgObject=function(t){if(t instanceof Array){var e=new Array,n;return WorkflowManager.getOrganizations(t).forEach((function(t){var n={};n.id=t._id,n.name=t.name,n.fullname=t.fullname,e.push(n)})),e}var a={},o=WorkflowManager.getOrganization(t);return o?(a.id=t,a.name=o.name,a.fullname=o.fullname,a):null},WorkflowManager.getSpaceCategories=function(t,e){var n={space:t};return _.isEmpty(e)||(n._id={$in:e}),db.categories.find(n,{sort:{sort_no:-1}}).fetch()},WorkflowManager.getCategoriesForms=function(t){return db.forms.find({category:t,state:"enabled"}).fetch()},WorkflowManager.getUnCategoriesForms=function(){return _.isEmpty(Session.get("workflow_categories"))?forms=db.forms.find({category:{$in:[null,""]},state:"enabled"}).fetch():[]},WorkflowManager.getFormFlows=function(t){return db.flows.find({form:t,state:"enabled"}).fetch()},WorkflowManager.getCompanyFlows=function(t,e){var n=e||Session.get("spaceId");return db.flows.find({space:n,company_id:t,state:"enabled"}).fetch()},WorkflowManager.getSpaceFlows=function(t){return db.flows.find({space:t}).fetch()},WorkflowManager.canAdd=function(t,e,n){var a=t.perms,o=!1;return a&&(a.users_can_add&&a.users_can_add.includes(Meteor.userId())?o=!0:a.orgs_can_add&&a.orgs_can_add.length>0&&(e&&e.organizations&&_.intersection(e.organizations,a.orgs_can_add).length>0?o=!0:n&&(o=_.some(n,(function(t){return t.parents&&_.intersection(t.parents,a.orgs_can_add).length>0}))))),o},WorkflowManager.canAdmin=function(t,e,n){var a=t.perms,o=!1;return a&&(a.users_can_admin&&a.users_can_admin.includes(Meteor.userId())?o=!0:a.orgs_can_admin&&a.orgs_can_admin.length>0&&(e&&e.organizations&&_.intersection(e.organizations,a.orgs_can_admin).length>0?o=!0:n&&(o=_.some(n,(function(t){return t.parents&&_.intersection(t.parents,a.orgs_can_admin).length>0}))))),o},WorkflowManager.canMonitor=function(t,e,n){var a=t.perms,o=!1;return a&&(a.users_can_monitor&&a.users_can_monitor.includes(Meteor.userId())?o=!0:a.orgs_can_monitor&&a.orgs_can_monitor.length>0&&(e&&e.organizations&&_.intersection(e.organizations,a.orgs_can_monitor).length>0?o=!0:n&&(o=_.some(n,(function(t){return t.parents&&_.intersection(t.parents,a.orgs_can_monitor).length>0}))))),o},WorkflowManager.getMyAdminOrMonitorFlows=function(){var t,e=[],n,a;return(n=db.space_users.findOne({space:Session.get("spaceId"),user:Meteor.userId()}))&&(organizations=db.organizations.find({_id:{$in:n.organizations}}).fetch(),(t=db.flows.find()).forEach((function(t){(WorkflowManager.canMonitor(t,n,organizations)||WorkflowManager.canAdmin(t,n,organizations))&&e.push(t._id)}))),e},WorkflowManager.getMyCanAddFlows=function(){var t,e=[],n,a;return n=db.space_users.findOne({space:Session.get("spaceId"),user:Meteor.userId()}),organizations=db.organizations.find({_id:{$in:n.organizations}}).fetch(),(t=db.flows.find()).forEach((function(t){WorkflowManager.canAdd(t,n,organizations)&&e.push(t._id)})),e},WorkflowManager.getCompanyFlowListData=function(t,e,n){if(!t)return console.error("WorkflowManager.getCompanyFlowListData 未传入company_id"),[];var a=n||Session.get("spaceId"),o=Meteor.userId(),r=db.space_users.findOne({space:a,user:o}),s=db.organizations.find({_id:{$in:r.organizations}}).fetch(),i={},l=[];if("distribute"==e){var c=InstanceManager.getDistributeStep();c&&1==c.allowDistribute&&(l=c.distribute_optional_flows||[])}if(l.length>0)i.distribute_optional_flows=db.flows.find({_id:{$in:l},company_id:t,state:"enabled"}).fetch();else{var u=Steedos.isSpaceAdmin(),d=WorkflowManager.getCompanyFlows(t,n);d.sortByName(),i.flows=new Array,d.forEach((function(t){WorkflowManager.canAdd(t,r,s)?i.flows.push(t):"show"==e&&(u?i.flows.push(t):WorkflowManager.canMonitor(t,r,s)?i.flows.push(t):WorkflowManager.canAdmin(t,r,s)&&i.flows.push(t))}))}return i},WorkflowManager.getFlowListData=function(t,e){var n=e||Session.get("spaceId"),a=Meteor.userId(),o=db.space_users.findOne({space:n,user:a}),r=db.organizations.find({_id:{$in:o.organizations}}).fetch(),s={},i=[];if("distribute"==t){var l=InstanceManager.getDistributeStep();l&&1==l.allowDistribute&&(i=l.distribute_optional_flows||[])}if(i.length>0)s.distribute_optional_flows=db.flows.find({_id:{$in:i},state:"enabled"}).fetch();else{s.categories=new Array;var c=WorkflowManager.getSpaceCategories(n,Session.get("workflow_categories")),u=Steedos.isSpaceAdmin();c.forEach((function(e){var n=WorkflowManager.getCategoriesForms(e._id);n.forEach((function(e){var n=WorkflowManager.getFormFlows(e._id);n.sortByName(),e.flows=new Array,n.forEach((function(n){e.sort_no=n.sort_no,e.name=n.name,WorkflowManager.canAdd(n,o,r)?e.flows.push(n):"show"==t&&(u?e.flows.push(n):WorkflowManager.canMonitor(n,o,r)?e.flows.push(n):WorkflowManager.canAdmin(n,o,r)&&e.flows.push(n))}))})),n.sortByName(),e.forms=n}));var d=WorkflowManager.getUnCategoriesForms();d.sortByName(),d.forEach((function(e){var n=WorkflowManager.getFormFlows(e._id);n.sortByName(),e.flows=new Array,n.forEach((function(n){WorkflowManager.canAdd(n,o,r)?e.flows.push(n):"show"==t&&(u?e.flows.push(n):WorkflowManager.canMonitor(n,o,r)?e.flows.push(n):WorkflowManager.canAdmin(n,o,r)&&e.flows.push(n))}))})),c=_.filter(c,(function(t){var e=0;return t.forms.forEach((function(t){e+=t.flows.length})),e>0})),s.categories=c;var p=0;d.forEach((function(t){p+=t.flows.length})),p>0&&s.categories.push({name:TAPi18n.__("workflow_no_category"),_id:"",forms:d})}return s},WorkflowManager.getSpaceForms=function(t){var e=new Array,n;return db.forms.find().forEach((function(t){e.push(t)})),e},WorkflowManager.isPaidSpace=function(t){var e=!1,n;return db.spaces.findOne({_id:t})&&(e=!0),e},WorkflowManager.isArrearageSpace=function(){var t=Session.get("spaceId"),e;return!db.spaces.findOne({_id:t})},Meteor.isClient&&(WorkflowManager.getStepDealTypeName=function(t){var e="";switch(t.deal_type){case"pickupAtRuntime":e="审批时指定人员";break;case"specifyUser":e="指定人员";break;case"applicantRole":e="指定审批岗位";break;case"applicantSuperior":e="提交人上级";break;case"applicant":e="提交人";break;case"orgField":e="指定部门"}return e}),WorkflowManager.hasFlowAdminPermission=function(t,e,n){var a=db.spaces.findOne(e);if(!a)return!1;if(a.admins&&a.admins.includes(n))return!0;var o=!1,r=db.space_users.findOne({space:e,user:n},{fields:{organizations:1,user:1}});if(r){var s=db.organizations.find({_id:{$in:r.organizations}},{fields:{parents:1}}).fetch(),i=db.flows.findOne({_id:t},{fields:{perms:1}});i&&s&&(o=WorkflowManager.canAdmin(i,r,s))}return o},WorkflowManager.alertFlowListModel=function(t){var e="flow_list_box_modal";Meteor.settings.public&&Meteor.settings.public.is_group_company&&(e="flow_list_box_modal"),Modal.show(e,t)}},"node_manager.js":function e(n){var a,o,r,s,i,l;NodeManager={},Steedos.isNode()&&(o=nw.require("path"),r=nw.require("fs"),s=nw.require("crypto"),a=nw.Window.get(),(l=nw.require("child_process"))&&(i=l.exec),a.disableClose=!1),NodeManager.uploadAttach=function(t,e,n){for(var a=Math.random().toString(16),s="\r\n----"+a+"--",i=t,l=e,c=0,u=new Array,d=0;d0||1==n)&&o.push({urlKey:"main",urlValue:!0});var s=[{urlKey:"file",urlValue:t}];OfficeOnline.uploadFile(o,s),Modal.hide("attachments_upload_modal")},NodeManager.signPdf=function(t,e){$(document.body).addClass("loading"),$(".loading-text").text(TAPi18n.__("workflow_attachment_uploading")+e+"...");var n=[{urlKey:"Content-Type",urlValue:cfs.getContentType(e)},{urlKey:"instance",urlValue:Session.get("attach_instance_id")},{urlKey:"space",urlValue:Session.get("attach_space_id")},{urlKey:"approve",urlValue:InstanceManager.getMyApprove().id},{urlKey:"owner",urlValue:Meteor.userId()},{urlKey:"owner_name",urlValue:Meteor.user().name},{urlKey:"upload_from",urlValue:"node"},{urlKey:"is_private",urlValue:!0}],a=[{urlKey:"file",urlValue:t}];OfficeOnline.uploadFile(n,a),Modal.hide("attachments_upload_modal")},NodeManager.getFileSHA1=function(t,e,n){var a=r.createReadStream(t),o=s.createHash("sha1");o.setEncoding("hex"),a.pipe(o),a.on("end",(function(){o.end();var t=o.read();n(t)}))},NodeManager.vbsEditFile=function(e,n,o){var s=e+n,l,c='"'+process.cwd()+'"\\vbs\\edit.vbs "'+s+'" '+Meteor.users.findOne().name;"Steedos.User.isSignature"==o?(c='start "" /wait "'+s+'"',Modal.show("attachments_sign_modal",{filePath:s})):Modal.show("attachments_upload_modal",{filePath:s});var u=100,d,p,f;Meteor.settings.public&&Meteor.settings.public.cfs&&Meteor.settings.public.cfs.size_limit&&(u=Meteor.settings.public.cfs.size_limit);var _=(null!=(d=Meteor.settings)&&null!=(p=d.public)&&null!=(f=p.workflow)?f.attachment_size_limit:void 0)||100,m,b;_&&(u=1024*_*1024),m=1024*u*1024,b=t("workflow_attachment_paid_size_limit")+u+"MB";var g=i(c);a.disableClose=!0,g.on("error",(function(t){toastr.error(t)})),g.on("close",(function(){"Steedos.User.isSignature"==o&&(s=e+(n="签章:"+n),r.exists(s,(function(e){0==e&&(Modal.hide("attachments_sign_modal"),InstanceManager.unlockAttach(Session.get("cfs_file_id")),toastr.warning(t("node_pdf_error")))}))),Modal.hide("attachments_upload_modal");var i=r.statSync(s);a.disableClose=!1,NodeManager.getFileSHA1(s,n,(function(a){if(NodeManager.fileSHA1!=a){var l={title:t("node_office_warning"),text:s,type:"warning",showCancelButton:!0,confirmButtonText:t("node_office_confirm"),cancelButtonText:t("node_office_cancel")};i.size>m&&(l.closeOnConfirm=!1),swal(l,(function(a){a?i.size>m?swal({title:b,type:"warning",confirmButtonText:t("node_office_confirm"),closeOnConfirm:!0},(function(){NodeManager.vbsEditFile(e,n)})):"Steedos.User.isNewFile"==o?NodeManager.setUploadRequests(s,n,!0,!0):InstanceManager.isAttachLocked(Session.get("attach_instance_id"),Meteor.userId())?"Steedos.User.isSignature"==o?r.exists(s,(function(e){1==e?NodeManager.signPdf(s,n):(Modal.hide("attachments_sign_modal"),InstanceManager.unlockAttach(Session.get("cfs_file_id")),toastr.error(t("node_pdf_error")))})):NodeManager.setUploadRequests(s,n,!1,!0):toastr.warning(t("steedos_desktop_edit_warning")):InstanceManager.unlockAttach(Session.get("cfs_file_id"))}))}else InstanceManager.unlockAttach(Session.get("cfs_file_id"))}))}))},NodeManager.downloadFile=function(t,e,n){var a=process.env.USERPROFILE+"\\Steedos\\";r.exists(a,(function(o){1==o?OfficeOnline.downloadFile(t,a,e,n):r.mkdir(a,(function(o){o?toastr.error(o):OfficeOnline.downloadFile(t,a,e,n)}))}))},NodeManager.isViewType=function(t){return!!(Steedos.isOfficeFile(t)||Steedos.isPdfFile(t)||Steedos.isExcelFile(t)||Steedos.isTiffFile(t)||Steedos.isPPTFile(t)||Steedos.isTextFile(t))}},"instance_readonly_template.coffee":function module(require){__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};var share=__coffeescriptShare,_getLocale,_getRequiredFields,_getStartStepEditableFields,_getStartStepRequiredFields,_getTemplateData,_getViewHtml,getLinkText,marked;marked=require("marked"),InstanceReadOnlyTemplate={},InstanceReadOnlyTemplate.instance_attachment='\n\t\n\t\t{{this.name}}\n\t\n',InstanceReadOnlyTemplate.afSelectUserRead="
{{value}}
",InstanceReadOnlyTemplate.afFormGroupRead='
\n\t{{#with getField this.name}}\n\t\t{{#if equals type \'section\'}}\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

{{{description}}}

\n\t\t\t\t
\n\t\t{{else}}\n\t\t\t{{#if equals type \'table\'}}\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{{{description}}}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t{{{getTableThead this}}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t{{{getTableBody this}}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t{{else}}\n\t\t\t\t{{#if showLabel}}\n\t\t\t\t\t\n\t\t\t\t{{/if}}\n\t\t\t\t{{#if isTextarea this}}\n\t\t\t\t\t

{{{getValue code}}}

\n\t\t\t\t{{else}}\n\t\t\t\t\t
{{{getValue code}}}
\n\t\t\t\t{{/if}}\n\t\t\t{{/if}}\n\t\t{{/if}}\n\t{{/with}}\n
',InstanceReadOnlyTemplate.afFormGroup='\n{{#with getField this.name}}\n\t\t{{#if equals type \'section\'}}\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

{{{description}}}

\n\t\t\t\t
\n \t\t\t\t
\n\t\t{{else}}\n\t\t\t{{#if equals type \'table\'}}\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{{{description}}}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t{{{getTableThead this}}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t{{{getTableBody this}}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t{{else}}\n\t\t\t\t{{#if equals type \'input\'}}\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t{{#if is_textarea}}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t{{#unless is_textarea}}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{{/unless}}\n\t\t\t\t\t
\n\t\t\t\t{{else}}\n\t\t\t\t\t{{#if equals type \'number\'}}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t{{else}}\n\t\t\t\t\t\t{{#if equals type \'date\'}}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t{{#if equals type \'dateTime\'}}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t{{#if equals type \'password\'}}\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t\t{{#if equals type \'select\'}}\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t\t\t{{#if equals type \'radio\'}}\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t{{#each options this}}\n \t\t\t\t\t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t\t\t\t\t\t{{/each}}\n \t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t\t\t\t{{#if equals type \'multiSelect\'}}\n\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{{#each options this}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{{/each}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t\t\t\t\t{{#if equals type \'url\'}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t{{#if equals type \'email\'}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{{#if equals type \'checkbox\'}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
{{{getValue code}}}
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t{{/if}}\n\t\t\t\t{{/if}}\n\t\t\t{{/if}}\n\t\t{{/if}}\n\t{{/with}}',InstanceReadOnlyTemplate.create=function(tempalteName,steedosData){var template,templateCompiled,templateRenderFunction;return template=InstanceReadOnlyTemplate[tempalteName],templateCompiled=SpacebarsCompiler.compile(template,{isBody:!0}),templateRenderFunction=eval(templateCompiled),Template[tempalteName]=new Blaze.Template(tempalteName,templateRenderFunction),Template[tempalteName].steedosData=steedosData,Template[tempalteName].helpers(InstanceformTemplate.helpers)},InstanceReadOnlyTemplate.createInstanceSignText=function(steedosData){var instanceSignTextCompiled,instanceSignTextHtml,instanceSignTextRenderFunction;return instanceSignTextHtml=_getViewHtml("client/views/instance/instance_sign_text.html"),instanceSignTextCompiled=SpacebarsCompiler.compile(instanceSignTextHtml,{isBody:!0}),instanceSignTextRenderFunction=eval(instanceSignTextCompiled),Template.instanceSignText=new Blaze.Template("instanceSignText",instanceSignTextRenderFunction),Template.instanceSignText.steedosData=steedosData,Template.instanceSignText.helpers(InstanceSignText.helpers)},InstanceReadOnlyTemplate.createImageSign=function(steedosData){var imageSignCompiled,imageSignHtml,imageSignRenderFunction;return imageSignHtml=_getViewHtml("client/views/instance/image_sign.html"),imageSignCompiled=SpacebarsCompiler.compile(imageSignHtml,{isBody:!0}),imageSignRenderFunction=eval(imageSignCompiled),Template.imageSign=new Blaze.Template("imageSign",imageSignRenderFunction),Template.imageSign.steedosData=steedosData,Template.imageSign.helpers(ImageSign.helpers)},InstanceReadOnlyTemplate.createTracesHanlder=function(steedosData){var tracesHanlderCompiled,tracesHanlderHtml,tracesHanlderRenderFunction;return tracesHanlderHtml=_getViewHtml("client/views/instance/traces_handler.html"),tracesHanlderCompiled=SpacebarsCompiler.compile(tracesHanlderHtml,{isBody:!0}),tracesHanlderRenderFunction=eval(tracesHanlderCompiled),Template.instance_traces_handler=new Blaze.Template("instance_traces_handler",tracesHanlderRenderFunction),Template.instance_traces_handler.steedosData=steedosData,Template.instance_traces_handler.helpers(TracesHandler.helpers)},InstanceReadOnlyTemplate.init=function(t){if(InstanceReadOnlyTemplate.create("afSelectUserRead",t),Meteor.isServer&&InstanceReadOnlyTemplate.create("afFormGroup",t),InstanceReadOnlyTemplate.create("afFormGroupRead",t),Meteor.isServer)return InstanceReadOnlyTemplate.create("instance_attachment",{absolute:t.absolute}),InstanceReadOnlyTemplate.createImageSign(t),InstanceReadOnlyTemplate.createTracesHanlder(t),InstanceReadOnlyTemplate.createInstanceSignText(t)},getLinkText=function(t,e,n){return n?(n=n.replace("{_id}",t._id),/^http(s?):\/\//.test(n)||(n=Steedos.absoluteUrl(n)),''+e+""):e},InstanceReadOnlyTemplate.getValue=function(t,e,n,a){var o,r,s,i,l,c,u,d,p,f,m,b,g,h,w,S,v,k;if(!t&&!1!==t)return"";switch(["select","multiSelect","radio"].indexOf(e.type)>-1&&(i=e.options.split("\n").map((function(t){var e;return{label:(e=t.split(":"))[0],value:e[1]||t}}))),e.type){case"email":t=t?""+t+"":"";break;case"url":if(t)if(0===t.indexOf("http"))try{t=""+t+""}catch(T){s=T,t=""+t+""}else t=""+t+"";else t="";break;case"group":t=e.is_multiselect?null!=t?t.getProperty("fullname").toString():void 0:null!=t?t.fullname:void 0;break;case"user":t=e.is_multiselect?null!=t?t.getProperty("name").toString():void 0:null!=t?t.name:void 0;break;case"password":t="******";break;case"checkbox":t=t&&"false"!==t?TAPi18n.__("form_field_checkbox_yes",{},n):TAPi18n.__("form_field_checkbox_no",{},n);break;case"dateTime":t&&16===t.length?(w=(h=t.split("T"))[0].split("-"),S=h[1].split(":"),k=w[0],c=w[1],o=w[2],l=S[0],f=S[1],t=new Date(k,c-1,o,l,f)):t=new Date(t),t=InstanceReadOnlyTemplate.formatDate(t,a);break;case"time":t&&16===t.length?(w=(h=t.split("T"))[0].split("-"),S=h[1].split(":"),k=w[0],c=w[1],o=w[2],l=S[0],f=S[1],t=new Date(k,c-1,o,l,f)):t=new Date(t),t=InstanceReadOnlyTemplate.formatTime(t);break;case"input":e.is_textarea&&(t=t);break;case"select":case"radio":(m=i.find((function(e){return e.value===t})))&&(t=m.label);break;case"multiSelect":g=t.split(","),(b=i.filter((function(t){return g.indexOf(t.value)>-1}))).length&&(t=b.map((function(t){return t.label})).join(","));break;case"number":(t||0===t)&&(t=e.is_percent?Steedos.numberToPercentString(t,e.digits):Steedos.numberToString(t,e.digits));break;case"odata":r=e.detail_url,t=e.is_multiselect?_.map(t,(function(t){return getLinkText(t,t["@label"],r)})):getLinkText(t,t["@label"],r);break;case"image":t=e.is_multiselect?(t=_.map(t,(function(t){return'
'}))).join(""):'
';break;case"file":t&&(e.is_multiselect||(t=[t]),Meteor.isClient?d=(p=Steedos.authRequest('/api/v1/cfs_files_filerecord?filters=[["_id","in", '+JSON.stringify(t)+']]&fields=["_id","original"]',{async:!1})).data.items:Meteor.isServer&&(d=Steedos.objectFind("cfs_files_filerecord",{filters:[["_id","in",t]],fields:["_id","original"]})),t=(t=_.map(d,(function(t){var e,n,a;return e=t.original.name,a=Steedos.absoluteUrl("/api/files/files/"+t._id),n="",[".pdf",".jpg",".jpeg",".png",".gif"].indexOf(e.slice(-4))>-1&&(n=" 预览"),"
"+e+" "+(null!=n?n:{filePreviewHtml:""})+"
"}))).join(""));break;case"lookup":t&&(e.is_multiselect||(t=[t]),Meteor.isClient?(v=Creator.getObject(e.reference_to),u=(null!=v?v.NAME_FIELD_KEY:void 0)||"name",d=(p=Steedos.authRequest("/api/v1/"+e.reference_to+'?filters=[["'+(e.reference_to_field||"_id")+'","in", '+JSON.stringify(t)+']]&fields=["_id","'+u+'"]',{async:!1})).data.items):Meteor.isServer&&(u=Steedos.getObjectNameFieldKey(e.reference_to),d=Steedos.objectFind(e.reference_to,{filters:[[e.reference_to_field||"_id","in",t]],fields:["_id",u]})),t=(t=_.map(d,(function(t){return""+t[u]+""}))).join(" , "));break;case"html":t=t?'
'+t+"
":""}return t},InstanceReadOnlyTemplate.getLabel=function(t,e){var n;if(n=t.findPropertyByPK("code",e))return n.name?n.name:n.code},InstanceReadOnlyTemplate.getInstanceFormVersion=function(t){var e,n,a;return e=db.forms.findOne(t.form),a={},n=[],(a=e.current._id===t.form_version?e.current:_.where(e.historys,{_id:t.form_version})[0]).fields.forEach((function(t){return"section"!==t.type?"table"===t.type?(t.sfields=t.fields,delete t.fields,n.push(t)):n.push(t):(n.push(t),t.fields?t.fields.forEach((function(t){return n.push(t)})):void 0)})),a.fields=n,a},InstanceReadOnlyTemplate.getFlowVersion=function(t){var e,n;return n={},n=(e=db.flows.findOne(t.flow)).current._id===t.flow_version?e.current:_.where(e.historys,{_id:t.flow_version})[0]},_getViewHtml=function(t){var e;return(e=Assets.getText(t))&&(e=e.replace(//i,"").replace(/<\/template>/i,"")),e},_getLocale=function(t){var e,n,a;return e="zh-cn"===(null!=t&&null!=(n=t.locale)?n.toLocaleLowerCase():void 0)?"zh-CN":"en-us"===(null!=t&&null!=(a=t.locale)?a.toLocaleLowerCase():void 0)?"en":"zh-CN"},_getRequiredFields=function(t,e){return e||(e=[]),t.forEach((function(t){if("section"===t.type)return _getRequiredFields(t.fields,e);if("table"===t.type);else if(t.is_required)return e.push(t.code)})),e},_getStartStepEditableFields=function(t,e){var n,a;return a=e.findPropertyByPK("step_type","start"),n=[],_.keys(a.permissions).forEach((function(t){if("editable"===a.permissions[t])return n.push(t)})),n},_getStartStepRequiredFields=function(t,e){var n,a;return a=_getRequiredFields(t),n=_getStartStepEditableFields(t,e),_.intersection(a,n)},_getTemplateData=function(t,e,n,a){var o,r,s,i,l;return s=Meteor.isServer?InstanceReadOnlyTemplate.getInstanceFormVersion(n):WorkflowManager.getInstanceFormVersion(n),i=_getLocale(t),l={},Meteor.isClient&&((l=_.clone(WorkflowManager_format.getAutoformSchemaValues())).insname=n.name,l.ins_state=n.state,l.ins_final_decision=n.ins_final_decision,l.ins_code=n.code,l.ins_is_archived=n.is_archived,l.ins_is_deleted=n.ins_is_deleted,l.applicant_name=n.applicant_name,l.applicantContext=n.applicant_name),l.instance=n,l.form_version=s,l.locale=i,l.utcOffset=t.utcOffset,l.space=n.space,l.sessionUserId=t._id,Meteor.isServer&&(null!=a?a.editable:void 0)&&(r=db.forms.findOne({_id:n.form}),o=db.flows.findOne({_id:n.flow}),l.startStepEditableFields=_getStartStepEditableFields(r.current.fields,o.current.steps)),l},InstanceReadOnlyTemplate.formatDate=function(t,e){var n;return n=!Meteor.isServer,e||0===e||(e=8),moment(t).utcOffset(e,n).format("YYYY-MM-DD HH:mm")},InstanceReadOnlyTemplate.formatTime=function(t){var e;return e=0,moment(t).utcOffset(0).format("HH:mm")},InstanceReadOnlyTemplate.getInstanceView=function(user,space,instance,options){var body,instanceCompiled,instanceRenderFunction,instanceTemplate,steedosData;return steedosData=_getTemplateData(user,space,instance,options),steedosData.absolute=!1,(null!=options?options.absolute:void 0)&&(steedosData.absolute=!0),instanceTemplate=TemplateManager.getTemplate(instance,null!=options?options.templateName:void 0),instanceTemplate=instanceTemplate.replace(/afSelectUser/g,"afSelectUserRead"),(null!=options?options.editable:void 0)||(instanceTemplate=instanceTemplate.replace(/afFormGroup/g,"afFormGroupRead")),instanceCompiled=SpacebarsCompiler.compile(instanceTemplate,{isBody:!0}),instanceRenderFunction=eval(instanceCompiled),Template.instance_readonly_view=new Blaze.Template("instance_readonly_view",instanceRenderFunction),Template.instance_readonly_view.steedosData=steedosData,Template.instance_readonly_view.helpers(InstanceformTemplate.helpers),InstanceReadOnlyTemplate.init(steedosData),body=Blaze.toHTMLWithData(Template.instance_readonly_view,steedosData),"
\n\t"+body+"\n
"},InstanceReadOnlyTemplate.getTracesView=function(user,space,instance,options){var body,form,steedosData,traceCompiled,traceRenderFunction,tracesHtml;return steedosData=_getTemplateData(user,space,instance),form=db.forms.findOne(instance.form),tracesHtml="table"===form.instance_style||"table"===(null!=options?options.templateName:void 0)?_getViewHtml("client/views/instance/traces_table.html"):_getViewHtml("client/views/instance/traces.html"),traceCompiled=SpacebarsCompiler.compile(tracesHtml,{isBody:!0}),traceRenderFunction=eval(traceCompiled),Template.trace_readonly_view=new Blaze.Template("trace_readonly_view",traceRenderFunction),Template.trace_readonly_view.steedosData=steedosData,Template.trace_readonly_view.helpers(TracesTemplate.helpers),body=Blaze.toHTMLWithData(Template.trace_readonly_view,instance.traces),body},InstanceReadOnlyTemplate.getAttachmentView=function(user,space,instance){var attachmentCompiled,attachmentHtml,attachmentRenderFunction,body,steedosData;return steedosData=_getTemplateData(user,space,instance),attachmentHtml=_getViewHtml("client/views/instance/instance_attachments.html"),attachmentCompiled=SpacebarsCompiler.compile(attachmentHtml,{isBody:!0}),attachmentRenderFunction=eval(attachmentCompiled),Template.attachments_readonly_view=new Blaze.Template("attachments_readonly_view",attachmentRenderFunction),Template.attachments_readonly_view.steedosData=steedosData,Template.attachments_readonly_view.helpers(InstanceAttachmentTemplate.helpers),body=Blaze.toHTMLWithData(Template.attachments_readonly_view),body},InstanceReadOnlyTemplate.getRelatedInstancesView=function(user,space,instance,options){var body,relatedInstancesCompiled,relatedInstancesHtml,relatedInstancesRenderFunction,steedosData;return steedosData=_getTemplateData(user,space,instance),steedosData.absolute=!1,(null!=options?options.absolute:void 0)&&(steedosData.absolute=!0),relatedInstancesHtml=_getViewHtml("client/views/instance/related_instances.html"),relatedInstancesCompiled=SpacebarsCompiler.compile(relatedInstancesHtml,{isBody:!0}),relatedInstancesRenderFunction=eval(relatedInstancesCompiled),Template.related_instances_view=new Blaze.Template("related_instances_view",relatedInstancesRenderFunction),Template.related_instances_view.steedosData=steedosData,Template.related_instances_view.helpers(RelatedInstances.helpers),body=Blaze.toHTMLWithData(Template.related_instances_view,steedosData),body},InstanceReadOnlyTemplate.getRelatedRecordsView=function(user,space,instance,options){var body,relatedRecordsCompiled,relatedRecordsHtml,relatedRecordsRenderFunction,steedosData;return steedosData=_getTemplateData(user,space,instance),steedosData.absolute=!1,(null!=options?options.absolute:void 0)&&(steedosData.absolute=!0),relatedRecordsHtml=_getViewHtml("client/views/instance/related_records.html"),relatedRecordsCompiled=SpacebarsCompiler.compile(relatedRecordsHtml,{isBody:!0}),relatedRecordsRenderFunction=eval(relatedRecordsCompiled),Template.related_records_view=new Blaze.Template("related_records_view",relatedRecordsRenderFunction),Template.related_records_view.steedosData=steedosData,Template.related_records_view.helpers(RelatedRecords.helpers),body=Blaze.toHTMLWithData(Template.related_records_view,steedosData),body},InstanceReadOnlyTemplate.getOnLoadScript=function(t){var e,n;return(e=(n=WorkflowManager.getFormVersion(t.form,t.form_version)).form_script)&&e.replace(/\n/g,"").replace(/\s/g,"").length>0?(e="CoreForm = {};CoreForm.instanceform = {};"+e)+";if(CoreForm.form_OnLoad){window.onload = CoreForm.form_OnLoad();}":""},InstanceReadOnlyTemplate.getInstanceHtml=function(t,e,n,a){var o,r,s,i,l,c,u,d,p,f,m,b,g,h,w,S,v,k,T,M,y,I,x,L,H;return s=InstanceReadOnlyTemplate.getInstanceView(t,e,n,a),w=InstanceReadOnlyTemplate.getOnLoadScript(n),i=null!=(v=Meteor.settings.public.webservices)&&null!=(k=v.creator)?k.url:void 0,f=n.record_ids,h=_getLocale(t),S='if(window.isNode && isNode()){\n\tattachs = document.getElementsByClassName("ins_attach_href");\n\tfor(var i = 0; i < attachs.length; i++){\n\t\tattach = attachs[i];\n\t\tattach.addEventListener("click", function(e){\n\t\t\tif(isImage(this.dataset.type) || isHtml(this.dataset.type)){\n\t\t\t\te.preventDefault();\n\t\t\t\topenWindow("/api/files/instances/" + this.dataset.id);\n\t\t\t}else if(nw_core.canOpenFile(this.dataset.name)){\n\t\t\t\te.preventDefault();\n\t\t\t\tnw_core.openFile(this.href, this.dataset.name)\n\t\t\t}\n\t\t});\n\t}\n}\n\nvar flow = "'+n.flow+'";\nvar space = "'+n.space+'";\n\nfunction getCookie(name){\n\tlet pattern = RegExp(name + "=.[^;]*")\n\tlet matched = document.cookie.match(pattern)\n\tif(matched){\n\t\tlet cookie = matched[0].split(\'=\')\n\t\treturn cookie[1]\n\t}\n\treturn \'\'\n}\n\nvar records = document.getElementsByClassName("ins-related-records");\nfor(var i = 0; i < records.length; i++){\n\t\tvar record = records[i];\n\t\trecord.addEventListener("click", function(e){\n\t\t\tvar creatorService = "'+i+'"\n\t\t\tvar ins_record_ids = '+JSON.stringify(f)+'\n\t\t\tif(creatorService && ins_record_ids && ins_record_ids.length > 0){\n\t\t\t\tvar objcetName = ins_record_ids[0].o\n\t\t\t\tvar id = ins_record_ids[0].ids[0]\n\t\t\t\tvar uobj = {};\n\t\t\t\tuobj["X-User-Id"] = getCookie("X-User-Id");\n\t\t\t\tuobj["X-Auth-Token"] = getCookie("X-Auth-Token");\n\t\t\t\tredirectUrl = creatorService + "app/-/" + objcetName + "/view/" + id + "?" + $.param(uobj);\n\t\t\t\topenWindow(redirectUrl);\n\t\t\t}\n\t\t});\n\t}\n',Steedos.isMobile()||"table"===(null!=(c=db.forms.findOne(n.form))?c.instance_style:void 0)&&(b="instance-table"),"table"===(null!=a?a.templateName:void 0)&&(b="instance-table"),(null!=a?a.instance_style:void 0)&&(b=a.instance_style),x=a&&!0!==a.showTrace?"":InstanceReadOnlyTemplate.getTracesView(t,e,n),m="",n&&n.final_decision&&("approved"===n.final_decision?m="box-success":"rejected"===n.final_decision&&(m="box-danger")),a&&!0!==a.showAttachments?(r="",T="",M=""):(r=InstanceReadOnlyTemplate.getAttachmentView(t,e,n),T=InstanceReadOnlyTemplate.getRelatedInstancesView(t,e,n,a),M=InstanceReadOnlyTemplate.getRelatedRecordsView(t,e,n,a)),H="960px",(null!=a?a.width:void 0)&&(H=""),l=Meteor.absoluteUrl("steedos-css"),g=Meteor.absoluteUrl("website/libs/jquery.min.js"),o='',L="",_.isEmpty(x)||(L="checked"),y="email"===(null!=a?a.tagger:void 0)||(null!=a?a.editable:void 0)?"":'",I="$( document ).ready(function(){\n\tvar b = document.getElementById('cbx-print-traces');\n\tvar t = document.getElementsByClassName('instance-traces')[0];\n\tif (b && b.checked && t){\n\t\tt.style = 'display: block;'\n\t} else if(t){\n\t\tt.style = 'display: none;'\n\t}\n\tif(b){\n\t\tb.addEventListener('change', function(e){\n\t\t\tif (e.target.checked){\n\t\t\t\tt.style = 'display: block;'\n\t\t\t} else {\n\t\t\t\tt.style = 'display: none;'\n\t\t\t}\n\t\t});\n\t}\n\n\n\tvar attachmentsCheckbox = document.getElementById('cbx-print-attachments');\n\tvar attachmentsView = document.getElementsByClassName('attachments-section')[0];\n\tif (attachmentsCheckbox && attachmentsCheckbox.checked && attachmentsView){\n\t\tattachmentsView.style = 'display: block;'\n\t} else if(attachmentsView){\n\t\tattachmentsView.style = 'display: none;'\n\t}\n\tif(attachmentsCheckbox){\n\t\tattachmentsCheckbox.addEventListener('change', function(e){\n\t\t\tif (e.target.checked){\n\t\t\t\tattachmentsView.style = 'display: block;'\n\t\t\t} else {\n\t\t\t\tattachmentsView.style = 'display: none;'\n\t\t\t}\n\t\t});\n\t}\n});\n",(null!=a?a.styles:void 0)&&(o=""),d="",(c=db.forms.findOne({_id:n.form}))&&(u=c.description)&&(d='
\n\t
\n\t\t'+(u=u.replace(/\n/g,"
"))+"\n\t
\n
"),p='\n\n\t\n\t\t\n\t\t'+o+'\n\t\t