diff options
Diffstat (limited to 'plugins')
7 files changed, 169 insertions, 92 deletions
diff --git a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js index f720642de8..d3eeab0939 100644 --- a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js +++ b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js @@ -789,29 +789,29 @@ function FieldMultituplevue_type_template_id_7469c188_render(_ctx, _cache, $prop FieldMultituplevue_type_script_lang_ts.render = FieldMultituplevue_type_template_id_7469c188_render /* harmony default export */ var FieldMultituple = (FieldMultituplevue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue?vue&type=template&id=4035c8ac +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue?vue&type=template&id=b6f05a1e -var FieldNumbervue_type_template_id_4035c8ac_hoisted_1 = ["type", "id", "name", "value"]; -var FieldNumbervue_type_template_id_4035c8ac_hoisted_2 = ["for", "innerHTML"]; -function FieldNumbervue_type_template_id_4035c8ac_render(_ctx, _cache, $props, $setup, $data, $options) { +var FieldNumbervue_type_template_id_b6f05a1e_hoisted_1 = ["type", "id", "name", "value"]; +var FieldNumbervue_type_template_id_b6f05a1e_hoisted_2 = ["for", "innerHTML"]; +function FieldNumbervue_type_template_id_b6f05a1e_render(_ctx, _cache, $props, $setup, $data, $options) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ class: "control_".concat(_ctx.uiControl), type: _ctx.uiControl, id: _ctx.name, name: _ctx.name, - value: (_ctx.modelValue || '0').toString(), + value: _ctx.modelValueFormatted, onKeydown: _cache[0] || (_cache[0] = function ($event) { return _ctx.onChange($event); }), onChange: _cache[1] || (_cache[1] = function ($event) { return _ctx.onChange($event); }) - }, _ctx.uiControlAttributes), null, 16, FieldNumbervue_type_template_id_4035c8ac_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { + }, _ctx.uiControlAttributes), null, 16, FieldNumbervue_type_template_id_b6f05a1e_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { for: _ctx.name, innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldNumbervue_type_template_id_4035c8ac_hoisted_2)], 64); + }, null, 8, FieldNumbervue_type_template_id_b6f05a1e_hoisted_2)], 64); } -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue?vue&type=template&id=4035c8ac +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue?vue&type=template&id=b6f05a1e // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue?vue&type=script&lang=ts @@ -831,11 +831,17 @@ function FieldNumbervue_type_template_id_4035c8ac_render(_ctx, _cache, $props, $ }, methods: { onChange: function onChange(event) { - var value = parseFloat(event.target.value); // change to previous value so the parent component can determine if this change should - // go through + var _this = this; - event.target.value = (this.modelValue || '').toString(); + var value = parseFloat(event.target.value); this.$emit('update:modelValue', value); + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { + if (event.target.value !== _this.modelValueFormatted) { + // change to previous value if the parent component did not update the model value + // (done manually because Vue will not notice if a value does NOT change) + event.target.value = _this.modelValueFormatted; + } + }); } }, mounted: function mounted() { @@ -847,6 +853,11 @@ function FieldNumbervue_type_template_id_4035c8ac_render(_ctx, _cache, $props, $ window.Materialize.updateTextFields(); }); } + }, + computed: { + modelValueFormatted: function modelValueFormatted() { + return (this.modelValue || '').toString(); + } } })); // CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue?vue&type=script&lang=ts @@ -855,7 +866,7 @@ function FieldNumbervue_type_template_id_4035c8ac_render(_ctx, _cache, $props, $ -FieldNumbervue_type_script_lang_ts.render = FieldNumbervue_type_template_id_4035c8ac_render +FieldNumbervue_type_script_lang_ts.render = FieldNumbervue_type_template_id_b6f05a1e_render /* harmony default export */ var FieldNumber = (FieldNumbervue_type_script_lang_ts); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldRadio.vue?vue&type=template&id=37349c90 @@ -1339,11 +1350,11 @@ function FieldSitevue_type_template_id_50ac73cc_render(_ctx, _cache, $props, $se FieldSitevue_type_script_lang_ts.render = FieldSitevue_type_template_id_50ac73cc_render /* harmony default export */ var FieldSite = (FieldSitevue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue?vue&type=template&id=71eb4e7e +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue?vue&type=template&id=66d5a68a -var FieldTextvue_type_template_id_71eb4e7e_hoisted_1 = ["type", "id", "name", "value"]; -var FieldTextvue_type_template_id_71eb4e7e_hoisted_2 = ["for", "innerHTML"]; -function FieldTextvue_type_template_id_71eb4e7e_render(_ctx, _cache, $props, $setup, $data, $options) { +var FieldTextvue_type_template_id_66d5a68a_hoisted_1 = ["type", "id", "name", "value"]; +var FieldTextvue_type_template_id_66d5a68a_hoisted_2 = ["for", "innerHTML"]; +function FieldTextvue_type_template_id_66d5a68a_render(_ctx, _cache, $props, $setup, $data, $options) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ class: "control_".concat(_ctx.uiControl), type: _ctx.uiControl, @@ -1356,12 +1367,12 @@ function FieldTextvue_type_template_id_71eb4e7e_render(_ctx, _cache, $props, $se onChange: _cache[1] || (_cache[1] = function ($event) { return _ctx.onKeydown($event); }) - }, _ctx.uiControlAttributes), null, 16, FieldTextvue_type_template_id_71eb4e7e_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { + }, _ctx.uiControlAttributes), null, 16, FieldTextvue_type_template_id_66d5a68a_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { for: _ctx.name, innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldTextvue_type_template_id_71eb4e7e_hoisted_2)], 64); + }, null, 8, FieldTextvue_type_template_id_66d5a68a_hoisted_2)], 64); } -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue?vue&type=template&id=71eb4e7e +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue?vue&type=template&id=66d5a68a // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue?vue&type=script&lang=ts @@ -1403,13 +1414,19 @@ function FieldTextvue_type_template_id_71eb4e7e_render(_ctx, _cache, $props, $se }, methods: { onKeydown: function onKeydown(event) { + var _this = this; + var newValue = event.target.value; if (this.modelValue !== newValue) { - // change to previous value so the parent component can determine if this change should - // go through - event.target.value = this.modelValueText; this.$emit('update:modelValue', newValue); + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { + if (event.target.value !== _this.modelValueText) { + // change to previous value if the parent component did not update the model value + // (done manually because Vue will not notice if a value does NOT change) + event.target.value = _this.modelValueText; + } + }); } } } @@ -1420,18 +1437,18 @@ function FieldTextvue_type_template_id_71eb4e7e_render(_ctx, _cache, $props, $se -FieldTextvue_type_script_lang_ts.render = FieldTextvue_type_template_id_71eb4e7e_render +FieldTextvue_type_script_lang_ts.render = FieldTextvue_type_template_id_66d5a68a_render /* harmony default export */ var FieldText = (FieldTextvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue?vue&type=template&id=50c28130 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue?vue&type=template&id=2c4e387e -var FieldTextArrayvue_type_template_id_50c28130_hoisted_1 = ["for", "innerHTML"]; -var FieldTextArrayvue_type_template_id_50c28130_hoisted_2 = ["type", "name", "value"]; -function FieldTextArrayvue_type_template_id_50c28130_render(_ctx, _cache, $props, $setup, $data, $options) { +var FieldTextArrayvue_type_template_id_2c4e387e_hoisted_1 = ["for", "innerHTML"]; +var FieldTextArrayvue_type_template_id_2c4e387e_hoisted_2 = ["type", "name", "value"]; +function FieldTextArrayvue_type_template_id_2c4e387e_render(_ctx, _cache, $props, $setup, $data, $options) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { for: _ctx.name, innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldTextArrayvue_type_template_id_50c28130_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ + }, null, 8, FieldTextArrayvue_type_template_id_2c4e387e_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ class: "control_".concat(_ctx.uiControl), type: _ctx.uiControl, name: _ctx.name, @@ -1442,9 +1459,9 @@ function FieldTextArrayvue_type_template_id_50c28130_render(_ctx, _cache, $props return _ctx.onKeydown($event); }), value: _ctx.concattedValues - }, _ctx.uiControlAttributes), null, 16, FieldTextArrayvue_type_template_id_50c28130_hoisted_2)]); + }, _ctx.uiControlAttributes), null, 16, FieldTextArrayvue_type_template_id_2c4e387e_hoisted_2)]); } -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue?vue&type=template&id=50c28130 +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue?vue&type=template&id=2c4e387e // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue?vue&type=script&lang=ts @@ -1474,15 +1491,21 @@ function FieldTextArrayvue_type_template_id_50c28130_render(_ctx, _cache, $props }, methods: { onKeydown: function onKeydown(event) { + var _this = this; + var values = event.target.value.split(',').map(function (v) { return v.trim(); }); if (values.join(', ') !== this.concattedValues) { - // change to previous value so the parent component can determine if this change should - // go through - event.target.value = this.concattedValues; this.$emit('update:modelValue', values); + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { + if (event.target.value !== _this.concattedValues) { + // change to previous value if the parent component did not update the model value + // (done manually because Vue will not notice if a value does NOT change) + event.target.value = _this.concattedValues; + } + }); } } } @@ -1493,19 +1516,19 @@ function FieldTextArrayvue_type_template_id_50c28130_render(_ctx, _cache, $props -FieldTextArrayvue_type_script_lang_ts.render = FieldTextArrayvue_type_template_id_50c28130_render +FieldTextArrayvue_type_script_lang_ts.render = FieldTextArrayvue_type_template_id_2c4e387e_render /* harmony default export */ var FieldTextArray = (FieldTextArrayvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue?vue&type=template&id=b3b8d82a +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue?vue&type=template&id=48b83e34 -var FieldTextareavue_type_template_id_b3b8d82a_hoisted_1 = ["name", "id", "value"]; -var FieldTextareavue_type_template_id_b3b8d82a_hoisted_2 = ["for", "innerHTML"]; -function FieldTextareavue_type_template_id_b3b8d82a_render(_ctx, _cache, $props, $setup, $data, $options) { +var FieldTextareavue_type_template_id_48b83e34_hoisted_1 = ["name", "id", "value"]; +var FieldTextareavue_type_template_id_48b83e34_hoisted_2 = ["for", "innerHTML"]; +function FieldTextareavue_type_template_id_48b83e34_render(_ctx, _cache, $props, $setup, $data, $options) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("textarea", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ name: _ctx.name }, _ctx.uiControlAttributes, { id: _ctx.name, - value: _ctx.modelValue, + value: _ctx.modelValueText, onKeydown: _cache[0] || (_cache[0] = function ($event) { return _ctx.onKeydown($event); }), @@ -1514,12 +1537,12 @@ function FieldTextareavue_type_template_id_b3b8d82a_render(_ctx, _cache, $props, }), class: "materialize-textarea", ref: "textarea" - }), null, 16, FieldTextareavue_type_template_id_b3b8d82a_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { + }), null, 16, FieldTextareavue_type_template_id_48b83e34_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { for: _ctx.name, innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldTextareavue_type_template_id_b3b8d82a_hoisted_2)], 64); + }, null, 8, FieldTextareavue_type_template_id_48b83e34_hoisted_2)], 64); } -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue?vue&type=template&id=b3b8d82a +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue?vue&type=template&id=48b83e34 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue?vue&type=script&lang=ts @@ -1538,28 +1561,42 @@ function FieldTextareavue_type_template_id_b3b8d82a_render(_ctx, _cache, $props, }, methods: { onKeydown: function onKeydown(event) { + var _this = this; + var newValue = event.target.value; // change to previous value so the parent component can determine if this change should // go through - event.target.value = this.modelValue || ''; + event.target.value = this.modelValueText; this.$emit('update:modelValue', newValue); + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { + if (event.target.value !== _this.modelValueText) { + // change to previous value if the parent component did not update the model value + // (done manually because Vue will not notice if a value does NOT change) + event.target.value = _this.modelValueText; + } + }); + } + }, + computed: { + modelValueText: function modelValueText() { + return this.modelValue || ''; } }, watch: { modelValue: function modelValue() { - var _this = this; + var _this2 = this; setTimeout(function () { - window.Materialize.textareaAutoResize(_this.$refs.textarea); + window.Materialize.textareaAutoResize(_this2.$refs.textarea); window.Materialize.updateTextFields(); }); } }, mounted: function mounted() { - var _this2 = this; + var _this3 = this; setTimeout(function () { - window.Materialize.textareaAutoResize(_this2.$refs.textarea); + window.Materialize.textareaAutoResize(_this3.$refs.textarea); window.Materialize.updateTextFields(); }); } @@ -1570,18 +1607,18 @@ function FieldTextareavue_type_template_id_b3b8d82a_render(_ctx, _cache, $props, -FieldTextareavue_type_script_lang_ts.render = FieldTextareavue_type_template_id_b3b8d82a_render +FieldTextareavue_type_script_lang_ts.render = FieldTextareavue_type_template_id_48b83e34_render /* harmony default export */ var FieldTextarea = (FieldTextareavue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue?vue&type=template&id=45372d69 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue?vue&type=template&id=49060005 -var FieldTextareaArrayvue_type_template_id_45372d69_hoisted_1 = ["for", "innerHTML"]; -var FieldTextareaArrayvue_type_template_id_45372d69_hoisted_2 = ["name", "value"]; -function FieldTextareaArrayvue_type_template_id_45372d69_render(_ctx, _cache, $props, $setup, $data, $options) { +var FieldTextareaArrayvue_type_template_id_49060005_hoisted_1 = ["for", "innerHTML"]; +var FieldTextareaArrayvue_type_template_id_49060005_hoisted_2 = ["name", "value"]; +function FieldTextareaArrayvue_type_template_id_49060005_render(_ctx, _cache, $props, $setup, $data, $options) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { for: _ctx.name, innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldTextareaArrayvue_type_template_id_45372d69_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("textarea", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ + }, null, 8, FieldTextareaArrayvue_type_template_id_49060005_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("textarea", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ ref: "textarea", name: _ctx.name }, _ctx.uiControlAttributes, { @@ -1593,9 +1630,9 @@ function FieldTextareaArrayvue_type_template_id_45372d69_render(_ctx, _cache, $p return _ctx.onKeydown($event); }), class: "materialize-textarea" - }), null, 16, FieldTextareaArrayvue_type_template_id_45372d69_hoisted_2)]); + }), null, 16, FieldTextareaArrayvue_type_template_id_49060005_hoisted_2)]); } -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue?vue&type=template&id=45372d69 +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue?vue&type=template&id=49060005 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue?vue&type=script&lang=ts @@ -1624,24 +1661,30 @@ var SEPARATOR = '\n'; }, methods: { onKeydown: function onKeydown(event) { + var _this = this; + var value = event.target.value.split(SEPARATOR); if (value.join(SEPARATOR) !== this.concattedValue) { - // change to previous value so the parent component can determine if this change should - // go through - event.target.value = this.concattedValue; this.$emit('update:modelValue', value); + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { + if (event.target.value !== _this.concattedValue) { + // change to previous value if the parent component did not update the model value + // (done manually because Vue will not notice if a value does NOT change) + event.target.value = _this.concattedValue; + } + }); } } }, watch: { modelValue: function modelValue(newVal, oldVal) { - var _this = this; + var _this2 = this; if (newVal !== oldVal) { setTimeout(function () { - if (_this.$refs.textarea) { - window.Materialize.textareaAutoResize(_this.$refs.textarea); + if (_this2.$refs.textarea) { + window.Materialize.textareaAutoResize(_this2.$refs.textarea); } window.Materialize.updateTextFields(); @@ -1650,11 +1693,11 @@ var SEPARATOR = '\n'; } }, mounted: function mounted() { - var _this2 = this; + var _this3 = this; setTimeout(function () { - if (_this2.$refs.textarea) { - window.Materialize.textareaAutoResize(_this2.$refs.textarea); + if (_this3.$refs.textarea) { + window.Materialize.textareaAutoResize(_this3.$refs.textarea); } window.Materialize.updateTextFields(); @@ -1667,7 +1710,7 @@ var SEPARATOR = '\n'; -FieldTextareaArrayvue_type_script_lang_ts.render = FieldTextareaArrayvue_type_template_id_45372d69_render +FieldTextareaArrayvue_type_script_lang_ts.render = FieldTextareaArrayvue_type_template_id_49060005_render /* harmony default export */ var FieldTextareaArray = (FieldTextareaArrayvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/utilities.ts diff --git a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js index 44cf7b9095..c9959381d2 100644 --- a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js +++ b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js @@ -1,10 +1,10 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue")):"function"===typeof define&&define.amd?define(["CoreHome"],t):"object"===typeof exports?exports["CorePluginsAdmin"]=t(require("CoreHome"),require("vue")):e["CorePluginsAdmin"]=t(e["CoreHome"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/CorePluginsAdmin/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"FormField",(function(){return Gt})),n.d(t,"Field",(function(){return en})),n.d(t,"PluginSettings",(function(){return Mn})),n.d(t,"PluginFilter",(function(){return io})),n.d(t,"PluginManagement",(function(){return In})),n.d(t,"PluginUpload",(function(){return qn})),n.d(t,"SaveButton",(function(){return so})),n.d(t,"Form",(function(){return po})),n.d(t,"GroupedSettings",(function(){return Sn})),"undefined"!==typeof window){var o=window.document.currentScript,i=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var r=n("19dc"),l=n("8bbf"),a={class:"form-group row matomo-form-field"},u={key:0,class:"col s12"},c={key:0,class:"form-help"},s={key:0,class:"inline-help",ref:"inlineHelp"},d=Object(l["createElementVNode"])("br",null,null,-1);function m(e,t,n,o,i,r){return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("div",a,[e.formField.introduction?(Object(l["openBlock"])(),Object(l["createElementBlock"])("h3",u,Object(l["toDisplayString"])(e.formField.introduction),1)):Object(l["createCommentVNode"])("",!0),Object(l["createElementVNode"])("div",{class:Object(l["normalizeClass"])(["col s12",{"input-field":"checkbox"!==e.formField.uiControl&&"radio"!==e.formField.uiControl,"file-field":"file"===e.formField.uiControl,m6:!e.formField.fullWidth}])},[(Object(l["openBlock"])(),Object(l["createBlock"])(Object(l["resolveDynamicComponent"])(e.childComponent),Object(l["mergeProps"])(Object.assign(Object.assign({formField:e.formField},e.formField),{},{modelValue:e.processedModelValue,availableOptions:e.availableOptions},e.extraChildComponentParams),{"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)})}),null,16))],2),Object(l["createElementVNode"])("div",{class:Object(l["normalizeClass"])(["col s12",{m6:!e.formField.fullWidth}])},[e.showFormHelp?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",c,[Object(l["withDirectives"])(Object(l["createElementVNode"])("div",{class:"form-description"},Object(l["toDisplayString"])(e.formField.description),513),[[l["vShow"],e.formField.description]]),e.formField.inlineHelp||e.hasInlineHelpSlot?(Object(l["openBlock"])(),Object(l["createElementBlock"])("span",s,[e.inlineHelpComponent?(Object(l["openBlock"])(),Object(l["createBlock"])(Object(l["resolveDynamicComponent"])(e.inlineHelpComponent),Object(l["normalizeProps"])(Object(l["mergeProps"])({key:0},e.inlineHelpBind)),null,16)):Object(l["createCommentVNode"])("",!0),Object(l["renderSlot"])(e.$slots,"inline-help")],512)):Object(l["createCommentVNode"])("",!0),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",null,[d,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("General_Default"))+": ",1),Object(l["createElementVNode"])("span",null,Object(l["toDisplayString"])(e.defaultValuePrettyTruncated),1)],512),[[l["vShow"],e.showDefaultValue]])])):Object(l["createCommentVNode"])("",!0)],2)],512)),[[l["vShow"],e.showField]])}var f={class:"checkbox"},p=["checked","id","name"],b=["innerHTML"];function v(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",f,[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},e.uiControlAttributes,{value:1,checked:e.isChecked,type:"checkbox",id:e.name,name:e.name}),null,16,p),Object(l["createElementVNode"])("span",{innerHTML:e.$sanitize(e.title)},null,8,b)])])}var h=Object(l["defineComponent"])({props:{modelValue:[Boolean,Number,String],uiControlAttributes:Object,name:String,title:String},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){var t=e.target.checked;this.modelValue!==t&&(e.target.checked=!t,this.$emit("update:modelValue",t))}},computed:{isChecked:function(){return!!this.modelValue&&"0"!==this.modelValue}}});h.render=v;var g=h,O={ref:"root"},y=["value","checked","onChange","id","name"];function j(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",O,[Object(l["withDirectives"])(Object(l["createElementVNode"])("label",{class:"fieldRadioTitle"},Object(l["toDisplayString"])(e.title),513),[[l["vShow"],e.title]]),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions,(function(t,n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("p",{key:n,class:"checkbox"},[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({value:t.key,checked:!!e.checkboxStates[n],onChange:function(t){return e.onChange(n)}},e.uiControlAttributes,{type:"checkbox",id:"".concat(e.name).concat(t.key),name:t.name}),null,16,y),Object(l["createElementVNode"])("span",null,Object(l["toDisplayString"])(t.value),1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{class:"form-description"},Object(l["toDisplayString"])(t.description),513),[[l["vShow"],t.description]])])])})),128))],512)}function V(e){return k(e)||S(e)||C(e)||w()}function w(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function C(e,t){if(e){if("string"===typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}function S(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function k(e){if(Array.isArray(e))return A(e)}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function F(e,t){return(e||[]).map((function(e){return t&&-1!==t.indexOf(e.key)}))}var B=Object(l["defineComponent"])({props:{modelValue:Array,name:String,title:String,availableOptions:Array,uiControlAttributes:Object,type:String},inheritAttrs:!1,emits:["update:modelValue"],computed:{checkboxStates:function(){return F(this.availableOptions,this.modelValue)}},mounted:function(){window.Materialize.updateTextFields()},methods:{onChange:function(e){var t=V(this.checkboxStates);t[e]=!t[e];var n=this.availableOptions||{},o=[];Object.values(n).forEach((function(e,n){t[n]&&o.push(e.key)})),this.$refs.root.querySelectorAll("input").forEach((function(e){e.checked=!e.checked})),this.$emit("update:modelValue",o)}}});B.render=j;var E=B,x={class:"expandableSelector"},N=Object(l["createElementVNode"])("svg",{class:"caret",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},[Object(l["createElementVNode"])("path",{d:"M7 10l5 5 5-5z"}),Object(l["createElementVNode"])("path",{d:"M0 0h24v24H0z",fill:"none"})],-1),T=["value"],$={class:"expandableList z-depth-2"},M={class:"searchContainer"},P={class:"collection firstLevel"},J=["onClick"],H={class:"collection secondLevel"},D=["onClick"],I={class:"primary-content"},L=["title"];function z(e,t,n,o,i,r){var a=Object(l["resolveDirective"])("focus-if"),u=Object(l["resolveDirective"])("focus-anywhere-but-here");return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("div",x,[Object(l["createElementVNode"])("div",{onClick:t[0]||(t[0]=function(t){return e.showSelect=!e.showSelect}),class:"select-wrapper"},[N,Object(l["createElementVNode"])("input",{type:"text",class:"select-dropdown",readonly:"readonly",value:e.modelValueText},null,8,T)]),Object(l["withDirectives"])(Object(l["createElementVNode"])("div",$,[Object(l["createElementVNode"])("div",M,[Object(l["withDirectives"])(Object(l["createElementVNode"])("input",{type:"text",placeholder:"Search","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.searchTerm=t}),class:"expandableSearch browser-default"},null,512),[[l["vModelText"],e.searchTerm],[a,e.showSelect]])]),Object(l["createElementVNode"])("ul",P,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions,(function(t,n){return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("li",{class:"collection-item",key:n},[Object(l["createElementVNode"])("h4",{class:"expandableListCategory",onClick:function(n){return e.onCategoryClicked(t)}},[Object(l["createTextVNode"])(Object(l["toDisplayString"])(t.group)+" ",1),Object(l["createElementVNode"])("span",{class:Object(l["normalizeClass"])(["secondary-content",{"icon-arrow-right":e.showCategory!==t.group,"icon-arrow-bottom":e.showCategory===t.group}])},null,2)],8,J),Object(l["withDirectives"])(Object(l["createElementVNode"])("ul",H,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(t.values.filter((function(t){return-1!==t.value.toLowerCase().indexOf(e.searchTerm.toLowerCase())})),(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("li",{class:"expandableListItem collection-item valign-wrapper",key:t.key,onClick:function(n){return e.onValueClicked(t)}},[Object(l["createElementVNode"])("span",I,Object(l["toDisplayString"])(t.value),1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{title:t.tooltip,class:"secondary-content icon-help"},null,8,L),[[l["vShow"],t.tooltip]])],8,D)})),128))],512),[[l["vShow"],e.showCategory===t.group||e.searchTerm]])],512)),[[l["vShow"],t.values.filter((function(t){return-1!==t.value.toLowerCase().indexOf(e.searchTerm.toLowerCase())})).length]])})),128))])],512),[[l["vShow"],e.showSelect]])],512)),[[u,{blur:e.onBlur}]])}function U(e){var t=[];if(!e)return t;var n={};return Object.values(e).forEach((function(e){var t=e,o=t.group||"";o in n&&n[o]||(n[o]={values:[],group:o});var i={key:t.key,value:t.value};"tooltip"in t&&t.tooltip&&(i.tooltip=t.tooltip),n[o].values.push(i)})),Object.values(n).forEach((function(e){e.values.length&&t.push(e)})),t}var K=Object(l["defineComponent"])({props:{modelValue:[Number,String],availableOptions:Array,title:String},directives:{FocusAnywhereButHere:r["FocusAnywhereButHere"],FocusIf:r["FocusIf"]},inheritAttrs:!1,emits:["update:modelValue"],data:function(){return{showSelect:!1,searchTerm:"",showCategory:""}},computed:{modelValueText:function(){if(this.title)return this.title;var e,t=this.modelValue,n=this.availableOptions||[];return n.some((function(n){return e=n.values.find((function(e){return e.key===t})),e})),e?e.value?"".concat(e.value):"":t?"".concat(t):""}},methods:{onBlur:function(){this.showSelect=!1},onCategoryClicked:function(e){this.showCategory===e.group?this.showCategory="":this.showCategory=e.group},onValueClicked:function(e){this.$emit("update:modelValue",e.key),this.showSelect=!1}}});K.render=z;var _=K,q=["for","innerHTML"];function R(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("FieldArray");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,q),Object(l["createVNode"])(a,{name:e.name,"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onValueUpdate(t)}),field:e.uiControlAttributes.field},null,8,["name","model-value","field"])])}var G=Object(l["defineComponent"])({components:{FieldArray:r["FieldArray"]},props:{name:String,title:String,modelValue:null,uiControlAttributes:Object},inheritAttrs:!1,emits:["update:modelValue"],methods:{onValueUpdate:function(e){this.$emit("update:modelValue",e)}}});G.render=R;var W=G,Z={class:"btn"},Y=["for","innerHTML"],Q=["name","id"],X={class:"file-path-wrapper"},ee=["value"];function te(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("div",Z,[Object(l["createElementVNode"])("span",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Y),Object(l["createElementVNode"])("input",{ref:"fileInput",name:e.name,type:"file",id:e.name,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},null,40,Q)]),Object(l["createElementVNode"])("div",X,[Object(l["createElementVNode"])("input",{class:"file-path validate",value:e.filePath,type:"text"},null,8,ee)])])}var ne=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:[String,File]},inheritAttrs:!1,emits:["update:modelValue"],watch:{modelValue:function(e){if(!e||""===e){var t=this.$refs.fileInput;t.value=""}}},methods:{onChange:function(e){var t=e.target.files;if(t){var n=t.item(0);this.$emit("update:modelValue",n)}}},computed:{filePath:function(){if(this.modelValue instanceof File)return this.$refs.fileInput.value}}});ne.render=te;var oe=ne,ie=["type","name","value"];function re(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("input",{type:e.uiControl,name:e.name,value:e.modelValue,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},null,40,ie)])}var le=Object(l["defineComponent"])({props:{modelValue:null,uiControl:String,name:String},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e.target.value)}}});le.render=re;var ae=le,ue={class:"fieldMultiTuple"},ce=["for","innerHTML"];function se(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("MultiPairField");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",ue,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,ce),Object(l["createVNode"])(a,{name:e.name,"model-value":e.modelValue,"onUpdate:modelValue":e.onUpdateValue,field1:e.uiControlAttributes.field1,field2:e.uiControlAttributes.field2,field3:e.uiControlAttributes.field3,field4:e.uiControlAttributes.field4},null,8,["name","model-value","onUpdate:modelValue","field1","field2","field3","field4"])])}var de=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:null,uiControlAttributes:Object},inheritAttrs:!1,components:{MultiPairField:r["MultiPairField"]},emits:["update:modelValue"],methods:{onUpdateValue:function(e){this.$emit("update:modelValue",e)}}});de.render=se;var me=de,fe=["type","id","name","value"],pe=["for","innerHTML"];function be(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,id:e.name,name:e.name,value:(e.modelValue||"0").toString(),onKeydown:t[0]||(t[0]=function(t){return e.onChange(t)}),onChange:t[1]||(t[1]=function(t){return e.onChange(t)})},e.uiControlAttributes),null,16,fe),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,pe)],64)}var ve=Object(l["defineComponent"])({props:{uiControl:String,name:String,title:String,modelValue:[Number,String],uiControlAttributes:Object},inheritAttrs:!1,emits:["update:modelValue"],created:function(){this.onChange=Object(r["debounce"])(this.onChange.bind(this),50)},methods:{onChange:function(e){var t=parseFloat(e.target.value);e.target.value=(this.modelValue||"").toString(),this.$emit("update:modelValue",t)}},mounted:function(){window.Materialize.updateTextFields()},watch:{modelValue:function(){setTimeout((function(){window.Materialize.updateTextFields()}))}}});ve.render=be;var he=ve,ge={ref:"root"},Oe=["value","id","name","disabled","checked"];function ye(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",ge,[Object(l["withDirectives"])(Object(l["createElementVNode"])("label",{class:"fieldRadioTitle"},Object(l["toDisplayString"])(e.title),513),[[l["vShow"],e.title]]),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions||[],(function(n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("p",{key:n.key,class:"radio"},[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({value:n.key,onChange:t[0]||(t[0]=function(t){return e.onChange(t)}),type:"radio",id:"".concat(e.name).concat(n.key),name:e.name,disabled:n.disabled||e.disabled},e.uiControlAttributes,{checked:e.modelValue===n.key||"".concat(e.modelValue)===n.key}),null,16,Oe),Object(l["createElementVNode"])("span",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(n.value)+" ",1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{class:"form-description"},Object(l["toDisplayString"])(n.description),513),[[l["vShow"],n.description]])])])])})),128))],512)}var je=Object(l["defineComponent"])({props:{title:String,availableOptions:Array,name:String,disabled:Boolean,uiControlAttributes:Object,modelValue:[String,Number]},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){var t=this;this.$refs.root.querySelectorAll("input").forEach((function(e,n){var o;if(null!==(o=t.availableOptions)&&void 0!==o&&o[n]){var i=t.availableOptions[n].key;e.checked=t.modelValue===i||"".concat(t.modelValue)===i}})),this.$emit("update:modelValue",e.target.value)}}});je.render=ye;var Ve=je;function we(e,t){return Fe(e)||Ae(e,t)||Se(e,t)||Ce()}function Ce(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Se(e,t){if(e){if("string"===typeof e)return ke(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ke(e,t):void 0}}function ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Ae(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){a=!0,i=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw i}}return r}}function Fe(e){if(Array.isArray(e))return e}var Be={key:0,class:"matomo-field-select"},Ee=["multiple","name"],xe=["label"],Ne=["value","selected","disabled"],Te=["for","innerHTML"],$e={key:1,class:"matomo-field-select"},Me=["multiple","name"],Pe=["value","selected","disabled"],Je=["for","innerHTML"];function He(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[e.groupedOptions?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",Be,[Object(l["createElementVNode"])("select",Object(l["mergeProps"])({ref:"select",class:"grouped",multiple:e.multiple,name:e.name,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},e.uiControlAttributes),[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.groupedOptions,(function(t){var n=we(t,2),o=n[0],i=n[1];return Object(l["openBlock"])(),Object(l["createElementBlock"])("optgroup",{key:o,label:o},[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(i,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("option",{key:t.key,value:"string:".concat(t.key),selected:e.multiple?e.modelValue&&-1!==e.modelValue.indexOf(t.key):e.modelValue===t.key,disabled:t.disabled},Object(l["toDisplayString"])(t.value),9,Ne)})),128))],8,xe)})),128))],16,Ee),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Te)])):Object(l["createCommentVNode"])("",!0),!e.groupedOptions&&e.options?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",$e,[Object(l["createElementVNode"])("select",Object(l["mergeProps"])({class:"ungrouped",ref:"select",multiple:e.multiple,name:e.name,onChange:t[1]||(t[1]=function(t){return e.onChange(t)})},e.uiControlAttributes),[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.options,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("option",{key:t.key,value:"string:".concat(t.key),selected:e.multiple?e.modelValue&&-1!==e.modelValue.indexOf(t.key):e.modelValue===t.key,disabled:t.disabled},Object(l["toDisplayString"])(t.value),9,Pe)})),128))],16,Me),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Je)])):Object(l["createCommentVNode"])("",!0)],64)}function De(e){return ze(e)||Le(e)||_e(e)||Ie()}function Ie(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Le(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ze(e){if(Array.isArray(e))return qe(e)}function Ue(e,t){return Ge(e)||Re(e,t)||_e(e,t)||Ke()}function Ke(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _e(e,t){if(e){if("string"===typeof e)return qe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qe(e,t):void 0}}function qe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Re(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){a=!0,i=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw i}}return r}}function Ge(e){if(Array.isArray(e))return e}function We(e){return We="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},We(e)}function Ze(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4?arguments[4]:void 0;if(e){var r=window.$(e);if(Array.from(e.options).forEach((function(e){e.selected=i?!!t&&-1!==t.indexOf(e.value.replace(/^string:/,"")):"string:".concat(t)===e.value})),r.formSelect(o),n){var l=r.closest(".select-wrapper").find("input");l.attr("placeholder",n)}}}function Ye(e){return!Array.isArray(e)&&"object"===We(e)&&Object.values(e).some((function(e){return"object"===We(e)}))}function Qe(e,t){return e.some((function(e){return e.key===t}))}function Xe(e,t,n){if(!e)return[];var o=!0,i=e;Ye(i)||(i={"":e},o=!1);var r=[];return Object.entries(i).forEach((function(e){var n=Ue(e,2),i=n[0],l=n[1];Object.entries(l).forEach((function(e){var n=Ue(e,2),l=n[0],a=n[1];if(a&&"object"===We(a)&&"undefined"!==typeof a.key)r.push(a);else{var u=l;"integer"===t&&"string"===typeof l&&(u=parseInt(l,10)),r.push({group:o?i:void 0,key:u,value:a})}}))})),null!==n&&void 0!==n&&n.placeholder&&!Qe(r,"")?[{key:"",value:""}].concat(r):r}function et(e){return"string"===typeof e?e.replace(/^string:/,""):e}var tt=Object(l["defineComponent"])({props:{modelValue:null,multiple:Boolean,name:String,title:String,availableOptions:Array,uiControlAttributes:Object,uiControlOptions:Object},inheritAttrs:!1,emits:["update:modelValue"],computed:{options:function(){var e=this.availableOptions;return!e||Qe(e,"")||"undefined"!==typeof this.modelValue&&null!==this.modelValue&&""!==this.modelValue?e:[{key:"",value:this.modelValue,group:this.hasGroups?"":void 0}].concat(De(e))},hasGroups:function(){var e=this.availableOptions;return e&&e[0]&&"undefined"!==typeof e[0].group},groupedOptions:function(){var e=this.options;if(!this.hasGroups||!e)return null;var t={};e.forEach((function(e){var n=e.group;t[n]=t[n]||[],t[n].push(e)}));var n=Object.entries(t);return n.sort((function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0})),n}},methods:{onChange:function(e){var t,n=e.target;this.multiple?(t=Array.from(n.options).filter((function(e){return e.selected})).map((function(e){return e.value})),t=t.map((function(e){return et(e)}))):(t=n.value,t=et(t)),this.onModelValueChange(this.modelValue),this.$emit("update:modelValue",t)},onModelValueChange:function(e){var t=this;window.$(this.$refs.select).val(e),setTimeout((function(){var n;Ze(t.$refs.select,e,null===(n=t.uiControlAttributes)||void 0===n?void 0:n.placeholder,t.uiControlOptions,t.multiple)}))}},watch:{modelValue:function(e){this.onModelValueChange(e)},"uiControlAttributes.disabled":{handler:function(e,t){var n=this;setTimeout((function(){var o;e!==t&&Ze(n.$refs.select,n.modelValue,null===(o=n.uiControlAttributes)||void 0===o?void 0:o.placeholder,n.uiControlOptions,n.multiple)}))}},availableOptions:function(e,t){var n=this;e!==t&&setTimeout((function(){var e;Ze(n.$refs.select,n.modelValue,null===(e=n.uiControlAttributes)||void 0===e?void 0:e.placeholder,n.uiControlOptions,n.multiple)}))}},mounted:function(){var e=this;setTimeout((function(){var t;Ze(e.$refs.select,e.modelValue,null===(t=e.uiControlAttributes)||void 0===t?void 0:t.placeholder,e.uiControlOptions,e.multiple)}))}});tt.render=He;var nt=tt,ot=["for","innerHTML"],it={class:"sites_autocomplete"};function rt(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("SiteSelector");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,class:"siteSelectorLabel",innerHTML:e.$sanitize(e.title)},null,8,ot),Object(l["createElementVNode"])("div",it,[Object(l["createVNode"])(a,Object(l["mergeProps"])({"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)}),id:e.name,"show-all-sites-item":e.uiControlAttributes.showAllSitesItem||!1,"switch-site-on-select":!1,"show-selected-site":!0,"only-sites-with-admin-access":e.uiControlAttributes.onlySitesWithAdminAccess||!1},e.uiControlAttributes),null,16,["model-value","id","show-all-sites-item","only-sites-with-admin-access"])])])}var lt=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:Object,uiControlAttributes:Object},inheritAttrs:!1,components:{SiteSelector:r["SiteSelector"]},emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});lt.render=rt;var at=lt,ut=["type","id","name","value"],ct=["for","innerHTML"];function st(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,id:e.name,name:e.name,value:e.modelValueText,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)})},e.uiControlAttributes),null,16,ut),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,ct)],64)}var dt=Object(l["defineComponent"])({props:{title:String,name:String,uiControlAttributes:Object,modelValue:[String,Number],uiControl:String},inheritAttrs:!1,emits:["update:modelValue"],computed:{modelValueText:function(){return"undefined"===typeof this.modelValue||null===this.modelValue?"":this.modelValue.toString()}},created:function(){this.onKeydown=Object(r["debounce"])(this.onKeydown.bind(this),50)},mounted:function(){setTimeout((function(){window.Materialize.updateTextFields()}))},watch:{modelValue:function(){setTimeout((function(){window.Materialize.updateTextFields()}))}},methods:{onKeydown:function(e){var t=e.target.value;this.modelValue!==t&&(e.target.value=this.modelValueText,this.$emit("update:modelValue",t))}}});dt.render=st;var mt=dt,ft=["for","innerHTML"],pt=["type","name","value"];function bt(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,ft),Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,name:e.name,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),value:e.concattedValues},e.uiControlAttributes),null,16,pt)])}var vt=Object(l["defineComponent"])({props:{name:String,title:String,uiControl:String,modelValue:Array,uiControlAttributes:Object},inheritAttrs:!1,computed:{concattedValues:function(){return"string"===typeof this.modelValue?this.modelValue:(this.modelValue||[]).join(", ")}},emits:["update:modelValue"],created:function(){this.onKeydown=Object(r["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=e.target.value.split(",").map((function(e){return e.trim()}));t.join(", ")!==this.concattedValues&&(e.target.value=this.concattedValues,this.$emit("update:modelValue",t))}}});vt.render=bt;var ht=vt,gt=["name","id","value"],Ot=["for","innerHTML"];function yt(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("textarea",Object(l["mergeProps"])({name:e.name},e.uiControlAttributes,{id:e.name,value:e.modelValue,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),class:"materialize-textarea",ref:"textarea"}),null,16,gt),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Ot)],64)}var jt=Object(l["defineComponent"])({props:{name:String,uiControlAttributes:Object,modelValue:String,title:String},inheritAttrs:!1,emits:["update:modelValue"],created:function(){this.onKeydown=Object(r["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=e.target.value;e.target.value=this.modelValue||"",this.$emit("update:modelValue",t)}},watch:{modelValue:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}},mounted:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}});jt.render=yt;var Vt=jt,wt=["for","innerHTML"],Ct=["name","value"];function St(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,wt),Object(l["createElementVNode"])("textarea",Object(l["mergeProps"])({ref:"textarea",name:e.name},e.uiControlAttributes,{value:e.concattedValue,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),class:"materialize-textarea"}),null,16,Ct)])}var kt="\n",At=Object(l["defineComponent"])({props:{name:String,title:String,uiControlAttributes:Object,modelValue:[Array,String]},inheritAttrs:!1,emits:["update:modelValue"],computed:{concattedValue:function(){return"string"===typeof this.modelValue?this.modelValue:(this.modelValue||[]).join(kt)}},created:function(){this.onKeydown=Object(r["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=e.target.value.split(kt);t.join(kt)!==this.concattedValue&&(e.target.value=this.concattedValue,this.$emit("update:modelValue",t))}},watch:{modelValue:function(e,t){var n=this;e!==t&&setTimeout((function(){n.$refs.textarea&&window.Materialize.textareaAutoResize(n.$refs.textarea),window.Materialize.updateTextFields()}))}},mounted:function(){var e=this;setTimeout((function(){e.$refs.textarea&&window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}});At.render=St;var Ft=At;function Bt(e){return Bt="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bt(e)}function Et(e,t){return Mt(e)||$t(e,t)||Nt(e,t)||xt()}function xt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Nt(e,t){if(e){if("string"===typeof e)return Tt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tt(e,t):void 0}}function Tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function $t(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){a=!0,i=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw i}}return r}}function Mt(e){if(Array.isArray(e))return e} +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue")):"function"===typeof define&&define.amd?define(["CoreHome"],t):"object"===typeof exports?exports["CorePluginsAdmin"]=t(require("CoreHome"),require("vue")):e["CorePluginsAdmin"]=t(e["CoreHome"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/CorePluginsAdmin/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"FormField",(function(){return Gt})),n.d(t,"Field",(function(){return en})),n.d(t,"PluginSettings",(function(){return Mn})),n.d(t,"PluginFilter",(function(){return io})),n.d(t,"PluginManagement",(function(){return In})),n.d(t,"PluginUpload",(function(){return qn})),n.d(t,"SaveButton",(function(){return so})),n.d(t,"Form",(function(){return po})),n.d(t,"GroupedSettings",(function(){return Sn})),"undefined"!==typeof window){var o=window.document.currentScript,i=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var r=n("19dc"),l=n("8bbf"),a={class:"form-group row matomo-form-field"},u={key:0,class:"col s12"},c={key:0,class:"form-help"},s={key:0,class:"inline-help",ref:"inlineHelp"},d=Object(l["createElementVNode"])("br",null,null,-1);function m(e,t,n,o,i,r){return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("div",a,[e.formField.introduction?(Object(l["openBlock"])(),Object(l["createElementBlock"])("h3",u,Object(l["toDisplayString"])(e.formField.introduction),1)):Object(l["createCommentVNode"])("",!0),Object(l["createElementVNode"])("div",{class:Object(l["normalizeClass"])(["col s12",{"input-field":"checkbox"!==e.formField.uiControl&&"radio"!==e.formField.uiControl,"file-field":"file"===e.formField.uiControl,m6:!e.formField.fullWidth}])},[(Object(l["openBlock"])(),Object(l["createBlock"])(Object(l["resolveDynamicComponent"])(e.childComponent),Object(l["mergeProps"])(Object.assign(Object.assign({formField:e.formField},e.formField),{},{modelValue:e.processedModelValue,availableOptions:e.availableOptions},e.extraChildComponentParams),{"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)})}),null,16))],2),Object(l["createElementVNode"])("div",{class:Object(l["normalizeClass"])(["col s12",{m6:!e.formField.fullWidth}])},[e.showFormHelp?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",c,[Object(l["withDirectives"])(Object(l["createElementVNode"])("div",{class:"form-description"},Object(l["toDisplayString"])(e.formField.description),513),[[l["vShow"],e.formField.description]]),e.formField.inlineHelp||e.hasInlineHelpSlot?(Object(l["openBlock"])(),Object(l["createElementBlock"])("span",s,[e.inlineHelpComponent?(Object(l["openBlock"])(),Object(l["createBlock"])(Object(l["resolveDynamicComponent"])(e.inlineHelpComponent),Object(l["normalizeProps"])(Object(l["mergeProps"])({key:0},e.inlineHelpBind)),null,16)):Object(l["createCommentVNode"])("",!0),Object(l["renderSlot"])(e.$slots,"inline-help")],512)):Object(l["createCommentVNode"])("",!0),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",null,[d,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("General_Default"))+": ",1),Object(l["createElementVNode"])("span",null,Object(l["toDisplayString"])(e.defaultValuePrettyTruncated),1)],512),[[l["vShow"],e.showDefaultValue]])])):Object(l["createCommentVNode"])("",!0)],2)],512)),[[l["vShow"],e.showField]])}var f={class:"checkbox"},p=["checked","id","name"],b=["innerHTML"];function v(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",f,[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},e.uiControlAttributes,{value:1,checked:e.isChecked,type:"checkbox",id:e.name,name:e.name}),null,16,p),Object(l["createElementVNode"])("span",{innerHTML:e.$sanitize(e.title)},null,8,b)])])}var h=Object(l["defineComponent"])({props:{modelValue:[Boolean,Number,String],uiControlAttributes:Object,name:String,title:String},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){var t=e.target.checked;this.modelValue!==t&&(e.target.checked=!t,this.$emit("update:modelValue",t))}},computed:{isChecked:function(){return!!this.modelValue&&"0"!==this.modelValue}}});h.render=v;var g=h,O={ref:"root"},j=["value","checked","onChange","id","name"];function y(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",O,[Object(l["withDirectives"])(Object(l["createElementVNode"])("label",{class:"fieldRadioTitle"},Object(l["toDisplayString"])(e.title),513),[[l["vShow"],e.title]]),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions,(function(t,n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("p",{key:n,class:"checkbox"},[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({value:t.key,checked:!!e.checkboxStates[n],onChange:function(t){return e.onChange(n)}},e.uiControlAttributes,{type:"checkbox",id:"".concat(e.name).concat(t.key),name:t.name}),null,16,j),Object(l["createElementVNode"])("span",null,Object(l["toDisplayString"])(t.value),1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{class:"form-description"},Object(l["toDisplayString"])(t.description),513),[[l["vShow"],t.description]])])])})),128))],512)}function V(e){return k(e)||S(e)||C(e)||w()}function w(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function C(e,t){if(e){if("string"===typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}function S(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function k(e){if(Array.isArray(e))return A(e)}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function F(e,t){return(e||[]).map((function(e){return t&&-1!==t.indexOf(e.key)}))}var B=Object(l["defineComponent"])({props:{modelValue:Array,name:String,title:String,availableOptions:Array,uiControlAttributes:Object,type:String},inheritAttrs:!1,emits:["update:modelValue"],computed:{checkboxStates:function(){return F(this.availableOptions,this.modelValue)}},mounted:function(){window.Materialize.updateTextFields()},methods:{onChange:function(e){var t=V(this.checkboxStates);t[e]=!t[e];var n=this.availableOptions||{},o=[];Object.values(n).forEach((function(e,n){t[n]&&o.push(e.key)})),this.$refs.root.querySelectorAll("input").forEach((function(e){e.checked=!e.checked})),this.$emit("update:modelValue",o)}}});B.render=y;var x=B,E={class:"expandableSelector"},N=Object(l["createElementVNode"])("svg",{class:"caret",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},[Object(l["createElementVNode"])("path",{d:"M7 10l5 5 5-5z"}),Object(l["createElementVNode"])("path",{d:"M0 0h24v24H0z",fill:"none"})],-1),T=["value"],$={class:"expandableList z-depth-2"},M={class:"searchContainer"},P={class:"collection firstLevel"},J=["onClick"],H={class:"collection secondLevel"},D=["onClick"],I={class:"primary-content"},L=["title"];function z(e,t,n,o,i,r){var a=Object(l["resolveDirective"])("focus-if"),u=Object(l["resolveDirective"])("focus-anywhere-but-here");return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("div",E,[Object(l["createElementVNode"])("div",{onClick:t[0]||(t[0]=function(t){return e.showSelect=!e.showSelect}),class:"select-wrapper"},[N,Object(l["createElementVNode"])("input",{type:"text",class:"select-dropdown",readonly:"readonly",value:e.modelValueText},null,8,T)]),Object(l["withDirectives"])(Object(l["createElementVNode"])("div",$,[Object(l["createElementVNode"])("div",M,[Object(l["withDirectives"])(Object(l["createElementVNode"])("input",{type:"text",placeholder:"Search","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.searchTerm=t}),class:"expandableSearch browser-default"},null,512),[[l["vModelText"],e.searchTerm],[a,e.showSelect]])]),Object(l["createElementVNode"])("ul",P,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions,(function(t,n){return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("li",{class:"collection-item",key:n},[Object(l["createElementVNode"])("h4",{class:"expandableListCategory",onClick:function(n){return e.onCategoryClicked(t)}},[Object(l["createTextVNode"])(Object(l["toDisplayString"])(t.group)+" ",1),Object(l["createElementVNode"])("span",{class:Object(l["normalizeClass"])(["secondary-content",{"icon-arrow-right":e.showCategory!==t.group,"icon-arrow-bottom":e.showCategory===t.group}])},null,2)],8,J),Object(l["withDirectives"])(Object(l["createElementVNode"])("ul",H,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(t.values.filter((function(t){return-1!==t.value.toLowerCase().indexOf(e.searchTerm.toLowerCase())})),(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("li",{class:"expandableListItem collection-item valign-wrapper",key:t.key,onClick:function(n){return e.onValueClicked(t)}},[Object(l["createElementVNode"])("span",I,Object(l["toDisplayString"])(t.value),1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{title:t.tooltip,class:"secondary-content icon-help"},null,8,L),[[l["vShow"],t.tooltip]])],8,D)})),128))],512),[[l["vShow"],e.showCategory===t.group||e.searchTerm]])],512)),[[l["vShow"],t.values.filter((function(t){return-1!==t.value.toLowerCase().indexOf(e.searchTerm.toLowerCase())})).length]])})),128))])],512),[[l["vShow"],e.showSelect]])],512)),[[u,{blur:e.onBlur}]])}function U(e){var t=[];if(!e)return t;var n={};return Object.values(e).forEach((function(e){var t=e,o=t.group||"";o in n&&n[o]||(n[o]={values:[],group:o});var i={key:t.key,value:t.value};"tooltip"in t&&t.tooltip&&(i.tooltip=t.tooltip),n[o].values.push(i)})),Object.values(n).forEach((function(e){e.values.length&&t.push(e)})),t}var K=Object(l["defineComponent"])({props:{modelValue:[Number,String],availableOptions:Array,title:String},directives:{FocusAnywhereButHere:r["FocusAnywhereButHere"],FocusIf:r["FocusIf"]},inheritAttrs:!1,emits:["update:modelValue"],data:function(){return{showSelect:!1,searchTerm:"",showCategory:""}},computed:{modelValueText:function(){if(this.title)return this.title;var e,t=this.modelValue,n=this.availableOptions||[];return n.some((function(n){return e=n.values.find((function(e){return e.key===t})),e})),e?e.value?"".concat(e.value):"":t?"".concat(t):""}},methods:{onBlur:function(){this.showSelect=!1},onCategoryClicked:function(e){this.showCategory===e.group?this.showCategory="":this.showCategory=e.group},onValueClicked:function(e){this.$emit("update:modelValue",e.key),this.showSelect=!1}}});K.render=z;var _=K,q=["for","innerHTML"];function R(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("FieldArray");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,q),Object(l["createVNode"])(a,{name:e.name,"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onValueUpdate(t)}),field:e.uiControlAttributes.field},null,8,["name","model-value","field"])])}var G=Object(l["defineComponent"])({components:{FieldArray:r["FieldArray"]},props:{name:String,title:String,modelValue:null,uiControlAttributes:Object},inheritAttrs:!1,emits:["update:modelValue"],methods:{onValueUpdate:function(e){this.$emit("update:modelValue",e)}}});G.render=R;var W=G,Z={class:"btn"},Y=["for","innerHTML"],Q=["name","id"],X={class:"file-path-wrapper"},ee=["value"];function te(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("div",Z,[Object(l["createElementVNode"])("span",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Y),Object(l["createElementVNode"])("input",{ref:"fileInput",name:e.name,type:"file",id:e.name,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},null,40,Q)]),Object(l["createElementVNode"])("div",X,[Object(l["createElementVNode"])("input",{class:"file-path validate",value:e.filePath,type:"text"},null,8,ee)])])}var ne=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:[String,File]},inheritAttrs:!1,emits:["update:modelValue"],watch:{modelValue:function(e){if(!e||""===e){var t=this.$refs.fileInput;t.value=""}}},methods:{onChange:function(e){var t=e.target.files;if(t){var n=t.item(0);this.$emit("update:modelValue",n)}}},computed:{filePath:function(){if(this.modelValue instanceof File)return this.$refs.fileInput.value}}});ne.render=te;var oe=ne,ie=["type","name","value"];function re(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("input",{type:e.uiControl,name:e.name,value:e.modelValue,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},null,40,ie)])}var le=Object(l["defineComponent"])({props:{modelValue:null,uiControl:String,name:String},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e.target.value)}}});le.render=re;var ae=le,ue={class:"fieldMultiTuple"},ce=["for","innerHTML"];function se(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("MultiPairField");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",ue,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,ce),Object(l["createVNode"])(a,{name:e.name,"model-value":e.modelValue,"onUpdate:modelValue":e.onUpdateValue,field1:e.uiControlAttributes.field1,field2:e.uiControlAttributes.field2,field3:e.uiControlAttributes.field3,field4:e.uiControlAttributes.field4},null,8,["name","model-value","onUpdate:modelValue","field1","field2","field3","field4"])])}var de=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:null,uiControlAttributes:Object},inheritAttrs:!1,components:{MultiPairField:r["MultiPairField"]},emits:["update:modelValue"],methods:{onUpdateValue:function(e){this.$emit("update:modelValue",e)}}});de.render=se;var me=de,fe=["type","id","name","value"],pe=["for","innerHTML"];function be(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,id:e.name,name:e.name,value:e.modelValueFormatted,onKeydown:t[0]||(t[0]=function(t){return e.onChange(t)}),onChange:t[1]||(t[1]=function(t){return e.onChange(t)})},e.uiControlAttributes),null,16,fe),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,pe)],64)}var ve=Object(l["defineComponent"])({props:{uiControl:String,name:String,title:String,modelValue:[Number,String],uiControlAttributes:Object},inheritAttrs:!1,emits:["update:modelValue"],created:function(){this.onChange=Object(r["debounce"])(this.onChange.bind(this),50)},methods:{onChange:function(e){var t=this,n=parseFloat(e.target.value);this.$emit("update:modelValue",n),Object(l["nextTick"])((function(){e.target.value!==t.modelValueFormatted&&(e.target.value=t.modelValueFormatted)}))}},mounted:function(){window.Materialize.updateTextFields()},watch:{modelValue:function(){setTimeout((function(){window.Materialize.updateTextFields()}))}},computed:{modelValueFormatted:function(){return(this.modelValue||"").toString()}}});ve.render=be;var he=ve,ge={ref:"root"},Oe=["value","id","name","disabled","checked"];function je(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",ge,[Object(l["withDirectives"])(Object(l["createElementVNode"])("label",{class:"fieldRadioTitle"},Object(l["toDisplayString"])(e.title),513),[[l["vShow"],e.title]]),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions||[],(function(n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("p",{key:n.key,class:"radio"},[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({value:n.key,onChange:t[0]||(t[0]=function(t){return e.onChange(t)}),type:"radio",id:"".concat(e.name).concat(n.key),name:e.name,disabled:n.disabled||e.disabled},e.uiControlAttributes,{checked:e.modelValue===n.key||"".concat(e.modelValue)===n.key}),null,16,Oe),Object(l["createElementVNode"])("span",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(n.value)+" ",1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{class:"form-description"},Object(l["toDisplayString"])(n.description),513),[[l["vShow"],n.description]])])])])})),128))],512)}var ye=Object(l["defineComponent"])({props:{title:String,availableOptions:Array,name:String,disabled:Boolean,uiControlAttributes:Object,modelValue:[String,Number]},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){var t=this;this.$refs.root.querySelectorAll("input").forEach((function(e,n){var o;if(null!==(o=t.availableOptions)&&void 0!==o&&o[n]){var i=t.availableOptions[n].key;e.checked=t.modelValue===i||"".concat(t.modelValue)===i}})),this.$emit("update:modelValue",e.target.value)}}});ye.render=je;var Ve=ye;function we(e,t){return Fe(e)||Ae(e,t)||Se(e,t)||Ce()}function Ce(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Se(e,t){if(e){if("string"===typeof e)return ke(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ke(e,t):void 0}}function ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Ae(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){a=!0,i=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw i}}return r}}function Fe(e){if(Array.isArray(e))return e}var Be={key:0,class:"matomo-field-select"},xe=["multiple","name"],Ee=["label"],Ne=["value","selected","disabled"],Te=["for","innerHTML"],$e={key:1,class:"matomo-field-select"},Me=["multiple","name"],Pe=["value","selected","disabled"],Je=["for","innerHTML"];function He(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[e.groupedOptions?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",Be,[Object(l["createElementVNode"])("select",Object(l["mergeProps"])({ref:"select",class:"grouped",multiple:e.multiple,name:e.name,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},e.uiControlAttributes),[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.groupedOptions,(function(t){var n=we(t,2),o=n[0],i=n[1];return Object(l["openBlock"])(),Object(l["createElementBlock"])("optgroup",{key:o,label:o},[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(i,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("option",{key:t.key,value:"string:".concat(t.key),selected:e.multiple?e.modelValue&&-1!==e.modelValue.indexOf(t.key):e.modelValue===t.key,disabled:t.disabled},Object(l["toDisplayString"])(t.value),9,Ne)})),128))],8,Ee)})),128))],16,xe),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Te)])):Object(l["createCommentVNode"])("",!0),!e.groupedOptions&&e.options?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",$e,[Object(l["createElementVNode"])("select",Object(l["mergeProps"])({class:"ungrouped",ref:"select",multiple:e.multiple,name:e.name,onChange:t[1]||(t[1]=function(t){return e.onChange(t)})},e.uiControlAttributes),[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.options,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("option",{key:t.key,value:"string:".concat(t.key),selected:e.multiple?e.modelValue&&-1!==e.modelValue.indexOf(t.key):e.modelValue===t.key,disabled:t.disabled},Object(l["toDisplayString"])(t.value),9,Pe)})),128))],16,Me),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Je)])):Object(l["createCommentVNode"])("",!0)],64)}function De(e){return ze(e)||Le(e)||_e(e)||Ie()}function Ie(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Le(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ze(e){if(Array.isArray(e))return qe(e)}function Ue(e,t){return Ge(e)||Re(e,t)||_e(e,t)||Ke()}function Ke(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _e(e,t){if(e){if("string"===typeof e)return qe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qe(e,t):void 0}}function qe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Re(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){a=!0,i=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw i}}return r}}function Ge(e){if(Array.isArray(e))return e}function We(e){return We="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},We(e)}function Ze(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4?arguments[4]:void 0;if(e){var r=window.$(e);if(Array.from(e.options).forEach((function(e){e.selected=i?!!t&&-1!==t.indexOf(e.value.replace(/^string:/,"")):"string:".concat(t)===e.value})),r.formSelect(o),n){var l=r.closest(".select-wrapper").find("input");l.attr("placeholder",n)}}}function Ye(e){return!Array.isArray(e)&&"object"===We(e)&&Object.values(e).some((function(e){return"object"===We(e)}))}function Qe(e,t){return e.some((function(e){return e.key===t}))}function Xe(e,t,n){if(!e)return[];var o=!0,i=e;Ye(i)||(i={"":e},o=!1);var r=[];return Object.entries(i).forEach((function(e){var n=Ue(e,2),i=n[0],l=n[1];Object.entries(l).forEach((function(e){var n=Ue(e,2),l=n[0],a=n[1];if(a&&"object"===We(a)&&"undefined"!==typeof a.key)r.push(a);else{var u=l;"integer"===t&&"string"===typeof l&&(u=parseInt(l,10)),r.push({group:o?i:void 0,key:u,value:a})}}))})),null!==n&&void 0!==n&&n.placeholder&&!Qe(r,"")?[{key:"",value:""}].concat(r):r}function et(e){return"string"===typeof e?e.replace(/^string:/,""):e}var tt=Object(l["defineComponent"])({props:{modelValue:null,multiple:Boolean,name:String,title:String,availableOptions:Array,uiControlAttributes:Object,uiControlOptions:Object},inheritAttrs:!1,emits:["update:modelValue"],computed:{options:function(){var e=this.availableOptions;return!e||Qe(e,"")||"undefined"!==typeof this.modelValue&&null!==this.modelValue&&""!==this.modelValue?e:[{key:"",value:this.modelValue,group:this.hasGroups?"":void 0}].concat(De(e))},hasGroups:function(){var e=this.availableOptions;return e&&e[0]&&"undefined"!==typeof e[0].group},groupedOptions:function(){var e=this.options;if(!this.hasGroups||!e)return null;var t={};e.forEach((function(e){var n=e.group;t[n]=t[n]||[],t[n].push(e)}));var n=Object.entries(t);return n.sort((function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0})),n}},methods:{onChange:function(e){var t,n=e.target;this.multiple?(t=Array.from(n.options).filter((function(e){return e.selected})).map((function(e){return e.value})),t=t.map((function(e){return et(e)}))):(t=n.value,t=et(t)),this.onModelValueChange(this.modelValue),this.$emit("update:modelValue",t)},onModelValueChange:function(e){var t=this;window.$(this.$refs.select).val(e),setTimeout((function(){var n;Ze(t.$refs.select,e,null===(n=t.uiControlAttributes)||void 0===n?void 0:n.placeholder,t.uiControlOptions,t.multiple)}))}},watch:{modelValue:function(e){this.onModelValueChange(e)},"uiControlAttributes.disabled":{handler:function(e,t){var n=this;setTimeout((function(){var o;e!==t&&Ze(n.$refs.select,n.modelValue,null===(o=n.uiControlAttributes)||void 0===o?void 0:o.placeholder,n.uiControlOptions,n.multiple)}))}},availableOptions:function(e,t){var n=this;e!==t&&setTimeout((function(){var e;Ze(n.$refs.select,n.modelValue,null===(e=n.uiControlAttributes)||void 0===e?void 0:e.placeholder,n.uiControlOptions,n.multiple)}))}},mounted:function(){var e=this;setTimeout((function(){var t;Ze(e.$refs.select,e.modelValue,null===(t=e.uiControlAttributes)||void 0===t?void 0:t.placeholder,e.uiControlOptions,e.multiple)}))}});tt.render=He;var nt=tt,ot=["for","innerHTML"],it={class:"sites_autocomplete"};function rt(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("SiteSelector");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,class:"siteSelectorLabel",innerHTML:e.$sanitize(e.title)},null,8,ot),Object(l["createElementVNode"])("div",it,[Object(l["createVNode"])(a,Object(l["mergeProps"])({"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)}),id:e.name,"show-all-sites-item":e.uiControlAttributes.showAllSitesItem||!1,"switch-site-on-select":!1,"show-selected-site":!0,"only-sites-with-admin-access":e.uiControlAttributes.onlySitesWithAdminAccess||!1},e.uiControlAttributes),null,16,["model-value","id","show-all-sites-item","only-sites-with-admin-access"])])])}var lt=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:Object,uiControlAttributes:Object},inheritAttrs:!1,components:{SiteSelector:r["SiteSelector"]},emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});lt.render=rt;var at=lt,ut=["type","id","name","value"],ct=["for","innerHTML"];function st(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,id:e.name,name:e.name,value:e.modelValueText,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)})},e.uiControlAttributes),null,16,ut),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,ct)],64)}var dt=Object(l["defineComponent"])({props:{title:String,name:String,uiControlAttributes:Object,modelValue:[String,Number],uiControl:String},inheritAttrs:!1,emits:["update:modelValue"],computed:{modelValueText:function(){return"undefined"===typeof this.modelValue||null===this.modelValue?"":this.modelValue.toString()}},created:function(){this.onKeydown=Object(r["debounce"])(this.onKeydown.bind(this),50)},mounted:function(){setTimeout((function(){window.Materialize.updateTextFields()}))},watch:{modelValue:function(){setTimeout((function(){window.Materialize.updateTextFields()}))}},methods:{onKeydown:function(e){var t=this,n=e.target.value;this.modelValue!==n&&(this.$emit("update:modelValue",n),Object(l["nextTick"])((function(){e.target.value!==t.modelValueText&&(e.target.value=t.modelValueText)})))}}});dt.render=st;var mt=dt,ft=["for","innerHTML"],pt=["type","name","value"];function bt(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,ft),Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,name:e.name,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),value:e.concattedValues},e.uiControlAttributes),null,16,pt)])}var vt=Object(l["defineComponent"])({props:{name:String,title:String,uiControl:String,modelValue:Array,uiControlAttributes:Object},inheritAttrs:!1,computed:{concattedValues:function(){return"string"===typeof this.modelValue?this.modelValue:(this.modelValue||[]).join(", ")}},emits:["update:modelValue"],created:function(){this.onKeydown=Object(r["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=this,n=e.target.value.split(",").map((function(e){return e.trim()}));n.join(", ")!==this.concattedValues&&(this.$emit("update:modelValue",n),Object(l["nextTick"])((function(){e.target.value!==t.concattedValues&&(e.target.value=t.concattedValues)})))}}});vt.render=bt;var ht=vt,gt=["name","id","value"],Ot=["for","innerHTML"];function jt(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("textarea",Object(l["mergeProps"])({name:e.name},e.uiControlAttributes,{id:e.name,value:e.modelValueText,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),class:"materialize-textarea",ref:"textarea"}),null,16,gt),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Ot)],64)}var yt=Object(l["defineComponent"])({props:{name:String,uiControlAttributes:Object,modelValue:String,title:String},inheritAttrs:!1,emits:["update:modelValue"],created:function(){this.onKeydown=Object(r["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=this,n=e.target.value;e.target.value=this.modelValueText,this.$emit("update:modelValue",n),Object(l["nextTick"])((function(){e.target.value!==t.modelValueText&&(e.target.value=t.modelValueText)}))}},computed:{modelValueText:function(){return this.modelValue||""}},watch:{modelValue:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}},mounted:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}});yt.render=jt;var Vt=yt,wt=["for","innerHTML"],Ct=["name","value"];function St(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,wt),Object(l["createElementVNode"])("textarea",Object(l["mergeProps"])({ref:"textarea",name:e.name},e.uiControlAttributes,{value:e.concattedValue,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),class:"materialize-textarea"}),null,16,Ct)])}var kt="\n",At=Object(l["defineComponent"])({props:{name:String,title:String,uiControlAttributes:Object,modelValue:[Array,String]},inheritAttrs:!1,emits:["update:modelValue"],computed:{concattedValue:function(){return"string"===typeof this.modelValue?this.modelValue:(this.modelValue||[]).join(kt)}},created:function(){this.onKeydown=Object(r["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=this,n=e.target.value.split(kt);n.join(kt)!==this.concattedValue&&(this.$emit("update:modelValue",n),Object(l["nextTick"])((function(){e.target.value!==t.concattedValue&&(e.target.value=t.concattedValue)})))}},watch:{modelValue:function(e,t){var n=this;e!==t&&setTimeout((function(){n.$refs.textarea&&window.Materialize.textareaAutoResize(n.$refs.textarea),window.Materialize.updateTextFields()}))}},mounted:function(){var e=this;setTimeout((function(){e.$refs.textarea&&window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}});At.render=St;var Ft=At;function Bt(e){return Bt="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bt(e)}function xt(e,t){return Mt(e)||$t(e,t)||Nt(e,t)||Et()}function Et(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Nt(e,t){if(e){if("string"===typeof e)return Tt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tt(e,t):void 0}}function Tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function $t(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){a=!0,i=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw i}}return r}}function Mt(e){if(Array.isArray(e))return e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Pt(e,t){if(!e)return[];var n=[];return Object.entries(e).forEach((function(e){var o=Et(e,2),i=o[0],r=o[1];if(r&&"object"===Bt(r)&&"undefined"!==typeof r.key)n.push(r);else{var l=i;"integer"===t&&"string"===typeof i&&(l=parseInt(l,10)),n.push({key:l,value:r})}})),n}var Jt={ref:"root"};function Ht(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",Jt,null,512)}function Dt(e){if("undefined"!==typeof e)return JSON.parse(JSON.stringify(e))}var It=Object(l["defineComponent"])({props:{modelValue:null,formField:{type:null,required:!0},templateFile:{type:String,required:!0}},emits:["update:modelValue"],inheritAttrs:!1,setup:function(e,t){var n=Object(l["ref"])(null),o=window.$("<div ng-include=\"'".concat(e.templateFile,"?cb=").concat(r["Matomo"].cacheBuster,"'\"></div>")),i=r["Matomo"].helper.getAngularDependency("$timeout"),a=r["Matomo"].helper.getAngularDependency("$rootScope"),u=a.$new();return u.formField=Object.assign(Object.assign({},Dt(e.formField)),{},{value:Dt(e.modelValue)}),u.$watch("formField.value",(function(n,o){n!==o&&JSON.stringify(n)!==JSON.stringify(e.modelValue)&&t.emit("update:modelValue",Dt(n))})),Object(l["watch"])((function(){return e.modelValue}),(function(e){JSON.stringify(e)!==JSON.stringify(u.formField.value)&&i((function(){u.formField.value=e}))})),Object(l["watch"])((function(){return e.formField}),(function(e){i((function(){var t=u.formField.value;u.formField=Object.assign(Object.assign({},Dt(e)),{},{value:t})}))}),{deep:!0}),Object(l["onMounted"])((function(){window.$(n.value).append(o),r["Matomo"].helper.compileAngularComponents(o,{scope:u,params:{formField:Object.assign(Object.assign({},Dt(e.formField)),{},{value:e.modelValue})}})})),{root:n}}});It.render=Ht;var Lt=It;function zt(e){return zt="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zt(e)}var Ut=["password","url","search","email"],Kt=["textarea","checkbox","text"],_t={checkbox:"FieldCheckbox","expandable-select":"FieldExpandableSelect","field-array":"FieldFieldArray",file:"FieldFile",hidden:"FieldHidden",multiselect:"FieldSelect",multituple:"FieldMultituple",number:"FieldNumber",radio:"FieldRadio",select:"FieldSelect",site:"FieldSite",text:"FieldText",textarea:"FieldTextarea"},qt={FieldSelect:Xe,FieldCheckboxArray:Pt,FieldRadio:Pt,FieldExpandableSelect:U},Rt=Object(l["defineComponent"])({props:{modelValue:null,formField:{type:Object,required:!0}},emits:["update:modelValue"],components:{FieldCheckbox:g,FieldCheckboxArray:E,FieldExpandableSelect:_,FieldFieldArray:W,FieldFile:oe,FieldHidden:ae,FieldMultituple:me,FieldNumber:he,FieldRadio:Ve,FieldSelect:nt,FieldSite:at,FieldText:mt,FieldTextArray:ht,FieldTextarea:Vt,FieldTextareaArray:Ft},setup:function(e){var t=Object(l["ref"])(null),n=function(e){var n;e&&t.value&&"function"!==typeof e.render&&(n="string"===typeof e?0===e.indexOf("#")?window.$(e):window.vueSanitize(e):e,window.$(t.value).html("").append(n))};return Object(l["watch"])((function(){return e.formField.inlineHelp}),n),Object(l["onMounted"])((function(){n(e.formField.inlineHelp)})),{inlineHelp:t}},computed:{inlineHelpComponent:function(){var e=this.formField,t=e.inlineHelp;if(t&&"function"===typeof t.render)return e.inlineHelp},inlineHelpBind:function(){return this.inlineHelpComponent?this.formField.inlineHelpBind:void 0},childComponent:function(){var e=this.formField;if(e.component){var t=e.component;if(e.component.plugin){var n=e.component,o=n.plugin,i=n.name;if(!o||!i)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");t=Object(r["useExternalPluginComponent"])(o,i)}return Object(l["markRaw"])(t)}if(e.templateFile)return Object(l["markRaw"])(Lt);var a=e.uiControl,u=_t[a];return-1!==Ut.indexOf(a)&&(u="FieldText"),"array"===this.formField.type&&-1!==Kt.indexOf(a)&&(u="".concat(u,"Array")),u},extraChildComponentParams:function(){return"multiselect"===this.formField.uiControl?{multiple:!0}:{}},showFormHelp:function(){return this.formField.description||this.formField.inlineHelp||this.showDefaultValue||this.hasInlineHelpSlot},showDefaultValue:function(){return this.defaultValuePretty&&"checkbox"!==this.formField.uiControl&&"radio"!==this.formField.uiControl},showField:function(){return!(this.formField&&this.formField.condition&&this.formField.condition instanceof Function)||this.formField.condition()},processedModelValue:function(){var e=this.formField;if("boolean"===e.type){var t=this.modelValue&&this.modelValue>0&&"0"!==this.modelValue;if("checkbox"===e.uiControl)return t;if("radio"===e.uiControl)return t?"1":"0"}return this.modelValue},defaultValue:function(){var e=this.formField.defaultValue;return Array.isArray(e)?e.join(","):e},availableOptions:function(){var e=this.childComponent;if("string"!==typeof e)return null;var t=this.formField;return t.availableValues&&qt[e]?qt[e](t.availableValues,t.type,t.uiControlAttributes):null},defaultValuePretty:function(){var e=this.formField,t=e.defaultValue,n=this.availableOptions;if("string"===typeof t&&t){var o=null;try{o=JSON.parse(t)}catch(r){}if(null!==o&&"object"===zt(o))return""}if(!Array.isArray(n))return Array.isArray(t)?"":t?"".concat(t):"";var i=[];return Array.isArray(t)||(t=[t]),(n||[]).forEach((function(e){"undefined"!==typeof e.value&&-1!==t.indexOf(e.key)&&i.push(e.value)})),i.join(", ")},defaultValuePrettyTruncated:function(){return this.defaultValuePretty.substring(0,50)},hasInlineHelpSlot:function(){var e,t;if(!this.$slots["inline-help"])return!1;var n=this.$slots["inline-help"]();return!(null===n||void 0===n||null===(e=n[0])||void 0===e||null===(t=e.children)||void 0===t||!t.length)}},methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});Rt.render=m;var Gt=Rt; + */function Pt(e,t){if(!e)return[];var n=[];return Object.entries(e).forEach((function(e){var o=xt(e,2),i=o[0],r=o[1];if(r&&"object"===Bt(r)&&"undefined"!==typeof r.key)n.push(r);else{var l=i;"integer"===t&&"string"===typeof i&&(l=parseInt(l,10)),n.push({key:l,value:r})}})),n}var Jt={ref:"root"};function Ht(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",Jt,null,512)}function Dt(e){if("undefined"!==typeof e)return JSON.parse(JSON.stringify(e))}var It=Object(l["defineComponent"])({props:{modelValue:null,formField:{type:null,required:!0},templateFile:{type:String,required:!0}},emits:["update:modelValue"],inheritAttrs:!1,setup:function(e,t){var n=Object(l["ref"])(null),o=window.$("<div ng-include=\"'".concat(e.templateFile,"?cb=").concat(r["Matomo"].cacheBuster,"'\"></div>")),i=r["Matomo"].helper.getAngularDependency("$timeout"),a=r["Matomo"].helper.getAngularDependency("$rootScope"),u=a.$new();return u.formField=Object.assign(Object.assign({},Dt(e.formField)),{},{value:Dt(e.modelValue)}),u.$watch("formField.value",(function(n,o){n!==o&&JSON.stringify(n)!==JSON.stringify(e.modelValue)&&t.emit("update:modelValue",Dt(n))})),Object(l["watch"])((function(){return e.modelValue}),(function(e){JSON.stringify(e)!==JSON.stringify(u.formField.value)&&i((function(){u.formField.value=e}))})),Object(l["watch"])((function(){return e.formField}),(function(e){i((function(){var t=u.formField.value;u.formField=Object.assign(Object.assign({},Dt(e)),{},{value:t})}))}),{deep:!0}),Object(l["onMounted"])((function(){window.$(n.value).append(o),r["Matomo"].helper.compileAngularComponents(o,{scope:u,params:{formField:Object.assign(Object.assign({},Dt(e.formField)),{},{value:e.modelValue})}})})),{root:n}}});It.render=Ht;var Lt=It;function zt(e){return zt="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zt(e)}var Ut=["password","url","search","email"],Kt=["textarea","checkbox","text"],_t={checkbox:"FieldCheckbox","expandable-select":"FieldExpandableSelect","field-array":"FieldFieldArray",file:"FieldFile",hidden:"FieldHidden",multiselect:"FieldSelect",multituple:"FieldMultituple",number:"FieldNumber",radio:"FieldRadio",select:"FieldSelect",site:"FieldSite",text:"FieldText",textarea:"FieldTextarea"},qt={FieldSelect:Xe,FieldCheckboxArray:Pt,FieldRadio:Pt,FieldExpandableSelect:U},Rt=Object(l["defineComponent"])({props:{modelValue:null,formField:{type:Object,required:!0}},emits:["update:modelValue"],components:{FieldCheckbox:g,FieldCheckboxArray:x,FieldExpandableSelect:_,FieldFieldArray:W,FieldFile:oe,FieldHidden:ae,FieldMultituple:me,FieldNumber:he,FieldRadio:Ve,FieldSelect:nt,FieldSite:at,FieldText:mt,FieldTextArray:ht,FieldTextarea:Vt,FieldTextareaArray:Ft},setup:function(e){var t=Object(l["ref"])(null),n=function(e){var n;e&&t.value&&"function"!==typeof e.render&&(n="string"===typeof e?0===e.indexOf("#")?window.$(e):window.vueSanitize(e):e,window.$(t.value).html("").append(n))};return Object(l["watch"])((function(){return e.formField.inlineHelp}),n),Object(l["onMounted"])((function(){n(e.formField.inlineHelp)})),{inlineHelp:t}},computed:{inlineHelpComponent:function(){var e=this.formField,t=e.inlineHelp;if(t&&"function"===typeof t.render)return e.inlineHelp},inlineHelpBind:function(){return this.inlineHelpComponent?this.formField.inlineHelpBind:void 0},childComponent:function(){var e=this.formField;if(e.component){var t=e.component;if(e.component.plugin){var n=e.component,o=n.plugin,i=n.name;if(!o||!i)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");t=Object(r["useExternalPluginComponent"])(o,i)}return Object(l["markRaw"])(t)}if(e.templateFile)return Object(l["markRaw"])(Lt);var a=e.uiControl,u=_t[a];return-1!==Ut.indexOf(a)&&(u="FieldText"),"array"===this.formField.type&&-1!==Kt.indexOf(a)&&(u="".concat(u,"Array")),u},extraChildComponentParams:function(){return"multiselect"===this.formField.uiControl?{multiple:!0}:{}},showFormHelp:function(){return this.formField.description||this.formField.inlineHelp||this.showDefaultValue||this.hasInlineHelpSlot},showDefaultValue:function(){return this.defaultValuePretty&&"checkbox"!==this.formField.uiControl&&"radio"!==this.formField.uiControl},showField:function(){return!(this.formField&&this.formField.condition&&this.formField.condition instanceof Function)||this.formField.condition()},processedModelValue:function(){var e=this.formField;if("boolean"===e.type){var t=this.modelValue&&this.modelValue>0&&"0"!==this.modelValue;if("checkbox"===e.uiControl)return t;if("radio"===e.uiControl)return t?"1":"0"}return this.modelValue},defaultValue:function(){var e=this.formField.defaultValue;return Array.isArray(e)?e.join(","):e},availableOptions:function(){var e=this.childComponent;if("string"!==typeof e)return null;var t=this.formField;return t.availableValues&&qt[e]?qt[e](t.availableValues,t.type,t.uiControlAttributes):null},defaultValuePretty:function(){var e=this.formField,t=e.defaultValue,n=this.availableOptions;if("string"===typeof t&&t){var o=null;try{o=JSON.parse(t)}catch(r){}if(null!==o&&"object"===zt(o))return""}if(!Array.isArray(n))return Array.isArray(t)?"":t?"".concat(t):"";var i=[];return Array.isArray(t)||(t=[t]),(n||[]).forEach((function(e){"undefined"!==typeof e.value&&-1!==t.indexOf(e.key)&&i.push(e.value)})),i.join(", ")},defaultValuePrettyTruncated:function(){return this.defaultValuePretty.substring(0,50)},hasInlineHelpSlot:function(){var e,t;if(!this.$slots["inline-help"])return!1;var n=this.$slots["inline-help"]();return!(null===n||void 0===n||null===(e=n[0])||void 0===e||null===(t=e.children)||void 0===t||!t.length)}},methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});Rt.render=m;var Gt=Rt; /*! * Matomo - free/libre analytics platform * @@ -16,7 +16,7 @@ * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function tn(e,t,n){if("string"===typeof e&&e&&("array"===t||"multituple"===n||"field-array"===n||"multiselect"===n||"site"===n)){var o=JSON.parse(e);return"site"===n&&(o.name=r["Matomo"].helper.htmlDecode(o.name)),o}return"checkbox"===n&&"array"!==t?Object(r["transformAngularJsBoolAttr"])(e):e}Object(r["createAngularJsAdapter"])({component:en,require:"?ngModel",scope:{uicontrol:{angularJsBind:"@"},name:{angularJsBind:"@"},value:{vue:"modelValue",angularJsBind:"@",transform:function(e,t,n){return tn(e,n.varType,n.uicontrol)}},default:{vue:"defaultValue",angularJsBind:"@"},options:{angularJsBind:"="},description:{angularJsBind:"@"},introduction:{angularJsBind:"@"},title:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@"},disabled:{angularJsBind:"=",transform:r["transformAngularJsBoolAttr"]},uiControlAttributes:{angularJsBind:"="},uiControlOptions:{angularJsBind:"="},autocomplete:{angularJsBind:"@",transform:r["transformAngularJsBoolAttr"]},condition:{angularJsBind:"@",transform:function(e,t,n){if(e)return function(t){return n.$eval(e,t)}}},varType:{angularJsBind:"@"},autofocus:{angularJsBind:"@",transform:r["transformAngularJsBoolAttr"]},tabindex:{angularJsBind:"@",transform:r["transformAngularJsIntAttr"]},fullWidth:{angularJsBind:"@",transform:r["transformAngularJsBoolAttr"]},maxlength:{angularJsBind:"@",transform:r["transformAngularJsIntAttr"]},required:{angularJsBind:"@",transform:r["transformAngularJsBoolAttr"]},placeholder:{angularJsBind:"@"},rows:{angularJsBind:"@",transform:r["transformAngularJsIntAttr"]},min:{angularJsBind:"@",transform:r["transformAngularJsIntAttr"]},max:{angularJsBind:"@",transform:r["transformAngularJsIntAttr"]},component:{angularJsBind:"<",transform:function(e,t,n){if(e){if(n.templateFile)return Object(l["shallowRef"])(Lt);var o=e.plugin,i=e.name;if(!o||!i)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");return Object(l["shallowRef"])(Object(r["useExternalPluginComponent"])(o,i))}}}},directiveName:"piwikField",$inject:["$timeout"],events:{"update:modelValue":function(e,t,n,o,i,r,l){var a=r?r.$viewValue:n.value;e!==a&&l((function(){r?(r.$setViewValue(e),r.$render()):n.value=e}))}},postCreate:function(e,t,n,o,i){var a=i;if(a){if(a.$render=function(){Object(l["nextTick"])((function(){e.modelValue=Object(r["removeAngularJsSpecificProperties"])(a.$viewValue)}))},"undefined"!==typeof t.value){var u=tn(t.value,t.varType,t.uicontrol);a.$setViewValue(u)}else a.$setViewValue(e.modelValue);"site"===t.uicontrol&&a.$viewValue&&setTimeout((function(){a.$setViewValue(Object.assign({},a.$viewValue))}))}else t.$watch("value",(function(n){if(n!==e.modelValue){var o=tn(n,t.varType,t.uicontrol);Object(l["nextTick"])((function(){e.modelValue=o}))}}))}});var nn,on={class:"pluginSettings",ref:"root"},rn=["id"],ln={class:"card-content"},an=["id"],un=["onClick","disabled","value"],cn={class:"confirm-password-modal modal"},sn={class:"modal-content"},dn={class:"modal-footer"},mn=["disabled"];function fn(e,t,n,o,i,r){var a=this,u=Object(l["resolveComponent"])("GroupedSettings"),c=Object(l["resolveComponent"])("ActivityIndicator"),s=Object(l["resolveComponent"])("Field");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",on,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.settingsPerPlugin,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{class:"card",id:"".concat(t.pluginName,"PluginSettings"),key:"".concat(t.pluginName,"PluginSettings")},[Object(l["createElementVNode"])("div",ln,[Object(l["createElementVNode"])("h2",{class:"card-title",id:t.pluginName},Object(l["toDisplayString"])(t.title),9,an),Object(l["createVNode"])(u,{"group-name":t.pluginName,settings:t.settings,"all-setting-values":e.settingValues,onChange:function(n){return e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}},null,8,["group-name","settings","all-setting-values","onChange"]),Object(l["createElementVNode"])("input",{type:"button",onClick:function(n){return e.saveSetting(t.pluginName)},disabled:e.isLoading,class:"pluginsSettingsSubmit btn",value:e.translate("General_Save")},null,8,un),Object(l["createVNode"])(c,{loading:e.isLoading||e.isSaving[t.pluginName]},null,8,["loading"])])],8,rn)})),128)),Object(l["createElementVNode"])("div",cn,[Object(l["createElementVNode"])("div",sn,[Object(l["createElementVNode"])("h2",null,Object(l["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1),Object(l["createElementVNode"])("div",null,[Object(l["createVNode"])(s,{modelValue:e.passwordConfirmation,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.passwordConfirmation=t}),uicontrol:"password",name:"currentUserPassword",autocomplete:!1,"full-width":!0,title:e.translate("UsersManager_YourCurrentPassword")},null,8,["modelValue","title"])])]),Object(l["createElementVNode"])("div",dn,[Object(l["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",disabled:e.passwordConfirmation?void 0:"disabled",onClick:t[1]||(t[1]=function(t){t.preventDefault(),e.save(a.settingsToSave)})},Object(l["toDisplayString"])(e.translate("General_Yes")),9,mn),Object(l["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[2]||(t[2]=function(e){return e.preventDefault()})},Object(l["toDisplayString"])(e.translate("General_No")),1)])])],512)}function pn(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("GroupedSetting");return Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.settings,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{key:"".concat(e.groupPrefix).concat(t.name)},[Object(l["createVNode"])(a,{"model-value":e.allSettingValues["".concat(e.groupPrefix).concat(t.name)],"onUpdate:modelValue":function(n){return e.$emit("change",{name:t.name,value:n})},setting:t,"condition-values":e.settingValues},null,8,["model-value","onUpdate:modelValue","setting","condition-values"])])})),128)}function bn(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("FormField");return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createVNode"])(a,{"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.changeValue(t)}),"form-field":e.settingWithComponent},null,8,["model-value","form-field"])],512)),[[l["vShow"],e.showField]])}var vn=Object(l["defineComponent"])({props:{setting:{type:Object,required:!0},modelValue:null,conditionValues:{type:Object,required:!0}},components:{FormField:Gt},emits:["update:modelValue"],computed:{settingWithComponent:function(){return this.setting.templateFile?Object.assign(Object.assign({},this.setting),{},{component:Lt}):this.setting},showField:function(){var e=this.setting.condition;if(!e)return!0;if(!nn){var t=r["Matomo"].helper.getAngularDependency("$rootScope");nn=t.$new(!0)}return nn.$eval(e,this.conditionValues)}},methods:{changeValue:function(e){this.$emit("update:modelValue",e)}}});vn.render=bn;var hn=vn;function gn(e,t){return wn(e)||Vn(e,t)||yn(e,t)||On()}function On(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function yn(e,t){if(e){if("string"===typeof e)return jn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jn(e,t):void 0}}function jn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Vn(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){a=!0,i=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw i}}return r}}function wn(e){if(Array.isArray(e))return e}var Cn=Object(l["defineComponent"])({props:{groupName:String,settings:{type:Array,required:!0},allSettingValues:{type:Object,required:!0}},emits:["change"],components:{GroupedSetting:hn},computed:{settingValues:function(){var e=this,t=Object.entries(this.allSettingValues).filter((function(t){var n=gn(t,1),o=n[0];if(e.groupName){var i=o.split("."),r=gn(i,1),l=r[0];if(l!==e.groupName)return!1}return!0})).map((function(t){var n=gn(t,2),o=n[0],i=n[1];return e.groupName?[o.split(".")[1],i]:[o,i]}));return Object.fromEntries(t)},groupPrefix:function(){return this.groupName?"".concat(this.groupName,"."):""}}});Cn.render=pn;var Sn=Cn;function kn(e,t){return xn(e)||En(e,t)||Fn(e,t)||An()}function An(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Fn(e,t){if(e){if("string"===typeof e)return Bn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bn(e,t):void 0}}function Bn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function En(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){a=!0,i=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw i}}return r}}function xn(e){if(Array.isArray(e))return e}var Nn=window,Tn=Nn.$,$n=Object(l["defineComponent"])({props:{mode:String},components:{ActivityIndicator:r["ActivityIndicator"],Field:en,GroupedSettings:Sn},data:function(){return{isLoading:!0,isSaving:{},passwordConfirmation:"",settingsToSave:null,settingsPerPlugin:[],settingValues:{}}},created:function(){var e=this;r["AjaxHelper"].fetch({method:this.apiMethod}).then((function(t){e.isLoading=!1,e.settingsPerPlugin=t,t.forEach((function(t){t.settings.forEach((function(n){e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}))})),window.anchorLinkFix.scrollToAnchorInUrl(),e.addSectionsToTableOfContents()})).catch((function(){e.isLoading=!1}))},computed:{apiMethod:function(){return"admin"===this.mode?"CorePluginsAdmin.getSystemSettings":"CorePluginsAdmin.getUserSettings"},saveApiMethod:function(){return"admin"===this.mode?"CorePluginsAdmin.setSystemSettings":"CorePluginsAdmin.setUserSettings"}},methods:{addSectionsToTableOfContents:function(){var e=Tn("#generalSettingsTOC");if(e.length){var t=this.settingsPerPlugin;t.forEach((function(t){var n=t.pluginName,o=t.settings;n&&("CoreAdminHome"===n&&o?o.filter((function(e){return e.introduction})).forEach((function(t){e.append('<a href="#/'.concat(n,'PluginSettings">').concat(t.introduction,"</a> "))})):e.append('<a href="#/'.concat(n,'">').concat(n.replace(/([A-Z])/g," $1").trim(),"</a> ")))}))}},saveSetting:function(e){"admin"===this.mode?this.showPasswordConfirmModal(e):this.save(e)},showPasswordConfirmModal:function(e){var t=this;this.settingsToSave=e;var n=this.$refs.root,o=Tn(n),i=function(n){var i=n.keyCode?n.keyCode:n.which;13===i&&(o.find(".confirm-password-modal").modal("close"),t.save(e))};o.find(".confirm-password-modal").modal({dismissible:!1,onOpenEnd:function(){var e=".modal.open #currentUserPassword";Tn(e).focus(),Tn(e).off("keypress").keypress(i)}}).modal("open")},save:function(e){var t=this,n=this.saveApiMethod;this.isSaving[e]=!0;var o=this.getValuesForPlugin(e);r["AjaxHelper"].post({method:n},{settingValues:o,passwordConfirmation:this.passwordConfirmation}).then((function(){t.isSaving[e]=!1;var n=r["NotificationsStore"].show({message:Object(r["translate"])("CoreAdminHome_PluginSettingsSaveSuccess"),id:"generalSettings",context:"success",type:"transient"});r["NotificationsStore"].scrollToNotification(n)})).catch((function(){t.isSaving[e]=!1})),this.passwordConfirmation="",this.settingsToSave=null},getValuesForPlugin:function(e){var t={};return t[e]||(t[e]=[]),Object.entries(this.settingValues).forEach((function(n){var o=kn(n,2),i=o[0],r=o[1],l=i.split("."),a=kn(l,2),u=a[0],c=a[1];if(u===e){var s=r;!1===s?s="0":!0===s&&(s="1"),t[u].push({name:c,value:s})}})),t}}});$n.render=fn;var Mn=$n,Pn=(Object(r["createAngularJsAdapter"])({component:Mn,scope:{mode:{angularJsBind:"@"}},directiveName:"piwikPluginSettings"}),window),Jn=Pn.$; + */function tn(e,t,n){if("string"===typeof e&&e&&("array"===t||"multituple"===n||"field-array"===n||"multiselect"===n||"site"===n)){var o=JSON.parse(e);return"site"===n&&(o.name=r["Matomo"].helper.htmlDecode(o.name)),o}return"checkbox"===n&&"array"!==t?Object(r["transformAngularJsBoolAttr"])(e):e}Object(r["createAngularJsAdapter"])({component:en,require:"?ngModel",scope:{uicontrol:{angularJsBind:"@"},name:{angularJsBind:"@"},value:{vue:"modelValue",angularJsBind:"@",transform:function(e,t,n){return tn(e,n.varType,n.uicontrol)}},default:{vue:"defaultValue",angularJsBind:"@"},options:{angularJsBind:"="},description:{angularJsBind:"@"},introduction:{angularJsBind:"@"},title:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@"},disabled:{angularJsBind:"=",transform:r["transformAngularJsBoolAttr"]},uiControlAttributes:{angularJsBind:"="},uiControlOptions:{angularJsBind:"="},autocomplete:{angularJsBind:"@",transform:r["transformAngularJsBoolAttr"]},condition:{angularJsBind:"@",transform:function(e,t,n){if(e)return function(t){return n.$eval(e,t)}}},varType:{angularJsBind:"@"},autofocus:{angularJsBind:"@",transform:r["transformAngularJsBoolAttr"]},tabindex:{angularJsBind:"@",transform:r["transformAngularJsIntAttr"]},fullWidth:{angularJsBind:"@",transform:r["transformAngularJsBoolAttr"]},maxlength:{angularJsBind:"@",transform:r["transformAngularJsIntAttr"]},required:{angularJsBind:"@",transform:r["transformAngularJsBoolAttr"]},placeholder:{angularJsBind:"@"},rows:{angularJsBind:"@",transform:r["transformAngularJsIntAttr"]},min:{angularJsBind:"@",transform:r["transformAngularJsIntAttr"]},max:{angularJsBind:"@",transform:r["transformAngularJsIntAttr"]},component:{angularJsBind:"<",transform:function(e,t,n){if(e){if(n.templateFile)return Object(l["shallowRef"])(Lt);var o=e.plugin,i=e.name;if(!o||!i)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");return Object(l["shallowRef"])(Object(r["useExternalPluginComponent"])(o,i))}}}},directiveName:"piwikField",$inject:["$timeout"],events:{"update:modelValue":function(e,t,n,o,i,r,l){var a=r?r.$viewValue:n.value;e!==a&&l((function(){r?(r.$setViewValue(e),r.$render()):n.value=e}))}},postCreate:function(e,t,n,o,i){var a=i;if(a){if(a.$render=function(){Object(l["nextTick"])((function(){e.modelValue=Object(r["removeAngularJsSpecificProperties"])(a.$viewValue)}))},"undefined"!==typeof t.value){var u=tn(t.value,t.varType,t.uicontrol);a.$setViewValue(u)}else a.$setViewValue(e.modelValue);"site"===t.uicontrol&&a.$viewValue&&setTimeout((function(){a.$setViewValue(Object.assign({},a.$viewValue))}))}else t.$watch("value",(function(n){if(n!==e.modelValue){var o=tn(n,t.varType,t.uicontrol);Object(l["nextTick"])((function(){e.modelValue=o}))}}))}});var nn,on={class:"pluginSettings",ref:"root"},rn=["id"],ln={class:"card-content"},an=["id"],un=["onClick","disabled","value"],cn={class:"confirm-password-modal modal"},sn={class:"modal-content"},dn={class:"modal-footer"},mn=["disabled"];function fn(e,t,n,o,i,r){var a=this,u=Object(l["resolveComponent"])("GroupedSettings"),c=Object(l["resolveComponent"])("ActivityIndicator"),s=Object(l["resolveComponent"])("Field");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",on,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.settingsPerPlugin,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{class:"card",id:"".concat(t.pluginName,"PluginSettings"),key:"".concat(t.pluginName,"PluginSettings")},[Object(l["createElementVNode"])("div",ln,[Object(l["createElementVNode"])("h2",{class:"card-title",id:t.pluginName},Object(l["toDisplayString"])(t.title),9,an),Object(l["createVNode"])(u,{"group-name":t.pluginName,settings:t.settings,"all-setting-values":e.settingValues,onChange:function(n){return e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}},null,8,["group-name","settings","all-setting-values","onChange"]),Object(l["createElementVNode"])("input",{type:"button",onClick:function(n){return e.saveSetting(t.pluginName)},disabled:e.isLoading,class:"pluginsSettingsSubmit btn",value:e.translate("General_Save")},null,8,un),Object(l["createVNode"])(c,{loading:e.isLoading||e.isSaving[t.pluginName]},null,8,["loading"])])],8,rn)})),128)),Object(l["createElementVNode"])("div",cn,[Object(l["createElementVNode"])("div",sn,[Object(l["createElementVNode"])("h2",null,Object(l["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1),Object(l["createElementVNode"])("div",null,[Object(l["createVNode"])(s,{modelValue:e.passwordConfirmation,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.passwordConfirmation=t}),uicontrol:"password",name:"currentUserPassword",autocomplete:!1,"full-width":!0,title:e.translate("UsersManager_YourCurrentPassword")},null,8,["modelValue","title"])])]),Object(l["createElementVNode"])("div",dn,[Object(l["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",disabled:e.passwordConfirmation?void 0:"disabled",onClick:t[1]||(t[1]=function(t){t.preventDefault(),e.save(a.settingsToSave)})},Object(l["toDisplayString"])(e.translate("General_Yes")),9,mn),Object(l["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[2]||(t[2]=function(e){return e.preventDefault()})},Object(l["toDisplayString"])(e.translate("General_No")),1)])])],512)}function pn(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("GroupedSetting");return Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.settings,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{key:"".concat(e.groupPrefix).concat(t.name)},[Object(l["createVNode"])(a,{"model-value":e.allSettingValues["".concat(e.groupPrefix).concat(t.name)],"onUpdate:modelValue":function(n){return e.$emit("change",{name:t.name,value:n})},setting:t,"condition-values":e.settingValues},null,8,["model-value","onUpdate:modelValue","setting","condition-values"])])})),128)}function bn(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("FormField");return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createVNode"])(a,{"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.changeValue(t)}),"form-field":e.settingWithComponent},null,8,["model-value","form-field"])],512)),[[l["vShow"],e.showField]])}var vn=Object(l["defineComponent"])({props:{setting:{type:Object,required:!0},modelValue:null,conditionValues:{type:Object,required:!0}},components:{FormField:Gt},emits:["update:modelValue"],computed:{settingWithComponent:function(){return this.setting.templateFile?Object.assign(Object.assign({},this.setting),{},{component:Lt}):this.setting},showField:function(){var e=this.setting.condition;if(!e)return!0;if(!nn){var t=r["Matomo"].helper.getAngularDependency("$rootScope");nn=t.$new(!0)}return nn.$eval(e,this.conditionValues)}},methods:{changeValue:function(e){this.$emit("update:modelValue",e)}}});vn.render=bn;var hn=vn;function gn(e,t){return wn(e)||Vn(e,t)||jn(e,t)||On()}function On(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function jn(e,t){if(e){if("string"===typeof e)return yn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yn(e,t):void 0}}function yn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Vn(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){a=!0,i=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw i}}return r}}function wn(e){if(Array.isArray(e))return e}var Cn=Object(l["defineComponent"])({props:{groupName:String,settings:{type:Array,required:!0},allSettingValues:{type:Object,required:!0}},emits:["change"],components:{GroupedSetting:hn},computed:{settingValues:function(){var e=this,t=Object.entries(this.allSettingValues).filter((function(t){var n=gn(t,1),o=n[0];if(e.groupName){var i=o.split("."),r=gn(i,1),l=r[0];if(l!==e.groupName)return!1}return!0})).map((function(t){var n=gn(t,2),o=n[0],i=n[1];return e.groupName?[o.split(".")[1],i]:[o,i]}));return Object.fromEntries(t)},groupPrefix:function(){return this.groupName?"".concat(this.groupName,"."):""}}});Cn.render=pn;var Sn=Cn;function kn(e,t){return En(e)||xn(e,t)||Fn(e,t)||An()}function An(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Fn(e,t){if(e){if("string"===typeof e)return Bn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bn(e,t):void 0}}function Bn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function xn(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){a=!0,i=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw i}}return r}}function En(e){if(Array.isArray(e))return e}var Nn=window,Tn=Nn.$,$n=Object(l["defineComponent"])({props:{mode:String},components:{ActivityIndicator:r["ActivityIndicator"],Field:en,GroupedSettings:Sn},data:function(){return{isLoading:!0,isSaving:{},passwordConfirmation:"",settingsToSave:null,settingsPerPlugin:[],settingValues:{}}},created:function(){var e=this;r["AjaxHelper"].fetch({method:this.apiMethod}).then((function(t){e.isLoading=!1,e.settingsPerPlugin=t,t.forEach((function(t){t.settings.forEach((function(n){e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}))})),window.anchorLinkFix.scrollToAnchorInUrl(),e.addSectionsToTableOfContents()})).catch((function(){e.isLoading=!1}))},computed:{apiMethod:function(){return"admin"===this.mode?"CorePluginsAdmin.getSystemSettings":"CorePluginsAdmin.getUserSettings"},saveApiMethod:function(){return"admin"===this.mode?"CorePluginsAdmin.setSystemSettings":"CorePluginsAdmin.setUserSettings"}},methods:{addSectionsToTableOfContents:function(){var e=Tn("#generalSettingsTOC");if(e.length){var t=this.settingsPerPlugin;t.forEach((function(t){var n=t.pluginName,o=t.settings;n&&("CoreAdminHome"===n&&o?o.filter((function(e){return e.introduction})).forEach((function(t){e.append('<a href="#/'.concat(n,'PluginSettings">').concat(t.introduction,"</a> "))})):e.append('<a href="#/'.concat(n,'">').concat(n.replace(/([A-Z])/g," $1").trim(),"</a> ")))}))}},saveSetting:function(e){"admin"===this.mode?this.showPasswordConfirmModal(e):this.save(e)},showPasswordConfirmModal:function(e){var t=this;this.settingsToSave=e;var n=this.$refs.root,o=Tn(n),i=function(n){var i=n.keyCode?n.keyCode:n.which;13===i&&(o.find(".confirm-password-modal").modal("close"),t.save(e))};o.find(".confirm-password-modal").modal({dismissible:!1,onOpenEnd:function(){var e=".modal.open #currentUserPassword";Tn(e).focus(),Tn(e).off("keypress").keypress(i)}}).modal("open")},save:function(e){var t=this,n=this.saveApiMethod;this.isSaving[e]=!0;var o=this.getValuesForPlugin(e);r["AjaxHelper"].post({method:n},{settingValues:o,passwordConfirmation:this.passwordConfirmation}).then((function(){t.isSaving[e]=!1;var n=r["NotificationsStore"].show({message:Object(r["translate"])("CoreAdminHome_PluginSettingsSaveSuccess"),id:"generalSettings",context:"success",type:"transient"});r["NotificationsStore"].scrollToNotification(n)})).catch((function(){t.isSaving[e]=!1})),this.passwordConfirmation="",this.settingsToSave=null},getValuesForPlugin:function(e){var t={};return t[e]||(t[e]=[]),Object.entries(this.settingValues).forEach((function(n){var o=kn(n,2),i=o[0],r=o[1],l=i.split("."),a=kn(l,2),u=a[0],c=a[1];if(u===e){var s=r;!1===s?s="0":!0===s&&(s="1"),t[u].push({name:c,value:s})}})),t}}});$n.render=fn;var Mn=$n,Pn=(Object(r["createAngularJsAdapter"])({component:Mn,scope:{mode:{angularJsBind:"@"}},directiveName:"piwikPluginSettings"}),window),Jn=Pn.$; /*! * Matomo - free/libre analytics platform * diff --git a/plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue b/plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue index 32e6b70a0d..9be40168f5 100644 --- a/plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue +++ b/plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue @@ -11,7 +11,7 @@ :type="uiControl" :id="name" :name="name" - :value="(modelValue || '0').toString()" + :value="modelValueFormatted" @keydown="onChange($event)" @change="onChange($event)" v-bind="uiControlAttributes" @@ -20,7 +20,7 @@ </template> <script lang="ts"> -import { defineComponent } from 'vue'; +import { defineComponent, nextTick } from 'vue'; import { debounce } from 'CoreHome'; export default defineComponent({ @@ -40,11 +40,15 @@ export default defineComponent({ onChange(event: Event) { const value = parseFloat((event.target as HTMLInputElement).value); - // change to previous value so the parent component can determine if this change should - // go through - (event.target as HTMLInputElement).value = (this.modelValue || '').toString(); - this.$emit('update:modelValue', value); + + nextTick(() => { + if ((event.target as HTMLInputElement).value !== this.modelValueFormatted) { + // change to previous value if the parent component did not update the model value + // (done manually because Vue will not notice if a value does NOT change) + (event.target as HTMLInputElement).value = this.modelValueFormatted; + } + }); }, }, mounted() { @@ -57,5 +61,10 @@ export default defineComponent({ }); }, }, + computed: { + modelValueFormatted() { + return (this.modelValue || '').toString(); + }, + }, }); </script> diff --git a/plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue b/plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue index 1625a8bc31..16ec53f02e 100644 --- a/plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue +++ b/plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue @@ -23,7 +23,7 @@ </template> <script lang="ts"> -import { defineComponent } from 'vue'; +import { defineComponent, nextTick } from 'vue'; import { debounce } from 'CoreHome'; export default defineComponent({ @@ -65,11 +65,15 @@ export default defineComponent({ onKeydown(event: Event) { const newValue = (event.target as HTMLInputElement).value; if (this.modelValue !== newValue) { - // change to previous value so the parent component can determine if this change should - // go through - (event.target as HTMLInputElement).value = this.modelValueText; - this.$emit('update:modelValue', newValue); + + nextTick(() => { + if ((event.target as HTMLInputElement).value !== this.modelValueText) { + // change to previous value if the parent component did not update the model value + // (done manually because Vue will not notice if a value does NOT change) + (event.target as HTMLInputElement).value = this.modelValueText; + } + }); } }, }, diff --git a/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue b/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue index 70fb296927..e182e95260 100644 --- a/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue +++ b/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue @@ -24,7 +24,7 @@ </template> <script lang="ts"> -import { defineComponent } from 'vue'; +import { defineComponent, nextTick } from 'vue'; import { debounce } from 'CoreHome'; export default defineComponent({ @@ -54,11 +54,15 @@ export default defineComponent({ onKeydown(event: Event) { const values = (event.target as HTMLInputElement).value.split(',').map((v) => v.trim()); if (values.join(', ') !== this.concattedValues) { - // change to previous value so the parent component can determine if this change should - // go through - (event.target as HTMLInputElement).value = this.concattedValues; - this.$emit('update:modelValue', values); + + nextTick(() => { + if ((event.target as HTMLInputElement).value !== this.concattedValues) { + // change to previous value if the parent component did not update the model value + // (done manually because Vue will not notice if a value does NOT change) + (event.target as HTMLInputElement).value = this.concattedValues; + } + }); } }, }, diff --git a/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue b/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue index 1b593c3509..ad2610b200 100644 --- a/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue +++ b/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue @@ -10,7 +10,7 @@ :name="name" v-bind="uiControlAttributes" :id="name" - :value="modelValue" + :value="modelValueText" @keydown="onKeydown($event)" @change="onKeydown($event)" class="materialize-textarea" @@ -20,7 +20,7 @@ </template> <script lang="ts"> -import { defineComponent } from 'vue'; +import { defineComponent, nextTick } from 'vue'; import { debounce } from 'CoreHome'; export default defineComponent({ @@ -41,9 +41,22 @@ export default defineComponent({ // change to previous value so the parent component can determine if this change should // go through - (event.target as HTMLInputElement).value = this.modelValue || ''; + (event.target as HTMLInputElement).value = this.modelValueText; this.$emit('update:modelValue', newValue); + + nextTick(() => { + if ((event.target as HTMLInputElement).value !== this.modelValueText) { + // change to previous value if the parent component did not update the model value + // (done manually because Vue will not notice if a value does NOT change) + (event.target as HTMLInputElement).value = this.modelValueText; + } + }); + }, + }, + computed: { + modelValueText() { + return this.modelValue || ''; }, }, watch: { diff --git a/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue b/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue index 48ea1002f2..510f0f68d7 100644 --- a/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue +++ b/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue @@ -24,7 +24,7 @@ </template> <script lang="ts"> -import { defineComponent } from 'vue'; +import { defineComponent, nextTick } from 'vue'; import { debounce } from 'CoreHome'; const SEPARATOR = '\n'; @@ -54,11 +54,15 @@ export default defineComponent({ onKeydown(event: KeyboardEvent) { const value = (event.target as HTMLTextAreaElement).value.split(SEPARATOR); if (value.join(SEPARATOR) !== this.concattedValue) { - // change to previous value so the parent component can determine if this change should - // go through - (event.target as HTMLInputElement).value = this.concattedValue; - this.$emit('update:modelValue', value); + + nextTick(() => { + if ((event.target as HTMLInputElement).value !== this.concattedValue) { + // change to previous value if the parent component did not update the model value + // (done manually because Vue will not notice if a value does NOT change) + (event.target as HTMLInputElement).value = this.concattedValue; + } + }); } }, }, |