diff --git a/lib/index.js b/lib/index.js index 6d8b1b2..d3c8def 100644 --- a/lib/index.js +++ b/lib/index.js @@ -92,15 +92,65 @@ var hooksProp = { }; // +const { + props, + created, // replace + watch, + computed, + ...others +} = Formulate.defaults.components.FormulateInput; + var script = { - extends: Formulate.defaults.components.FormulateInput, + ...others, props: { + ...props, modelHook: { type: [Function, Object, Array], default: null, }, + standalone: { + type: Boolean, + default: () => false, + }, + }, + + created() { + this.applyInitialValue(); + if ( + !this.standalone && + this.formulateRegister && + typeof this.formulateRegister === "function" + ) { + this.formulateRegister(this.nameOrFallback, this); + } + this.applyDefaultValue(); + if (!this.disableErrors && typeof this.observeErrors === "function") { + this.observeErrors({ + callback: this.setErrors, + type: "input", + field: this.nameOrFallback, + }); + } + this.updateLocalAttributes(this.$attrs); + this.performValidation(); + }, + computed: { + ...computed, + slotProps() { + const fn = this.$formulate.slotProps.bind(this.$formulate); + return { + label: fn(this.type, "label", this.typeProps), + help: fn(this.type, "help", this.typeProps), + errors: fn(this.type, "errors", this.typeProps), + repeatable: fn(this.type, "repeatable", this.typeProps), + addMore: fn(this.type, "addMore", this.typeProps), + remove: fn(this.type, "remove", this.typeProps), + component: fn(this.type, "component", this.typeProps), + }; + }, }, watch: { + ...watch, "context.model": { handler(newModel, oldModel) { const _modelHook = new Hooks(); @@ -116,11 +166,20 @@ var script = { this.$formulate.options.hooks && this.$formulate.options.hooks.model ? this.$formulate.options.hooks.model : []; + defaultModelHooks.map((h) => _modelHook.addHook(h)); - if (newModel !== oldModel) { - this.context.model = _modelHook.apply(newModel, { - oldModel, + let updatedModel = newModel; + + if (this.context.classification === "box") { + if (typeof newModel === "string" && newModel.length === 0) { + updatedModel = false; + } + } + + if (newModel !== oldModel && _modelHook.hooks.length > 0) { + this.context.model = _modelHook.apply(updatedModel, { + oldModel: oldModel, context: this.context, }); } @@ -129,79 +188,79 @@ var script = { }, }; -function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { - if (typeof shadowMode !== 'boolean') { - createInjectorSSR = createInjector; - createInjector = shadowMode; - shadowMode = false; - } - // Vue.extend constructor export interop. - const options = typeof script === 'function' ? script.options : script; - // render functions - if (template && template.render) { - options.render = template.render; - options.staticRenderFns = template.staticRenderFns; - options._compiled = true; - // functional template - if (isFunctionalTemplate) { - options.functional = true; - } - } - // scopedId - if (scopeId) { - options._scopeId = scopeId; - } - let hook; - if (moduleIdentifier) { - // server build - hook = function (context) { - // 2.3 injection - context = - context || // cached call - (this.$vnode && this.$vnode.ssrContext) || // stateful - (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional - // 2.2 with runInNewContext: true - if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { - context = __VUE_SSR_CONTEXT__; - } - // inject component styles - if (style) { - style.call(this, createInjectorSSR(context)); - } - // register component module identifier for async chunk inference - if (context && context._registeredComponents) { - context._registeredComponents.add(moduleIdentifier); - } - }; - // used by ssr in case component is cached and beforeCreate - // never gets called - options._ssrRegister = hook; - } - else if (style) { - hook = shadowMode - ? function (context) { - style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot)); - } - : function (context) { - style.call(this, createInjector(context)); - }; - } - if (hook) { - if (options.functional) { - // register for functional component in vue file - const originalRender = options.render; - options.render = function renderWithStyleInjection(h, context) { - hook.call(context); - return originalRender(h, context); - }; - } - else { - // inject component registration as beforeCreate hook - const existing = options.beforeCreate; - options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; - } - } - return script; +function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { + if (typeof shadowMode !== 'boolean') { + createInjectorSSR = createInjector; + createInjector = shadowMode; + shadowMode = false; + } + // Vue.extend constructor export interop. + const options = typeof script === 'function' ? script.options : script; + // render functions + if (template && template.render) { + options.render = template.render; + options.staticRenderFns = template.staticRenderFns; + options._compiled = true; + // functional template + if (isFunctionalTemplate) { + options.functional = true; + } + } + // scopedId + if (scopeId) { + options._scopeId = scopeId; + } + let hook; + if (moduleIdentifier) { + // server build + hook = function (context) { + // 2.3 injection + context = + context || // cached call + (this.$vnode && this.$vnode.ssrContext) || // stateful + (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional + // 2.2 with runInNewContext: true + if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { + context = __VUE_SSR_CONTEXT__; + } + // inject component styles + if (style) { + style.call(this, createInjectorSSR(context)); + } + // register component module identifier for async chunk inference + if (context && context._registeredComponents) { + context._registeredComponents.add(moduleIdentifier); + } + }; + // used by ssr in case component is cached and beforeCreate + // never gets called + options._ssrRegister = hook; + } + else if (style) { + hook = shadowMode + ? function (context) { + style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot)); + } + : function (context) { + style.call(this, createInjector(context)); + }; + } + if (hook) { + if (options.functional) { + // register for functional component in vue file + const originalRender = options.render; + options.render = function renderWithStyleInjection(h, context) { + hook.call(context); + return originalRender(h, context); + }; + } + else { + // inject component registration as beforeCreate hook + const existing = options.beforeCreate; + options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; + } + } + return script; } /* script */ @@ -425,7 +484,7 @@ function leaf(item, index, { hooks, h, state } = {}) { .addHook(modelHook) .asSingleHook(); - const node = Object.assign({ type, key, depth, component, definition: { attrs: { ...attrs, modelHook: _modelHook } }, children: tree(els, { hooks, h, state }) }); + const node = Object.assign({ name, type, key, depth, component, definition: { attrs: { ...attrs, modelHook: _modelHook } }, children: tree(els, { hooks, h, state }) }); return new Hooks() .setHooks(hooks.schemaNode) @@ -513,11 +572,11 @@ var script$1 = { new Set(Object.keys(values).concat(Object.keys(this.proxy))) ); keys.forEach((field) => { - if (!utils_js.shallowEqualObjects(values[field], this.proxy[field])) { + if (!utils_js.equals(values[field], this.proxy[field])) { this.setFieldValue(field, values[field]); if ( this.registry.has(field) && - !utils_js.shallowEqualObjects( + !utils_js.equals( values[field], this.registry.get(field).proxy ) @@ -713,7 +772,7 @@ var enforceNumber = { }; const components = { FormulateForm: __vue_component__$1, FormulateSchema, FormulateInput: __vue_component__ }; -const features = { formEvents, textMask, enforceNumber }; +const features = { formEvents, enforceNumber, textMask }; // textMask - need to be removed to avoid required dependency function index(options = {}) { let extended = { @@ -753,6 +812,10 @@ function index(options = {}) { if (extended.options.features.textMask) { instance.extend(textMask); + // lazy loaded + // import('./features/text-mask').then((textMask) => { + // instance.extend(textMask.default) + // }) } if (extended.options.features.enforceNumber) { diff --git a/lib/vue-formulate-extended.esm.js b/lib/vue-formulate-extended.esm.js index f4b7ef4..ae0925e 100644 --- a/lib/vue-formulate-extended.esm.js +++ b/lib/vue-formulate-extended.esm.js @@ -1 +1 @@ -import t from"@braid/vue-formulate";import{shallowEqualObjects as e}from"@braid/vue-formulate/src/libs/utils.js";import o from"imask";import n from"@braid/vue-formulate/src/Formulate";var r=function(t){return void 0===t&&(t=[]),this.defaultHook=function(t){return t},this.setHooks(t)};r.prototype.parse=function(t){void 0===t&&(t=[]);var e=Array.isArray(t)?t:[];for(var o of e)this.isProperHook(o)&&this.hooks.push(o);return this},r.prototype.addHook=function(t){return this.isProperHook(t)&&this.isNewHook(t)&&this.hooks.push(t),this},r.prototype.setHooks=function(t){return void 0===t&&(t=[]),this.hooks=t.filter(this.isProperHook),this},r.prototype.setDefault=function(t){return this.defaultHook=t,this},r.prototype.isProperHook=function(t){return t&&"object"==typeof t&&"function"==typeof t.handler},r.prototype.isNewHook=function(t){return this.hooks.findIndex((function(e){return e===t}))<0},r.prototype.getHooks=function(){return this.hooks},r.prototype.empty=function(){return 0===this.hooks.length},r.prototype.apply=function(t,e){return this.empty()?this.defaultHook(t,e):this.hooks.reduce((function(t,o){return o.handler(t,e)}),t)},r.prototype.asSingleHook=function(){var t=this;return{handler:function(e,o){return t.apply(e,o)}}};var s={type:Object,default:function(){return{model:[],schema:[],schemaOptions:[],schemaNode:[],schemaComponent:[]}}};var a=t.defaults.components.FormulateInput,i=a.props,c=(a.created,a.watch),l=a.computed,p=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(o[n]=t[n]);return o}(a,["props","created","watch","computed"]);function u(t,e,o,n,r,s,a,i,c,l){"boolean"!=typeof a&&(c=i,i=a,a=!1);var p,u="function"==typeof o?o.options:o;if(t&&t.render&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),n&&(u._scopeId=n),s?(p=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,c(t)),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=p):e&&(p=a?function(t){e.call(this,l(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,i(t))}),p)if(u.functional){var h=u.render;u.render=function(t,e){return p.call(e),h(t,e)}}else{var m=u.beforeCreate;u.beforeCreate=m?[].concat(m,p):[p]}return o}var h=Object.assign({},p,{props:Object.assign({},i,{modelHook:{type:[Function,Object,Array],default:null},standalone:{type:Boolean,default:function(){return!1}}}),created:function(){this.applyInitialValue(),!this.standalone&&this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.applyDefaultValue(),this.disableErrors||"function"!=typeof this.observeErrors||this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),this.updateLocalAttributes(this.$attrs),this.performValidation()},computed:Object.assign({},l,{slotProps:function(){var t=this.$formulate.slotProps.bind(this.$formulate);return{label:t(this.type,"label",this.typeProps),help:t(this.type,"help",this.typeProps),errors:t(this.type,"errors",this.typeProps),repeatable:t(this.type,"repeatable",this.typeProps),addMore:t(this.type,"addMore",this.typeProps),remove:t(this.type,"remove",this.typeProps),component:t(this.type,"component",this.typeProps)}}}),watch:Object.assign({},c,{"context.model":{handler:function(t,e){var o=new r;Array.isArray(this.modelHook)?this.modelHook.map((function(t){return o.addHook(t)})):"function"==typeof this.modelHook?o.addHook({handler:this.modelHook}):o.addHook(this.modelHook),(this.$formulate.options.hooks&&this.$formulate.options.hooks.model?this.$formulate.options.hooks.model:[]).map((function(t){return o.addHook(t)}));var n=t;"box"===this.context.classification&&"string"==typeof t&&0===t.length&&(n=!1),t!==e&&o.hooks.length>0&&(this.context.model=o.apply(n,{oldModel:e,context:this.context}))}}})}),m=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{class:t.context.classes.outer,attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-has-value":t.hasValue,"data-type":t.type},on:{click:function(e){return t.$emit("outer-click")}}},[o("div",{class:t.context.classes.wrapper,on:{click:function(e){return t.$emit("wrapper-click")}}},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?o(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?o(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[o(t.context.component,t._g(t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.component,!1),t.listeners),[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?o(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?o(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():o(t.context.slotComponents.errors,t._b({tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}},"component",t.context.slotProps.errors,!1))],null,t.context)],2)};m._withStripped=!0;var f=u({render:m,staticRenderFns:[]},void 0,h,void 0,!1,void 0,!1,void 0,void 0,void 0);function d(t,e,o){void 0===o&&(o={});var n=o.hooks,s=o.h,a=o.state;if(t&&"object"==typeof t&&!Array.isArray(t)){var i=t.children;void 0===i&&(i=null);var c=t.component;void 0===c&&(c=f);var l=t.depth;void 0===l&&(l=1);var p=t.modelHook,u=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(o[n]=t[n]);return o}(t,["children","component","depth","modelHook"]),h=c===f?u.type||"text":"",m=u.name||h||"el",d=u.id||m+"-"+l+"-"+e,y=Array.isArray(i)?i.map((function(t){return Object.assign(t,{depth:l+1})})):i,k=(new r).setHooks(n.model).addHook(p).asSingleHook(),b=Object.assign({name:m,type:h,key:d,depth:l,component:c,definition:{attrs:Object.assign({},u,{modelHook:k})},children:v(y,{hooks:n,h:s,state:a})});return(new r).setHooks(n.schemaNode).setDefault((function(){return b})).apply(b,{state:a})}return null}function v(t,e){void 0===e&&(e={});var o=e.hooks,n=e.h,s=e.state;return Array.isArray(t)?t.map((function(t,e){var a=d(t,e,{hooks:o,h:n,state:s});return(new r).setHooks(o.schemaComponent).setDefault((function(){return n(a.component,a.definition,a.children)})).apply(a)})):t}var y={functional:!1,name:"FormulateSchema",props:{schema:t.defaults.components.FormulateForm.props.schema,hooks:s,formClass:{type:String,default:null}},data:function(){return{schemaHooks:null,schemaOptionsHooks:null}},methods:{emit:function(t,e){this.$emit(t,e)}},beforeMount:function(){this.schemaHooks=(new r).setHooks(this.hooks.schema),this.schemaOptionsHooks=(new r).setHooks(this.hooks.schemaOptions).setDefault((function(t){return t}))},render:function(t){return this.schemaHooks.apply(t("div",{class:this.$props.formClass},v(this.schema,this.schemaOptionsHooks.apply({hooks:this.hooks,h:t,state:{}},{emit:this.emit,props:this.$props}))),{emit:this.emit,props:this.$props})}},k={extends:t.defaults.components.FormulateForm,components:{FormulateSchema:y},props:{hooks:s,formClass:{type:String,default:null}},computed:{cleanedHooks:function(){var e=this,o=s.default();return Object.keys(o).forEach((function(t){o[t]=(new r).parse(e.hooks[t]).getHooks()})),t.merge(this.$formulate.options.hooks||{},o)}},watch:{formulateValue:{handler:function(t){var o=this;this.isVmodeled&&t&&"object"==typeof t&&Array.from(new Set(Object.keys(t).concat(Object.keys(this.proxy)))).forEach((function(n){e(t[n],o.proxy[n])||(o.setFieldValue(n,t[n]),o.registry.has(n)&&!e(t[n],o.registry.get(n).proxy)&&(o.registry.get(n).context.model=t[n]))}))},deep:!0}}},b=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.schema?o("FormulateSchema",{attrs:{schema:t.schema,hooks:t.cleanedHooks,formClass:t.formClass},on:{events:function(e){return t.$emit("events",e)}}}):t._e(),t._v(" "),t.hasFormErrorObservers?t._e():o("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default")],2)};b._withStripped=!0;var x=u({render:b,staticRenderFns:[]},void 0,k,void 0,!1,void 0,!1,void 0,void 0,void 0),_=function(){this.store=new Map};_.prototype.on=function(t,e){var o=this.store.get(t);o&&o.push(e)||this.store.set(t,[e])},_.prototype.off=function(t,e){var o=this.store.get(t),n=o.indexOf(e);o&&n>-1&&o.splice(n,1)},_.prototype.emit=function(t,e){this.store.get(t).slice().map((function(t){return t(e)}))};var g={hooks:{schemaOptions:[{handler:function(t,e){void 0===e&&(e={});var o=e.emit;return t.state=t.state||{},t.state.eventBus=new _,t.state.eventBus.on("events",(function(t){return o("events",t)})),t}}],schemaNode:[{handler:function(t,e){void 0===e&&(e={});var o=e.state,n=t.definition.attrs,r=n.events;void 0===r&&(r=[]);var s=n.on;void 0===s&&(s={});var a=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(o[n]=t[n]);return o}(n,["events","on"]);return t.definition.attrs=a,t.definition.on=Object.assign({},s,r.reduce((function(e,n){return e[n]=function(e){s[n]&&s[n](e),o.eventBus.emit("events",{eventName:n,name:t.name,type:t.type,key:t.key,payload:e})},e}),{})),t}}]}},H={hooks:{model:[{handler:function(t,e){var n=e.context,r="vfe-mask"in n.attributes||"vfeMask"in n.attributes;if("text"===n.classification&&r){var s=n.attributes["vfe-mask"]||n.attributes.vfeMask,a="object"==typeof s&&s.mask?s:{mask:s};return o.createMask(a).resolve(t)}return t}}]}},F={hooks:{model:[{handler:function(t,e){var o=e.context,n="string"==typeof o.attributes.vfeNumber||o.attributes.vfeNumber||"string"==typeof o.attributes["vfe-number"]||o.attributes["vfe-number"];return"number"===o.type&&"string"==typeof t&&n?+t:t}}]}},O={FormulateForm:x,FormulateSchema:y,FormulateInput:f},P={formEvents:g,enforceNumber:F,textMask:H};export default function(t){void 0===t&&(t={});var e=n.merge({features:{formEvents:!0,textMask:!1,enforceNumber:!1},override:{FormulateForm:!0,FormulateInput:!0,FormulateSchema:!0}},t);return function(t){e.override.FormulateForm&&t.extend({components:{FormulateForm:x}}),e.override.FormulateInput&&t.extend({components:{FormulateInput:f}}),e.override.FormulateSchema&&t.extend({components:{FormulateSchema:y}}),e.features.formEvents&&t.extend(g),e.features.textMask&&t.extend(H),e.features.enforceNumber&&t.extend(F)}}export{O as components,P as features}; +import t from"@braid/vue-formulate";import{equals as e}from"@braid/vue-formulate/src/libs/utils.js";import o from"imask";import n from"@braid/vue-formulate/src/Formulate";var r=function(t){return void 0===t&&(t=[]),this.defaultHook=function(t){return t},this.setHooks(t)};r.prototype.parse=function(t){void 0===t&&(t=[]);var e=Array.isArray(t)?t:[];for(var o of e)this.isProperHook(o)&&this.hooks.push(o);return this},r.prototype.addHook=function(t){return this.isProperHook(t)&&this.isNewHook(t)&&this.hooks.push(t),this},r.prototype.setHooks=function(t){return void 0===t&&(t=[]),this.hooks=t.filter(this.isProperHook),this},r.prototype.setDefault=function(t){return this.defaultHook=t,this},r.prototype.isProperHook=function(t){return t&&"object"==typeof t&&"function"==typeof t.handler},r.prototype.isNewHook=function(t){return this.hooks.findIndex((function(e){return e===t}))<0},r.prototype.getHooks=function(){return this.hooks},r.prototype.empty=function(){return 0===this.hooks.length},r.prototype.apply=function(t,e){return this.empty()?this.defaultHook(t,e):this.hooks.reduce((function(t,o){return o.handler(t,e)}),t)},r.prototype.asSingleHook=function(){var t=this;return{handler:function(e,o){return t.apply(e,o)}}};var s={type:Object,default:function(){return{model:[],schema:[],schemaOptions:[],schemaNode:[],schemaComponent:[]}}};var a=t.defaults.components.FormulateInput,i=a.props,c=(a.created,a.watch),l=a.computed,p=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(o[n]=t[n]);return o}(a,["props","created","watch","computed"]);function u(t,e,o,n,r,s,a,i,c,l){"boolean"!=typeof a&&(c=i,i=a,a=!1);var p,u="function"==typeof o?o.options:o;if(t&&t.render&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),n&&(u._scopeId=n),s?(p=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,c(t)),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=p):e&&(p=a?function(t){e.call(this,l(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,i(t))}),p)if(u.functional){var h=u.render;u.render=function(t,e){return p.call(e),h(t,e)}}else{var m=u.beforeCreate;u.beforeCreate=m?[].concat(m,p):[p]}return o}var h=Object.assign({},p,{props:Object.assign({},i,{modelHook:{type:[Function,Object,Array],default:null},standalone:{type:Boolean,default:function(){return!1}}}),created:function(){this.applyInitialValue(),!this.standalone&&this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.applyDefaultValue(),this.disableErrors||"function"!=typeof this.observeErrors||this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),this.updateLocalAttributes(this.$attrs),this.performValidation()},computed:Object.assign({},l,{slotProps:function(){var t=this.$formulate.slotProps.bind(this.$formulate);return{label:t(this.type,"label",this.typeProps),help:t(this.type,"help",this.typeProps),errors:t(this.type,"errors",this.typeProps),repeatable:t(this.type,"repeatable",this.typeProps),addMore:t(this.type,"addMore",this.typeProps),remove:t(this.type,"remove",this.typeProps),component:t(this.type,"component",this.typeProps)}}}),watch:Object.assign({},c,{"context.model":{handler:function(t,e){var o=new r;Array.isArray(this.modelHook)?this.modelHook.map((function(t){return o.addHook(t)})):"function"==typeof this.modelHook?o.addHook({handler:this.modelHook}):o.addHook(this.modelHook),(this.$formulate.options.hooks&&this.$formulate.options.hooks.model?this.$formulate.options.hooks.model:[]).map((function(t){return o.addHook(t)}));var n=t;"box"===this.context.classification&&"string"==typeof t&&0===t.length&&(n=!1),t!==e&&o.hooks.length>0&&(this.context.model=o.apply(n,{oldModel:e,context:this.context}))}}})}),m=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{class:t.context.classes.outer,attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-has-value":t.hasValue,"data-type":t.type},on:{click:function(e){return t.$emit("outer-click")}}},[o("div",{class:t.context.classes.wrapper,on:{click:function(e){return t.$emit("wrapper-click")}}},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?o(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?o(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[o(t.context.component,t._g(t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.component,!1),t.listeners),[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?o(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?o(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():o(t.context.slotComponents.errors,t._b({tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}},"component",t.context.slotProps.errors,!1))],null,t.context)],2)};m._withStripped=!0;var f=u({render:m,staticRenderFns:[]},void 0,h,void 0,!1,void 0,!1,void 0,void 0,void 0);function d(t,e,o){void 0===o&&(o={});var n=o.hooks,s=o.h,a=o.state;if(t&&"object"==typeof t&&!Array.isArray(t)){var i=t.children;void 0===i&&(i=null);var c=t.component;void 0===c&&(c=f);var l=t.depth;void 0===l&&(l=1);var p=t.modelHook,u=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(o[n]=t[n]);return o}(t,["children","component","depth","modelHook"]),h=c===f?u.type||"text":"",m=u.name||h||"el",d=u.id||m+"-"+l+"-"+e,y=Array.isArray(i)?i.map((function(t){return Object.assign(t,{depth:l+1})})):i,k=(new r).setHooks(n.model).addHook(p).asSingleHook(),b=Object.assign({name:m,type:h,key:d,depth:l,component:c,definition:{attrs:Object.assign({},u,{modelHook:k})},children:v(y,{hooks:n,h:s,state:a})});return(new r).setHooks(n.schemaNode).setDefault((function(){return b})).apply(b,{state:a})}return null}function v(t,e){void 0===e&&(e={});var o=e.hooks,n=e.h,s=e.state;return Array.isArray(t)?t.map((function(t,e){var a=d(t,e,{hooks:o,h:n,state:s});return(new r).setHooks(o.schemaComponent).setDefault((function(){return n(a.component,a.definition,a.children)})).apply(a)})):t}var y={functional:!1,name:"FormulateSchema",props:{schema:t.defaults.components.FormulateForm.props.schema,hooks:s,formClass:{type:String,default:null}},data:function(){return{schemaHooks:null,schemaOptionsHooks:null}},methods:{emit:function(t,e){this.$emit(t,e)}},beforeMount:function(){this.schemaHooks=(new r).setHooks(this.hooks.schema),this.schemaOptionsHooks=(new r).setHooks(this.hooks.schemaOptions).setDefault((function(t){return t}))},render:function(t){return this.schemaHooks.apply(t("div",{class:this.$props.formClass},v(this.schema,this.schemaOptionsHooks.apply({hooks:this.hooks,h:t,state:{}},{emit:this.emit,props:this.$props}))),{emit:this.emit,props:this.$props})}},k={extends:t.defaults.components.FormulateForm,components:{FormulateSchema:y},props:{hooks:s,formClass:{type:String,default:null}},computed:{cleanedHooks:function(){var e=this,o=s.default();return Object.keys(o).forEach((function(t){o[t]=(new r).parse(e.hooks[t]).getHooks()})),t.merge(this.$formulate.options.hooks||{},o)}},watch:{formulateValue:{handler:function(t){var o=this;this.isVmodeled&&t&&"object"==typeof t&&Array.from(new Set(Object.keys(t).concat(Object.keys(this.proxy)))).forEach((function(n){e(t[n],o.proxy[n])||(o.setFieldValue(n,t[n]),o.registry.has(n)&&!e(t[n],o.registry.get(n).proxy)&&(o.registry.get(n).context.model=t[n]))}))},deep:!0}}},b=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.schema?o("FormulateSchema",{attrs:{schema:t.schema,hooks:t.cleanedHooks,formClass:t.formClass},on:{events:function(e){return t.$emit("events",e)}}}):t._e(),t._v(" "),t.hasFormErrorObservers?t._e():o("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default")],2)};b._withStripped=!0;var x=u({render:b,staticRenderFns:[]},void 0,k,void 0,!1,void 0,!1,void 0,void 0,void 0),_=function(){this.store=new Map};_.prototype.on=function(t,e){var o=this.store.get(t);o&&o.push(e)||this.store.set(t,[e])},_.prototype.off=function(t,e){var o=this.store.get(t),n=o.indexOf(e);o&&n>-1&&o.splice(n,1)},_.prototype.emit=function(t,e){this.store.get(t).slice().map((function(t){return t(e)}))};var g={hooks:{schemaOptions:[{handler:function(t,e){void 0===e&&(e={});var o=e.emit;return t.state=t.state||{},t.state.eventBus=new _,t.state.eventBus.on("events",(function(t){return o("events",t)})),t}}],schemaNode:[{handler:function(t,e){void 0===e&&(e={});var o=e.state,n=t.definition.attrs,r=n.events;void 0===r&&(r=[]);var s=n.on;void 0===s&&(s={});var a=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(o[n]=t[n]);return o}(n,["events","on"]);return t.definition.attrs=a,t.definition.on=Object.assign({},s,r.reduce((function(e,n){return e[n]=function(e){s[n]&&s[n](e),o.eventBus.emit("events",{eventName:n,name:t.name,type:t.type,key:t.key,payload:e})},e}),{})),t}}]}},H={hooks:{model:[{handler:function(t,e){var n=e.context,r="vfe-mask"in n.attributes||"vfeMask"in n.attributes;if("text"===n.classification&&r){var s=n.attributes["vfe-mask"]||n.attributes.vfeMask,a="object"==typeof s&&s.mask?s:{mask:s};return o.createMask(a).resolve(t)}return t}}]}},F={hooks:{model:[{handler:function(t,e){var o=e.context,n="string"==typeof o.attributes.vfeNumber||o.attributes.vfeNumber||"string"==typeof o.attributes["vfe-number"]||o.attributes["vfe-number"];return"number"===o.type&&"string"==typeof t&&n?+t:t}}]}},O={FormulateForm:x,FormulateSchema:y,FormulateInput:f},P={formEvents:g,enforceNumber:F,textMask:H};export default function(t){void 0===t&&(t={});var e=n.merge({features:{formEvents:!0,textMask:!1,enforceNumber:!1},override:{FormulateForm:!0,FormulateInput:!0,FormulateSchema:!0}},t);return function(t){e.override.FormulateForm&&t.extend({components:{FormulateForm:x}}),e.override.FormulateInput&&t.extend({components:{FormulateInput:f}}),e.override.FormulateSchema&&t.extend({components:{FormulateSchema:y}}),e.features.formEvents&&t.extend(g),e.features.textMask&&t.extend(H),e.features.enforceNumber&&t.extend(F)}}export{O as components,P as features}; diff --git a/lib/vue-formulate-extended.min.js b/lib/vue-formulate-extended.min.js index c848b18..c22251a 100644 --- a/lib/vue-formulate-extended.min.js +++ b/lib/vue-formulate-extended.min.js @@ -1,4 +1,4 @@ -var VueFormulateExtended=function(t){"use strict";var e=function(t){if("string"!=typeof t)return!1;var e=t.match(r);if(!e)return!1;var o=e[1];if(!o)return!1;if(n.test(o)||i.test(o))return!0;return!1},r=/^(?:\w+:)?\/\/(\S+)$/,n=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,i=/^[^\s\.]+\.\S{2,}$/;for(var o="-_",s=36;s--;)o+=s.toString(36);for(s=36;s---10;)o+=s.toString(36).toUpperCase();var a=function(t){var e="";for(s=t||21;s--;)e+=o[64*Math.random()|0];return e}; +var VueFormulateExtended=function(t){"use strict";var e=function(t){if("string"!=typeof t)return!1;var e=t.match(r);if(!e)return!1;var i=e[1];if(!i)return!1;if(n.test(i)||o.test(i))return!0;return!1},r=/^(?:\w+:)?\/\/(\S+)$/,n=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,o=/^[^\s\.]+\.\S{2,}$/;for(var i="-_",s=36;s--;)i+=s.toString(36);for(s=36;s---10;)i+=s.toString(36).toUpperCase();var a=function(t){var e="";for(s=t||21;s--;)e+=i[64*Math.random()|0];return e}; /*! * isobject * @@ -11,4 +11,4 @@ var VueFormulateExtended=function(t){"use strict";var e=function(t){if("string"! * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ -function u(t){return!0==(null!=(e=t)&&"object"==typeof e&&!1===Array.isArray(e))&&"[object Object]"===Object.prototype.toString.call(t);var e}function l(t){var e,r;return!1!==u(t)&&("function"==typeof(e=t.constructor)&&(!1!==u(r=e.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf")))}function c(t){return"string"==typeof t?t[0].toUpperCase()+t.substr(1):t}var h={accepted:function(t){return"Please accept the "+t.name+"."},after:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?c(e)+" must be after "+r[0]+".":c(e)+" must be a later date."},alpha:function(t){return c(t.name)+" can only contain alphabetical characters."},alphanumeric:function(t){return c(t.name)+" can only contain letters and numbers."},before:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?c(e)+" must be before "+r[0]+".":c(e)+" must be an earlier date."},between:function(t){var e=t.name,r=t.value,n=t.args,i=!(!Array.isArray(n)||!n[2])&&n[2];return!isNaN(r)&&"length"!==i||"value"===i?c(e)+" must be between "+n[0]+" and "+n[1]+".":c(e)+" must be between "+n[0]+" and "+n[1]+" characters long."},confirm:function(t){var e=t.name;return t.args,c(e)+" does not match."},date:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?c(e)+" is not a valid date, please use the format "+r[0]:c(e)+" is not a valid date."},default:function(t){return t.name,"This field isn’t valid."},email:function(t){t.name;var e=t.value;return e?"“"+e+"” is not a valid email address.":"Please enter a valid email address."},endsWith:function(t){t.name;var e=t.value;return e?"“"+e+"” doesn’t end with a valid value.":"This field doesn’t end with a valid value."},in:function(t){var e=t.name,r=t.value;return"string"==typeof r&&r?"“"+c(r)+"” is not an allowed "+e+".":"This is not an allowed "+e+"."},matches:function(t){return c(t.name)+" is not an allowed value."},max:function(t){var e=t.name,r=t.value,n=t.args;if(Array.isArray(r))return"You may only select "+n[0]+" "+e+".";var i=!(!Array.isArray(n)||!n[1])&&n[1];return!isNaN(r)&&"length"!==i||"value"===i?c(e)+" must be less than or equal to "+n[0]+".":c(e)+" must be less than or equal to "+n[0]+" characters long."},mime:function(t){var e=t.name,r=t.args;return c(e)+" must be of the the type: "+(r[0]||"No file formats allowed.")},min:function(t){var e=t.name,r=t.value,n=t.args;if(Array.isArray(r))return"You need at least "+n[0]+" "+e+".";var i=!(!Array.isArray(n)||!n[1])&&n[1];return!isNaN(r)&&"length"!==i||"value"===i?c(e)+" must be at least "+n[0]+".":c(e)+" must be at least "+n[0]+" characters long."},not:function(t){var e=t.name;return"“"+t.value+"” is not an allowed "+e+"."},number:function(t){return c(t.name)+" must be a number."},required:function(t){return c(t.name)+" is required."},startsWith:function(t){t.name;var e=t.value;return e?"“"+e+"” doesn’t start with a valid value.":"This field doesn’t start with a valid value."},url:function(t){return t.name,"Please include a valid url."}};function d(t){var e;t.extend({locales:(e={},e.en=h,e)})}var p=function(t,e){return{classification:t,component:"FormulateInput"+(e||t[0].toUpperCase()+t.substr(1))}},f=Object.assign({},["text","email","number","color","date","hidden","month","password","search","tel","time","url","week","datetime-local"].reduce((function(t,e){var r;return Object.assign({},t,((r={})[e]=p("text"),r))}),{}),{range:p("slider"),textarea:p("textarea","TextArea"),checkbox:p("box"),radio:p("box"),submit:p("button"),button:p("button"),select:p("select"),file:p("file"),image:p("file"),group:p("group")}),m=function(t,e,r){void 0===r&&(r={}),this.input=t,this.fileList=t.files,this.files=[],this.options=Object.assign({},{mimes:{}},r),this.results=!1,this.context=e,Array.isArray(this.fileList)?this.rehydrateFileList(this.fileList):this.addFileList(this.fileList)};function v(t,e){var r={};for(var n in t)r[n]=e(n,t[n]);return r}function y(t,e){if(t===e)return!0;if(!t||!e)return!1;var r=Object.keys(t),n=Object.keys(e),i=r.length;if(n.length!==i)return!1;for(var o=0;o=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0)}),(function(t){e.progress=0,e.error=t,e.complete=!0}),t.options)}))).then((function(r){t.results=r,e(r)})).catch((function(t){throw new Error(t)}))}))},m.prototype.removeFile=function(t){if(this.files=this.files.filter((function(e){return e.uuid!==t})),this.context.performValidation(),window&&this.fileList instanceof FileList){var e=new DataTransfer;this.files.map((function(t){return e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList}},m.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},m.prototype.getFileList=function(){return this.fileList},m.prototype.getFiles=function(){return this.files},m.prototype.toString=function(){var t=this.files.length?this.files.length+" files":"empty";return this.results?JSON.stringify(this.results,null," "):"FileUpload("+t+")"};var w,P={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var r=t.value;void 0===e&&(e=!1);var n=Date.parse(e||new Date),i=Date.parse(r);return Promise.resolve(!isNaN(i)&&i>n)},alpha:function(t,e){var r=t.value;void 0===e&&(e="default");var n={default:/^[a-zA-ZÀ-ÖØ-öø-ÿĄąĆćĘꣳŃńŚśŹźŻż]+$/,latin:/^[a-zA-Z]+$/},i=n.hasOwnProperty(e)?e:"default";return Promise.resolve(n[i].test(r))},alphanumeric:function(t,e){var r=t.value;void 0===e&&(e="default");var n={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿĄąĆćĘꣳŃńŚśŹźŻż]+$/,latin:/^[a-zA-Z0-9]+$/},i=n.hasOwnProperty(e)?e:"default";return Promise.resolve(n[i].test(r))},before:function(t,e){var r=t.value;void 0===e&&(e=!1);var n=Date.parse(e||new Date),i=Date.parse(r);return Promise.resolve(!isNaN(i)&&ie&&ie&&i.length()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},endsWith:function(t){for(var e=arguments,r=t.value,n=[],i=arguments.length-1;i-- >0;)n[i]=e[i+1];return Promise.resolve("string"==typeof r&&n.length?void 0!==n.find((function(t){return r.endsWith(t)})):"string"==typeof r&&0===n.length)},in:function(t){for(var e=arguments,r=t.value,n=[],i=arguments.length-1;i-- >0;)n[i]=e[i+1];return Promise.resolve(void 0!==n.find((function(t){return"object"==typeof t?y(t,r):t===r})))},matches:function(t){for(var e=arguments,r=t.value,n=[],i=arguments.length-1;i-- >0;)n[i]=e[i+1];return Promise.resolve(!!n.find((function(t){return"string"==typeof t&&"/"===t.substr(0,1)&&"/"===t.substr(-1)&&(t=new RegExp(t.substr(1,t.length-2))),t instanceof RegExp?t.test(r):t===r})))},mime:function(t){for(var e=arguments,r=t.value,n=[],i=arguments.length-1;i-- >0;)n[i]=e[i+1];return Promise.resolve(function(){if(r instanceof m)for(var t=r.getFiles(),e=0;e=e):!isNaN(n)&&"length"!==r||"value"===r?(n=isNaN(n)?n:Number(n))>=e:("string"==typeof n||"length"===r)&&(n=isNaN(n)?n:n.toString()).length>=e)},max:function(t,e,r){var n=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(n)?(e=isNaN(e)?e:Number(e),n.length<=e):!isNaN(n)&&"length"!==r||"value"===r?(n=isNaN(n)?n:Number(n))<=e:("string"==typeof n||"length"===r)&&(n=isNaN(n)?n:n.toString()).length<=e)},not:function(t){for(var e=arguments,r=t.value,n=[],i=arguments.length-1;i-- >0;)n[i]=e[i+1];return Promise.resolve(void 0===n.find((function(t){return"object"==typeof t?y(t,r):t===r})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var r=t.value;return void 0===e&&(e=!0),Promise.resolve(!(e&&!["no","false"].includes(e))||(Array.isArray(r)?!!r.length:r instanceof m?r.getFiles().length>0:"string"==typeof r?!!r:"object"!=typeof r||!!r&&!!Object.keys(r).length))},startsWith:function(t){for(var e=arguments,r=t.value,n=[],i=arguments.length-1;i-- >0;)n[i]=e[i+1];return Promise.resolve("string"==typeof r&&n.length?void 0!==n.find((function(t){return r.startsWith(t)})):"string"==typeof r&&0===n.length)},url:function(t){var r=t.value;return Promise.resolve(e(r))},bail:function(){return Promise.resolve(!0)},optional:function(t){var e=t.value;return Promise.resolve(!F(e))}},S="image/",O={csv:"text/csv",gif:S+"gif",jpg:S+"jpeg",jpeg:S+"jpeg",png:S+"png",pdf:"application/pdf",svg:S+"svg+xml"},C=["outer","wrapper","label","element","input","help","errors","error","decorator","rangeValue","uploadArea","uploadAreaMask","files","file","fileName","fileRemove","fileProgress","fileUploadError","fileImagePreview","fileProgressInner","grouping","groupRepeatable","groupRepeatableRemove","groupAddMore"],V={hasErrors:function(t){return t.hasErrors},hasValue:function(t){return t.hasValue},isValid:function(t){return t.isValid}},j=(w=[""].concat(Object.keys(V).map((function(t){return b(t)}))),C.reduce((function(t,e){return t.concat(w.reduce((function(t,r){return t.push(""+e+r+"Class"),t}),[]))}),[]));function D(t,e,r){switch(typeof e){case"string":return e;case"function":return e(r,x(t));case"object":if(Array.isArray(e))return x(t).concat(e);default:return t}}function $(t){return C.reduce((function(e,r){var n;return Object.assign(e,((n={})[r]=function(t,e){var r=t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()})),n="formulate"+("file"===r.substr(0,4)?"":"-input")+(["decorator","range-value"].includes(r)?"-element":"")+("outer"!==r?"-"+r:"");return"input"===r?[]:[n].concat(function(t,e,r){var n=[];switch(e){case"label":n.push(t+"--"+r.labelPosition);break;case"element":var i="group"===r.classification?"group":r.type;n.push(t+"--"+i),"group"===i&&n.push("formulate-input-group");break;case"help":n.push(t+"--"+r.helpPosition)}return n}(n,t,e))}(r,t),n))}),{})}function B(t,e,r,n){return new Promise((function(r,i){var o=(n.fauxUploaderDuration||2e3)*(.5+Math.random()),s=performance.now(),a=function(){return setTimeout((function(){var n=performance.now()-s,i=Math.min(100,Math.round(n/o*100));if(e(i),i>=100)return r({url:"http://via.placeholder.com/350x150.png",name:t.name});a()}),20)};a()}))}function I(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}var R={inheritAttrs:!1,functional:!0,render:function(t,e){for(var r=e.props,n=e.data,i=e.parent,o=e.children,s=i,a=(r.name,r.forceWrap),u=r.context,l=I(r,["name","forceWrap","context"]);s&&"FormulateInput"!==s.$options.name;)s=s.$parent;if(!s)return null;if(s.$scopedSlots&&s.$scopedSlots[r.name])return s.$scopedSlots[r.name](Object.assign({},u,l));if(Array.isArray(o)&&(o.length>1||a&&o.length>0)){var c=n.attrs,h=(c.name,c.context,I(c,["name","context"]));return t("div",Object.assign({},n,{attrs:h}),o)}return Array.isArray(o)&&1===o.length?o[0]:null}};var M={functional:!0,render:function(t,e){return function t(e,r){return Array.isArray(r)?r.map((function(r){var n=function(t,e){if(t&&"object"==typeof t&&!Array.isArray(t)){var r=t.children;void 0===r&&(r=null);var n=t.component;void 0===n&&(n="FormulateInput");var i=t.depth;void 0===i&&(i=1);var o=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(t,["children","component","depth"]),s="FormulateInput"===n?o.type||"text":"",a=o.name||s||"el",u=o.id||a+"-"+i+"-"+e,l=Array.isArray(r)?r.map((function(t){return Object.assign(t,{depth:i+1})})):r;return Object.assign({key:u,depth:i,attrs:o,component:n},l?{children:l}:{})}return null}(r);return e(n.component,{attrs:n.attrs},n.children?t(e,n.children):null)})):r}(t,e.props.schema)}};function N(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}var T=function(t){this.registry=new Map,this.ctx=t};function L(t){return new T(t).dataProps()}function U(){return{hasInitialValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue||this.values&&"object"==typeof this.values||this.isGrouping&&"object"==typeof this.context.model[this.index]},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},initialValues:function(){return E(this.$options.propsData,"formulateValue")&&"object"==typeof this.formulateValue?Object.assign({},this.formulateValue):E(this.$options.propsData,"values")&&"object"==typeof this.values?Object.assign({},this.values):this.isGrouping&&"object"==typeof this.context.model[this.index]?this.context.model[this.index]:{}}}}function H(t){void 0===t&&(t=[]);var e={applyInitialValues:function(){this.hasInitialValue&&(this.proxy=this.initialValues)},setFieldValue:function(t,e){var r;if(void 0===e){var n=this.proxy,i=(n[t],N(n,[String(t)]));this.proxy=i}else Object.assign(this.proxy,((r={})[t]=e,r));this.$emit("input",Object.assign({},this.proxy))},valueDeps:function(t){var e=this;return Object.keys(this.proxy).reduce((function(r,n){return Object.defineProperty(r,n,{enumerable:!0,get:function(){var r=e.registry.get(n);return e.deps.set(t,e.deps.get(t)||new Set),r&&(e.deps.set(r,e.deps.get(r)||new Set),e.deps.get(r).add(t.name)),e.deps.get(t).add(n),e.proxy[n]}})}),Object.create(null))},validateDeps:function(t){var e=this;this.deps.has(t)&&this.deps.get(t).forEach((function(t){return e.registry.has(t)&&e.registry.get(t).performValidation()}))},hasValidationErrors:function(){return Promise.all(this.registry.reduce((function(t,e,r){return t.push(e.performValidation()&&e.getValidationErrors()),t}),[])).then((function(t){return t.some((function(t){return t.hasErrors}))}))},showErrors:function(){this.childrenShouldShowErrors=!0,this.registry.map((function(t){t.formShouldShowErrors=!0}))},hideErrors:function(){this.childrenShouldShowErrors=!1,this.registry.map((function(t){t.formShouldShowErrors=!1,t.behavioralErrorVisibility=!1}))},setValues:function(t){var e=this;Array.from(new Set(Object.keys(t).concat(Object.keys(this.proxy)))).forEach((function(r){y(t[r],e.proxy[r])||(e.setFieldValue(r,t[r]),e.registry.has(r)&&!y(t[r],e.registry.get(r).proxy)&&(e.registry.get(r).context.model=t[r]))}))}};return Object.keys(e).reduce((function(r,n){var i;return t.includes(n)?r:Object.assign({},r,((i={})[n]=e[n],i))}),{})}function G(t,e){void 0===e&&(e=[]);var r={formulateSetter:t.setFieldValue,formulateRegister:t.register,formulateDeregister:t.deregister,getFormValues:t.valueDeps,validateDependents:t.validateDeps};return Object.keys(r).filter((function(t){return!e.includes(t)})).reduce((function(t,e){var n;return Object.assign(t,((n={})[e]=r[e],n))}),{})}T.prototype.add=function(t,e){return this.registry.set(t,e),this},T.prototype.remove=function(t){this.ctx.deps.delete(this.registry.get(t)),this.ctx.deps.forEach((function(e){return e.delete(t)})),this.registry.delete(t);var e=this.ctx.proxy,r=(e[t],N(e,[String(t)]));return this.ctx.proxy=r,this},T.prototype.has=function(t){return this.registry.has(t)},T.prototype.get=function(t){return this.registry.get(t)},T.prototype.map=function(t){var e={};return this.registry.forEach((function(r,n){var i;return Object.assign(e,((i={})[n]=t(r,n),i))})),e},T.prototype.keys=function(){return Array.from(this.registry.keys())},T.prototype.register=function(t,e){if(this.registry.has(t))return!1;this.registry.set(t,e);var r=E(e.$options.propsData,"formulateValue"),n=E(e.$options.propsData,"value");r||!this.ctx.hasInitialValue||F(this.ctx.initialValues[t])?!r&&!n||y(e.proxy,this.ctx.initialValues[t])||this.ctx.setFieldValue(t,e.proxy):e.context.model=this.ctx.initialValues[t],this.childrenShouldShowErrors&&(e.formShouldShowErrors=!0)},T.prototype.reduce=function(t,e){return this.registry.forEach((function(r,n){e=t(e,r,n)})),e},T.prototype.dataProps=function(){var t=this;return{proxy:{},registry:this,register:this.register.bind(this),deregister:function(e){return t.remove(e)},childrenShouldShowErrors:!1,deps:new Map}};var q=function(t){this.form=t};function W(t,e,r,n,i,o,s,a,u,l){"boolean"!=typeof s&&(u=a,a=s,s=!1);var c,h="function"==typeof r?r.options:r;if(t&&t.render&&(h.render=t.render,h.staticRenderFns=t.staticRenderFns,h._compiled=!0,i&&(h.functional=!0)),n&&(h._scopeId=n),o?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,u(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},h._ssrRegister=c):e&&(c=s?function(t){e.call(this,l(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),c)if(h.functional){var d=h.render;h.render=function(t,e){return c.call(e),d(t,e)}}else{var p=h.beforeCreate;h.beforeCreate=p?[].concat(p,c):[c]}return r}q.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},q.prototype.values=function(){var t=this;return new Promise((function(e,r){var n=[],i=function t(e){if("object"!=typeof e)return e;var r=Array.isArray(e)?[]:{};for(var n in e)e[n]instanceof m||k(e[n])?r[n]=e[n]:r[n]=t(e[n]);return r}(t.form.proxy),o=function(e){"object"==typeof t.form.proxy[e]&&t.form.proxy[e]instanceof m&&n.push(t.form.proxy[e].upload().then((function(t){var r;return Object.assign(i,((r={})[e]=t,r))})))};for(var s in i)o(s);Promise.all(n).then((function(){return e(i)})).catch((function(t){return r(t)}))}))};var z={provide:function(){return Object.assign({},G(this),{observeErrors:this.addErrorObserver,removeErrorObserver:this.removeErrorObserver,formulateFieldValidation:this.formulateFieldValidation})},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}},values:{type:[Object,Boolean],default:!1},errors:{type:[Object,Boolean],default:!1},formErrors:{type:Array,default:function(){return[]}},schema:{type:[Array,Boolean],default:!1}},data:function(){return Object.assign({},L(this),{formShouldShowErrors:!1,errorObservers:[],namedErrors:[],namedFieldErrors:{}})},computed:Object.assign({},U(),{formContext:function(){return{errors:this.mergedFormErrors}},classes:function(){var t={"formulate-form":!0};return this.name&&(t["formulate-form--"+this.name]=!0),t},mergedFormErrors:function(){return this.formErrors.concat(this.namedErrors)},mergedFieldErrors:function(){var t={};if(this.errors)for(var e in this.errors)t[e]=x(this.errors[e]);for(var r in this.namedFieldErrors)t[r]=x(this.namedFieldErrors[r]);return t},hasFormErrorObservers:function(){return!!this.errorObservers.filter((function(t){return"form"===t.type})).length}}),watch:{formulateValue:{handler:function(t){this.isVmodeled&&t&&"object"==typeof t&&this.setValues(t)},deep:!0},mergedFormErrors:function(t){this.errorObservers.filter((function(t){return"form"===t.type})).forEach((function(e){return e.callback(t)}))},mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type})).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0}},created:function(){this.$formulate.register(this),this.applyInitialValues()},destroyed:function(){this.$formulate.deregister(this)},methods:Object.assign({},H(),{applyErrors:function(t){var e=t.formErrors,r=t.inputErrors;this.namedErrors=e,this.namedFieldErrors=r},addErrorObserver:function(t){this.errorObservers.find((function(e){return t.callback===e.callback}))||(this.errorObservers.push(t),"form"===t.type?t.callback(this.mergedFormErrors):E(this.mergedFieldErrors,t.field)&&t.callback(this.mergedFieldErrors[t.field]))},removeErrorObserver:function(t){this.errorObservers=this.errorObservers.filter((function(e){return e.callback!==t}))},registerErrorComponent:function(t){this.errorComponents.includes(t)||this.errorComponents.push(t)},formSubmitted:function(){var t=this;this.showErrors();var e=new q(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},formulateFieldValidation:function(t){this.$emit("validation",t)}})},Y=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.schema?r("FormulateSchema",{attrs:{schema:t.schema}}):t._e(),t._v(" "),t.hasFormErrorObservers?t._e():r("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default")],2)};Y._withStripped=!0;var Z=W({render:Y,staticRenderFns:[]},void 0,z,void 0,!1,void 0,!1,void 0,void 0,void 0),K={context:function(){return tt.call(this,Object.assign({},{addLabel:this.logicalAddLabel,attributes:this.elementAttributes,blurHandler:Q.bind(this),classification:this.classification,component:this.component,disableErrors:this.disableErrors,errors:this.explicitErrors,formShouldShowErrors:this.formShouldShowErrors,getValidationErrors:this.getValidationErrors.bind(this),hasGivenName:this.hasGivenName,hasValue:this.hasValue,hasLabel:this.label&&"button"!==this.classification,hasValidationErrors:this.hasValidationErrors.bind(this),help:this.help,helpPosition:this.logicalHelpPosition,id:this.id||this.defaultId,isValid:this.isValid,imageBehavior:this.imageBehavior,label:this.label,labelPosition:this.logicalLabelPosition,limit:this.limit===1/0?this.limit:parseInt(this.limit,10),name:this.nameOrFallback,minimum:parseInt(this.minimum,10),performValidation:this.performValidation.bind(this),pseudoProps:this.pseudoProps,preventWindowDrops:this.preventWindowDrops,repeatable:this.repeatable,rootEmit:this.$emit.bind(this),setErrors:this.setErrors.bind(this),showValidationErrors:this.showValidationErrors,slotComponents:this.slotComponents,slotProps:this.slotProps,type:this.type,uploadBehavior:this.uploadBehavior,uploadUrl:this.mergedUploadUrl,uploader:this.uploader||this.$formulate.getUploader(),validationErrors:this.validationErrors,value:this.value,visibleValidationErrors:this.visibleValidationErrors,isSubField:this.isSubField,classes:this.classes},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification){var t=this.id||this.elementAttributes.id.replace(/[^0-9]/g,"");return this.type+"_"+t}return!1!==this.name&&("button"!==this.classification||!0!==this.name)&&this.name},hasGivenName:function(){return"boolean"!=typeof this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:X.call(this,this.options),optionGroups:!!this.optionGroups&&v(this.optionGroups,(function(e,r){return X.call(t,r)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:X.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.filteredAttributes);return this.id?t.id=this.id:t.id=this.defaultId,this.hasGivenName&&(t.name=this.name),this.help&&(t["aria-describedby"]=t.id+"-help"),!this.classes.input||Array.isArray(this.classes.input)&&!this.classes.input.length||(t.class=this.classes.input),t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},logicalHelpPosition:function(){if(this.helpPosition)return this.helpPosition;switch(this.classification){case"group":return"before";default:return"after"}},mergedUploadUrl:function(){return this.uploadUrl||this.$formulate.getUploadUrl()},hasValue:function(){var t=this,e=this.proxy;return"box"===this.classification&&this.isGrouped?Array.isArray(e)?e.some((function(e){return e===t.value})):this.value===e:!F(e)},visibleValidationErrors:function(){return this.showValidationErrors&&this.validationErrors.length?this.validationErrors:[]},slotComponents:function(){var t=this.$formulate.slotComponent.bind(this.$formulate);return{label:t(this.type,"label"),help:t(this.type,"help"),errors:t(this.type,"errors"),repeatable:t(this.type,"repeatable"),addMore:t(this.type,"addMore"),remove:t(this.type,"remove")}},logicalAddLabel:function(){return"boolean"==typeof this.addLabel?"+ "+(this.label||this.name||"Add"):this.addLabel},classes:function(){return this.$formulate.classes(Object.assign({},this.$props,this.pseudoProps,{classification:this.classification,hasErrors:this.hasVisibleErrors,hasValue:this.hasValue,helpPosition:this.logicalHelpPosition,isValid:this.isValid,labelPosition:this.logicalLabelPosition,type:this.type,value:this.proxy}))},showValidationErrors:function(){return!(!this.showErrors&&!this.formShouldShowErrors)||(!("file"!==this.classification||"live"!==this.uploadBehavior||!et.call(this))||this.behavioralErrorVisibility)},slotProps:function(){var t=this.$formulate.slotProps.bind(this.$formulate);return{label:t(this.type,"label",this.typeProps),help:t(this.type,"help",this.typeProps),errors:t(this.type,"errors",this.typeProps),repeatable:t(this.type,"repeatable",this.typeProps),addMore:t(this.type,"addMore",this.typeProps),remove:t(this.type,"remove",this.typeProps)}},pseudoProps:function(){return J(this.localAttributes,j)},isValid:function(){return!this.hasErrors},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedValidationName:function(){return this.validationName?this.validationName:"string"==typeof this.name?this.name:this.label?this.label:this.type},explicitErrors:function(){return x(this.errors).concat(this.localErrors).concat(x(this.error))},allErrors:function(){return this.explicitErrors.concat(x(this.validationErrors))},hasVisibleErrors:function(){return Array.isArray(this.validationErrors)&&this.validationErrors.length&&this.showValidationErrors||!!this.explicitErrors.length},hasErrors:function(){return!!this.allErrors.length},filteredAttributes:function(){var t=this,e=Object.keys(this.pseudoProps).concat(Object.keys(this.typeProps));return Object.keys(this.localAttributes).reduce((function(r,n){return e.includes(g(n))||(r[n]=t.localAttributes[n]),r}),{})},typeProps:function(){return J(this.localAttributes,this.$formulate.typeProps(this.type))},listeners:function(){var t=this.$listeners;return t.input,function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(t,["input"])}};function J(t,e){return Object.keys(t).reduce((function(r,n){var i=g(n);return e.includes(i)&&(r[i]=t[n]),r}),{})}function X(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var e=[];for(var r in t)e.push({value:r,label:t[r],id:this.elementAttributes.id+"_"+r});return e}return t}function Q(){"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function tt(t){return Object.defineProperty(t,"model",{get:et.bind(this),set:rt.bind(this)})}function et(){var t=this.isVmodeled?"formulateValue":"proxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]||0===this[t]?this[t]:""}function rt(t){var e=!1;y(t,this.proxy)||(this.proxy=t,e=!0),this.context.name&&"function"==typeof this.formulateSetter&&this.formulateSetter(this.context.name,t),e&&this.$emit("input",t)}var nt={name:"FormulateInput",inheritAttrs:!1,provide:function(){return{formulateRegisterRule:this.registerRule,formulateRemoveRule:this.removeRule}},inject:{formulateSetter:{default:void 0},formulateFieldValidation:{default:function(){return function(){return{}}}},formulateRegister:{default:void 0},formulateDeregister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}},validateDependents:{default:function(){return function(){}}},observeErrors:{default:void 0},removeErrorObserver:{default:void 0},isSubField:{default:function(){return function(){return!1}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},limit:{type:[String,Number],default:1/0,validator:function(t){return 1/0}},minimum:{type:[String,Number],default:0,validator:function(t){return parseInt(t,10)==t}},help:{type:[String,Boolean],default:!1},helpPosition:{type:[String,Boolean],default:!1},isGrouped:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},repeatable:{type:Boolean,default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live","submit"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}},checked:{type:[String,Boolean],default:!1},disableErrors:{type:Boolean,default:!1},addLabel:{type:[Boolean,String],default:!1}},data:function(){return{defaultId:this.$formulate.nextId(this),localAttributes:{},localErrors:[],proxy:this.getInitialValue(),behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve(),ruleRegistry:[],messageRegistry:{}}},computed:Object.assign({},K,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)},parsedValidationRules:function(){var t=this,e={};return Object.keys(this.validationRules).forEach((function(r){e[g(r)]=t.validationRules[r]})),e},messages:function(){var t=this,e={};return Object.keys(this.validationMessages).forEach((function(r){e[g(r)]=t.validationMessages[r]})),Object.keys(this.messageRegistry).forEach((function(r){e[g(r)]=t.messageRegistry[r]})),e}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},proxy:function(t,e){this.performValidation(),this.isVmodeled||y(t,e)||(this.context.model=t),this.validateDependents(this)},formulateValue:function(t,e){this.isVmodeled&&!y(t,e)&&(this.context.model=t)},showValidationErrors:{handler:function(t){this.$emit("error-visibility",t)},immediate:!0}},created:function(){this.applyInitialValue(),this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.applyDefaultValue(),this.disableErrors||"function"!=typeof this.observeErrors||this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),this.updateLocalAttributes(this.$attrs),this.performValidation()},beforeDestroy:function(){this.disableErrors||"function"!=typeof this.removeErrorObserver||this.removeErrorObserver(this.setErrors),"function"==typeof this.formulateDeregister&&this.formulateDeregister(this.nameOrFallback)},methods:{getInitialValue:function(){var t=this.$formulate.classify(this.type);return"box"===(t="box"===t&&this.options?"group":t)&&this.checked?this.value||!0:E(this.$options.propsData,"value")&&"box"!==t?this.value:E(this.$options.propsData,"formulateValue")?this.formulateValue:""},applyInitialValue:function(){!y(this.context.model,this.proxy)&&E(this.$options.propsData,"options")&&"box"===this.classification&&(this.context.model=this.proxy)},applyDefaultValue:function(){"select"===this.type&&!this.context.placeholder&&F(this.proxy)&&!this.isVmodeled&&!1===this.value&&this.context.options.length&&(this.context.model=this.context.options[0].value)},updateLocalAttributes:function(t){y(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=function t(e,r){return"string"==typeof e?t(e.split("|"),r):Array.isArray(e)?e.map((function(t){return function(t,e){if("function"==typeof t)return[t,[]];if(Array.isArray(t)&&t.length){var r=_((t=t.map((function(t){return t}))).shift()),n=r[0],i=r[1];if("string"==typeof n&&e.hasOwnProperty(n))return[e[n],t,n,i];if("function"==typeof n)return[n,t,n,i]}if("string"==typeof t&&t){var o=t.split(":"),s=_(o.shift()),a=s[0],u=s[1];if(e.hasOwnProperty(a))return[e[a],o.length?o.join(":").split(","):[],a,u];throw new Error("Unknown validation rule "+t)}return!1}(t,r)})).filter((function(t){return!!t})):[]}(this.validation,this.$formulate.rules(this.parsedValidationRules));return e=this.ruleRegistry.length?this.ruleRegistry.concat(e):e,this.pendingValidation=this.runRules(e).then((function(e){return t.didValidate(e)})),this.pendingValidation},runRules:function(t){var e=this,r=function(t){var r=t[0],n=t[1],i=t[2],o=(t[3],r.apply(void 0,[{value:e.context.model,getFormValues:function(){for(var t,r=arguments,n=[],i=arguments.length;i--;)n[i]=r[i];return(t=e).getFormValues.apply(t,[e].concat(n))},name:e.context.name}].concat(n)));return(o=o instanceof Promise?o:Promise.resolve(o)).then((function(t){return!t&&e.getMessage(i,n)}))};return new Promise((function(e){var n=function(t,i){void 0===i&&(i=[]);var o=t.shift();Array.isArray(o)&&o.length?Promise.all(o.map(r)).then((function(t){return t.filter((function(t){return!!t}))})).then((function(r){return(r=Array.isArray(r)?r:[]).length&&o.bail||!t.length?e(i.concat(r).filter((function(t){return!F(t)}))):n(t,i.concat(r))})):e([])};n(function(t){var e=[],r=t.findIndex((function(t){return"bail"===t[2].toLowerCase()})),n=t.findIndex((function(t){return"optional"===t[2].toLowerCase()}));if(n>=0){var i=t.splice(n,1);e.push(Object.defineProperty(i,"bail",{value:!0}))}if(r>=0){var o=t.splice(0,r+1).slice(0,-1);o.length&&e.push(o),t.map((function(t){return e.push(Object.defineProperty([t],"bail",{value:!0}))}))}else e.push(t);return e.reduce((function(t,e){var r=function(t,e){if(void 0===e&&(e=!1),t.length<2)return Object.defineProperty([t],"bail",{value:e});var n=[],i=t.findIndex((function(t){return"^"===t[3]}));if(i>=0){var o=t.splice(0,i);o.length&&n.push.apply(n,r(o,e)),n.push(Object.defineProperty([t.shift()],"bail",{value:!0})),t.length&&n.push.apply(n,r(t,e))}else n.push(t);return n};return t.concat(r(e))}),[])}(t))}))},didValidate:function(t){var e=!y(t,this.validationErrors);if(this.validationErrors=t,e){var r=this.getErrorObject();this.$emit("validation",r),this.formulateFieldValidation&&"function"==typeof this.formulateFieldValidation&&this.formulateFieldValidation(r)}},getMessage:function(t,e){var r=this;return this.getMessageFunc(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues(this),getFormValues:function(){for(var t,e=arguments,n=[],i=arguments.length;i--;)n[i]=e[i];return(t=r).getFormValues.apply(t,[r].concat(n))}})},getMessageFunc:function(t){var e=this;if("optional"===(t=g(t)))return function(){return[]};if(this.messages&&void 0!==this.messages[t])switch(typeof this.messages[t]){case"function":return this.messages[t];case"string":case"boolean":return function(){return e.messages[t]}}return function(r){return e.$formulate.validationMessage(t,r,e)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))},getValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){return t.pendingValidation.then((function(){return e(t.getErrorObject())}))}))}))},getErrorObject:function(){return{name:this.context.nameOrFallback||this.context.name,errors:this.validationErrors.filter((function(t){return"string"==typeof t})),hasErrors:!!this.validationErrors.length}},setErrors:function(t){this.localErrors=x(t)},registerRule:function(t,e,r,n){void 0===n&&(n=null),this.ruleRegistry.some((function(t){return t[2]===r}))||(this.ruleRegistry.push([t,e,r]),null!==n&&(this.messageRegistry[r]=n))},removeRule:function(t){var e=this.ruleRegistry.findIndex((function(e){return e[2]===t}));e>=0&&(this.ruleRegistry.splice(e,1),delete this.messageRegistry[t])}}},it=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.outer,attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-has-value":t.hasValue,"data-type":t.type}},[r("div",{class:t.context.classes.wrapper},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,t._g(t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.component,!1),t.listeners),[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():r(t.context.slotComponents.errors,t._b({tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}},"component",t.context.slotProps.errors,!1))],null,t.context)],2)};it._withStripped=!0;var ot=W({render:it,staticRenderFns:[]},void 0,nt,void 0,!1,void 0,!1,void 0,void 0,void 0),st={inject:{observeErrors:{default:!1},removeErrorObserver:{default:!1}},props:{context:{type:Object,default:function(){return{}}},type:{type:String,default:"form"}},data:function(){return{boundSetErrors:this.setErrors.bind(this),localErrors:[]}},computed:{visibleValidationErrors:function(){return Array.isArray(this.context.visibleValidationErrors)?this.context.visibleValidationErrors:[]},errors:function(){return Array.isArray(this.context.errors)?this.context.errors:[]},mergedErrors:function(){return this.errors.concat(this.localErrors)},visibleErrors:function(){return Array.from(new Set(this.mergedErrors.concat(this.visibleValidationErrors))).filter((function(t){return"string"==typeof t}))},outerClass:function(){return"input"===this.type&&this.context.classes?this.context.classes.errors:"formulate-"+this.type+"-errors"},itemClass:function(){return"input"===this.type&&this.context.classes?this.context.classes.error:"formulate-"+this.type+"-error"}},created:function(){"form"!==this.type||"function"!=typeof this.observeErrors||Array.isArray(this.context.errors)||this.observeErrors({callback:this.boundSetErrors,type:this.type})},destroyed:function(){"form"!==this.type||"function"!=typeof this.removeErrorObserver||Array.isArray(this.context.errors)||this.removeErrorObserver(this.boundSetErrors)},methods:{setErrors:function(t){this.localErrors=x(t)}}},at=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.visibleErrors.length?r("ul",{class:t.outerClass},t._l(t.visibleErrors,(function(e){return r("li",{key:e,class:t.itemClass,domProps:{textContent:t._s(e)}})})),0):t._e()};at._withStripped=!0;var ut=W({render:at,staticRenderFns:[]},void 0,st,void 0,!1,void 0,!1,void 0,void 0,void 0),lt={props:{context:{type:Object,required:!0}}},ct=function(){var t=this.$createElement,e=this._self._c||t;return this.context.help?e("div",{class:this.context.classes.help,attrs:{id:this.context.id+"-help"},domProps:{textContent:this._s(this.context.help)}}):this._e()};ct._withStripped=!0;var ht=W({render:ct,staticRenderFns:[]},void 0,lt,void 0,!1,void 0,!1,void 0,void 0,void 0),dt={name:"FormulateGrouping",props:{context:{type:Object,required:!0}},provide:function(){return{isSubField:function(){return!0},registerProvider:this.registerProvider,deregisterProvider:this.deregisterProvider}},data:function(){return{providers:[]}},inject:["formulateRegisterRule","formulateRemoveRule"],computed:{items:function(){return Array.isArray(this.context.model)?this.context.repeatable||0!==this.context.model.length?this.context.model.map((function(t){return A(t,t.__id)})):[A({})]:new Array(this.context.minimum||1).fill("").map((function(){return A({})}))},formShouldShowErrors:function(){return this.context.formShouldShowErrors}},watch:{providers:function(){this.formShouldShowErrors&&this.showErrors()},formShouldShowErrors:function(t){t&&this.showErrors()}},created:function(){this.formulateRegisterRule(this.validateGroup.bind(this),[],"formulateGrouping",!0)},destroyed:function(){this.formulateRemoveRule("formulateGrouping")},methods:{getAtIndex:function(t){return void 0!==this.context.model[t]&&this.context.model[t].__id?this.context.model[t]:void 0!==this.context.model[t]?A(this.context.model[t]):void 0===this.context.model[t]&&void 0!==this.items[t]?A({},this.items[t].__id):A({})},setFieldValue:function(t,e,r){var n,i=Array.isArray(this.context.model)?this.context.model:[],o=this.getAtIndex(t),s=A(Object.assign({},o,((n={})[e]=r,n)),o.__id);i.splice(t,1,s),this.context.model=i},validateGroup:function(){return Promise.all(this.providers.reduce((function(t,e){return e&&"function"==typeof e.hasValidationErrors&&t.push(e.hasValidationErrors()),t}),[])).then((function(t){return!t.some((function(t){return!!t}))}))},showErrors:function(){this.providers.forEach((function(t){return t&&"function"==typeof t.showErrors&&t.showErrors()}))},removeItem:function(t){Array.isArray(this.context.model)&&this.context.model.length>this.context.minimum?this.context.model.splice(t,1):this.items.length>this.context.minimum&&(this.context.model=new Array(this.items.length-1).fill("").map((function(){return A({})})))},registerProvider:function(t){this.providers.some((function(e){return e===t}))||this.providers.push(t)},deregisterProvider:function(t){this.providers=this.providers.filter((function(e){return e!==t}))}}},pt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{class:t.context.classes.grouping,attrs:{name:"grouping",context:t.context,"force-wrap":t.context.repeatable}},t._l(t.items,(function(e,n){return r("FormulateRepeatableProvider",{key:e.__id,attrs:{index:n,"set-field-value":function(e,r){return t.setFieldValue(n,e,r)},context:t.context},on:{remove:t.removeItem}},[t._t("default")],2)})),1)};pt._withStripped=!0;var ft=W({render:pt,staticRenderFns:[]},void 0,dt,void 0,!1,void 0,!1,void 0,void 0,void 0),mt={props:{context:{type:Object,required:!0}}},vt=function(){var t=this.$createElement;return(this._self._c||t)("label",{class:this.context.classes.label,attrs:{for:this.context.id},domProps:{textContent:this._s(this.context.label)}})};vt._withStripped=!0;var yt=W({render:vt,staticRenderFns:[]},void 0,mt,void 0,!1,void 0,!1,void 0,void 0,void 0),gt={props:{context:{type:Object,required:!0},addMore:{type:Function,required:!0}}},bt=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{class:this.context.classes.groupAddMore},[e("FormulateInput",{attrs:{type:"button",label:this.context.addLabel,"data-minor":"","data-ghost":""},on:{click:this.addMore}})],1)};bt._withStripped=!0;var xt=W({render:bt,staticRenderFns:[]},void 0,gt,void 0,!1,void 0,!1,void 0,void 0,void 0),_t={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},attributes:function(){return this.context.attributes||{}},hasValue:function(){return this.context.hasValue}}},kt={name:"FormulateInputBox",mixins:[_t]},Et=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type}},["radio"===t.type?r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1),t.$listeners)):r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,i=!!n.checked;if(Array.isArray(r)){var o=t.context.value,s=t._i(r,o);n.checked?s<0&&t.$set(t.context,"model",r.concat([o])):s>-1&&t.$set(t.context,"model",r.slice(0,s).concat(r.slice(s+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1),t.$listeners)),t._v(" "),r("label",{tag:"component",class:t.context.classes.decorator,attrs:{for:t.attributes.id}})],1)};Et._withStripped=!0;var At=W({render:Et,staticRenderFns:[]},void 0,kt,void 0,!1,void 0,!1,void 0,void 0,void 0),Ft={name:"FormulateInputText",mixins:[_t]},wt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,i=!!n.checked;if(Array.isArray(r)){var o=t._i(r,null);n.checked?o<0&&t.$set(t.context,"model",r.concat([null])):o>-1&&t.$set(t.context,"model",r.slice(0,o).concat(r.slice(o+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1),t.$listeners)):"radio"===t.type?r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1),t.$listeners)):r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1),t.$listeners))])};wt._withStripped=!0;var Pt=W({render:wt,staticRenderFns:[]},void 0,Ft,void 0,!1,void 0,!1,void 0,void 0,void 0),St={name:"FormulateFiles",props:{files:{type:m,required:!0},imagePreview:{type:Boolean,default:!1},context:{type:Object,required:!0}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},Ot=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.fileUploads.length?r("ul",{class:t.context.classes.files},t._l(t.fileUploads,(function(e){return r("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":!(!t.imagePreview||!e.previewData)}},[r("div",{class:t.context.classes.file},[t.imagePreview&&e.previewData?r("div",{class:t.context.classes.fileImagePreview},[r("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),r("div",{class:t.context.classes.fileName,attrs:{title:e.name},domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?r("div",{class:t.context.classes.fileProgress,attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[r("div",{class:t.context.classes.fileProgressInner,style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?r("div",{class:t.context.classes.fileRemove,on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?r("div",{class:t.context.classes.fileUploadError,domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};Ot._withStripped=!0;var Ct={name:"FormulateInputFile",components:{FormulateFiles:W({render:Ot,staticRenderFns:[]},void 0,St,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[_t],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof m&&this.context.model.files.length)}},created:function(){Array.isArray(this.context.model)&&"string"==typeof this.context.model[0][this.$formulate.getFileUrlKey()]&&(this.context.model=this.$formulate.createUpload({files:this.context.model},this.context))},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){var t=this;this.isOver=!1;var e=this.$refs.file;e.files.length&&(this.context.model=this.$formulate.createUpload(e,this.context),this.$nextTick((function(){return t.attemptImmediateUpload()})))},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof m&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},Vt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[r("div",{class:t.context.classes.uploadArea,attrs:{"data-has-files":t.hasFiles}},[r("input",t._g(t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1),t.$listeners)),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],class:t.context.classes.uploadAreaMask}),t._v(" "),t.hasFiles?r("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior,context:t.context}}):t._e()],1)])};Vt._withStripped=!0;var jt=W({render:Vt,staticRenderFns:[]},void 0,Ct,void 0,!1,void 0,!1,void 0,void 0,void 0),Dt={props:{context:{type:Object,required:!0},removeItem:{type:Function,required:!0},index:{type:Number,required:!0}}},$t=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.groupRepeatable},[r("FormulateSlot",{attrs:{name:"remove",context:t.context,"remove-item":t.removeItem}},[r(t.context.slotComponents.remove,t._b({tag:"component",attrs:{context:t.context,"remove-item":t.removeItem}},"component",t.context.slotProps.remove,!1))],1),t._v(" "),t._t("default")],2)};$t._withStripped=!0;var Bt=W({render:$t,staticRenderFns:[]},void 0,Dt,void 0,!1,void 0,!1,void 0,void 0,void 0);function It(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}var Rt={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},subType:function(){return"group"===this.context.type?"grouping":"inputs"},optionsWithContext:function(){var t=this,e=this.context,r=e.attributes,n=(r.id,It(r,["id"])),i=(e.blurHandler,e.classification,e.component,e.getValidationErrors,e.hasLabel,e.hasValidationErrors,e.isSubField,e.isValid,e.labelPosition,e.options,e.performValidation,e.setErrors,e.slotComponents,e.slotProps,e.validationErrors,e.visibleValidationErrors,e.classes,e.showValidationErrors,e.rootEmit,e.help,e.pseudoProps,It(e,["attributes","blurHandler","classification","component","getValidationErrors","hasLabel","hasValidationErrors","isSubField","isValid","labelPosition","options","performValidation","setErrors","slotComponents","slotProps","validationErrors","visibleValidationErrors","classes","showValidationErrors","rootEmit","help","pseudoProps"]));return this.options.map((function(e){return t.groupItemContext(i,e,n)}))},totalItems:function(){return Array.isArray(this.context.model)?this.context.model.length:this.context.minimum||1},canAddMore:function(){return this.context.repeatable&&this.totalItems-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,i=!!n.checked;if(Array.isArray(r)){var o=t._i(r,null);n.checked?o<0&&t.$set(t.context,"model",r.concat([null])):o>-1&&t.$set(t.context,"model",r.slice(0,o).concat(r.slice(o+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1),t.$listeners)):"radio"===t.type?r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1),t.$listeners)):r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1),t.$listeners)),t._v(" "),t.context.showValue?r("div",{class:t.context.classes.rangeValue,domProps:{textContent:t._s(t.context.model)}}):t._e()])};zt._withStripped=!0;var Yt=W({render:zt,staticRenderFns:[]},void 0,Wt,void 0,!1,void 0,!1,void 0,void 0,void 0),Zt={name:"FormulateInputTextArea",mixins:[_t]},Kt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.element,attrs:{"data-type":"textarea"}},[r("textarea",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1),t.$listeners))])};Kt._withStripped=!0;var Jt=W({render:Kt,staticRenderFns:[]},void 0,Zt,void 0,!1,void 0,!1,void 0,void 0,void 0),Xt={provide:function(){var t=this;return Object.assign({},G(this,["getFormValues"]),{formulateSetter:function(e,r){return t.setFieldValue(e,r)}})},inject:{registerProvider:"registerProvider",deregisterProvider:"deregisterProvider"},props:{index:{type:Number,required:!0},context:{type:Object,required:!0},setFieldValue:{type:Function,required:!0}},data:function(){return Object.assign({},L(this),{isGrouping:!0})},computed:Object.assign({},U()),created:function(){this.registerProvider(this)},beforeDestroy:function(){this.deregisterProvider(this)},methods:Object.assign({},H(["setFieldValue"]),{removeItem:function(){this.$emit("remove",this.index)}})},Qt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{attrs:{name:"repeatable",context:t.context,index:t.index,"remove-item":t.removeItem}},[r(t.context.slotComponents.repeatable,t._b({tag:"component",attrs:{context:t.context,index:t.index,"remove-item":t.removeItem}},"component",t.context.slotProps.repeatable,!1),[r("FormulateSlot",{attrs:{context:t.context,index:t.index,name:"default"}})],1)],1)};Qt._withStripped=!0;var te=W({render:Qt,staticRenderFns:[]},void 0,Xt,void 0,!1,void 0,!1,void 0,void 0,void 0),ee={props:{context:{type:Object,required:!0},removeItem:{type:Function,required:!0}}},re=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.context.repeatable?r("a",{class:t.context.classes.groupRepeatableRemove,attrs:{role:"button"},domProps:{textContent:t._s("Remove")},on:{click:function(e){return e.preventDefault(),t.removeItem(e)},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.removeItem(e)}}}):t._e()};re._withStripped=!0;var ne=W({render:re,staticRenderFns:[]},void 0,ee,void 0,!1,void 0,!1,void 0,void 0,void 0),ie=function(){this.options={},this.defaults={components:{FormulateSlot:R,FormulateForm:Z,FormulateHelp:ht,FormulateLabel:yt,FormulateInput:ot,FormulateErrors:ut,FormulateSchema:M,FormulateAddMore:xt,FormulateGrouping:ft,FormulateInputBox:At,FormulateInputText:Pt,FormulateInputFile:jt,FormulateRepeatable:Bt,FormulateInputGroup:Nt,FormulateInputButton:Ut,FormulateInputSelect:qt,FormulateInputSlider:Yt,FormulateInputTextArea:Jt,FormulateRepeatableRemove:ne,FormulateRepeatableProvider:te},slotComponents:{label:"FormulateLabel",help:"FormulateHelp",errors:"FormulateErrors",repeatable:"FormulateRepeatable",addMore:"FormulateAddMore",remove:"FormulateRepeatableRemove"},slotProps:{},library:f,rules:P,mimes:O,locale:!1,uploader:B,uploadUrl:!1,fileUrlKey:"url",uploadJustCompleteDuration:1e3,errorHandler:function(t){return t},plugins:[d],locales:{},idPrefix:"formulate-",baseClasses:function(t){return t},coreClasses:$,classes:{}},this.registry=new Map,this.idRegistry={}};ie.prototype.install=function(t,e){var r=this;t.prototype.$formulate=this,this.options=this.defaults;var n=this.defaults.plugins;for(var i in e&&Array.isArray(e.plugins)&&e.plugins.length&&(n=n.concat(e.plugins)),n.forEach((function(t){return"function"==typeof t?t(r):null})),this.extend(e||{}),this.options.components)t.component(i,this.options.components[i])},ie.prototype.nextId=function(t){var e=t.$route&&t.$route.path&&t.$route.path?t.$route.path.replace(/[/\\.\s]/g,"-"):"global";return Object.prototype.hasOwnProperty.call(this.idRegistry,e)||(this.idRegistry[e]=0),""+this.options.idPrefix+e+"-"+ ++this.idRegistry[e]},ie.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge(this.options,t),this;throw new Error("Formulate.extend expects an object, was "+typeof t)},ie.prototype.merge=function(t,e,r){void 0===r&&(r=!0);var n={};for(var i in t)e.hasOwnProperty(i)?l(e[i])&&l(t[i])?n[i]=this.merge(t[i],e[i],r):r&&Array.isArray(t[i])&&Array.isArray(e[i])?n[i]=t[i].concat(e[i]):n[i]=e[i]:n[i]=t[i];for(var o in e)n.hasOwnProperty(o)||(n[o]=e[o]);return n},ie.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},ie.prototype.classes=function(t){var e=this,r=this.options.coreClasses(t),n=this.options.baseClasses(r,t);return Object.keys(n).reduce((function(r,i){var o,s=D(n[i],e.options.classes[i],t);return s=function(t,e,r,n){return Object.keys(V).reduce((function(e,i){if(V[i](n)){var o=""+t+b(i),s=o+"Class";r[o]&&(e=D(e,"string"==typeof r[o]?x(r[o]):r[o],n)),n[s]&&(e=D(e,"string"==typeof n[s]?x(n[s]):n[o+"Class"],n))}return e}),e)}(i,s=D(s,t[i+"Class"],t),e.options.classes,t),Object.assign(r,((o={})[i]=s,o))}),{})},ie.prototype.typeProps=function(t){var e=function(t){return Object.keys(t).reduce((function(e,r){return Array.isArray(t[r])?e.concat(t[r]):e}),[])},r=e(this.options.slotProps);return this.options.library[t]?r.concat(e(this.options.library[t].slotProps||{})):r},ie.prototype.slotProps=function(t,e,r){var n=Array.isArray(this.options.slotProps[e])?this.options.slotProps[e]:[],i=this.options.library[t];return i&&i.slotProps&&Array.isArray(i.slotProps[e])&&(n=n.concat(i.slotProps[e])),n.reduce((function(t,e){var n;return Object.assign(t,((n={})[e]=r[e],n))}),{})},ie.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},ie.prototype.slotComponent=function(t,e){var r=this.options.library[t];return r&&r.slotComponents&&r.slotComponents[e]?r.slotComponents[e]:this.options.slotComponents[e]},ie.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},ie.prototype.i18n=function(t){if(t.$i18n)switch(typeof t.$i18n.locale){case"string":return t.$i18n.locale;case"function":return t.$i18n.locale()}return!1},ie.prototype.getLocale=function(t){var e=this;return this.selectedLocale||(this.selectedLocale=[this.options.locale,this.i18n(t),"en"].reduce((function(t,r){if(t)return t;if(r){var n=function(t){return t.split("-").reduce((function(t,e){return t.length&&t.unshift(t[0]+"-"+e),t.length?t:[e]}),[])}(r).find((function(t){return E(e.options.locales,t)}));n&&(t=n)}return t}),!1)),this.selectedLocale},ie.prototype.validationMessage=function(t,e,r){var n=this.options.locales[this.getLocale(r)];return n.hasOwnProperty(t)?n[t](e):n.hasOwnProperty("default")?n.default(e):"Invalid field value"},ie.prototype.register=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.set(t.name,t)},ie.prototype.deregister=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.has(t.name)&&this.registry.delete(t.name)},ie.prototype.handle=function(t,e,r){void 0===r&&(r=!1);var n=r?t:this.options.errorHandler(t,e);return e&&this.registry.has(e)&&this.registry.get(e).applyErrors({formErrors:x(n.formErrors),inputErrors:n.inputErrors||{}}),n},ie.prototype.reset=function(t,e){void 0===e&&(e={}),this.resetValidation(t),this.setValues(t,e)},ie.prototype.submit=function(t){this.registry.get(t).formSubmitted()},ie.prototype.resetValidation=function(t){var e=this.registry.get(t);e.hideErrors(t),e.namedErrors=[],e.namedFieldErrors={}},ie.prototype.setValues=function(t,e){e&&!Array.isArray(e)&&"object"==typeof e&&this.registry.get(t).setValues(Object.assign({},e))},ie.prototype.getUploader=function(){return this.options.uploader||!1},ie.prototype.getUploadUrl=function(){return this.options.uploadUrl||!1},ie.prototype.getFileUrlKey=function(){return this.options.fileUrlKey||"url"},ie.prototype.createUpload=function(t,e){return new m(t,e,this.options)};var oe=new ie,se=function(t){return void 0===t&&(t=[]),this.defaultHook=function(t){return t},this.setHooks(t)};se.prototype.parse=function(t){void 0===t&&(t=[]);var e=Array.isArray(t)?t:[];for(var r of e)this.isProperHook(r)&&this.hooks.push(r);return this},se.prototype.addHook=function(t){return this.isProperHook(t)&&this.isNewHook(t)&&this.hooks.push(t),this},se.prototype.setHooks=function(t){return void 0===t&&(t=[]),this.hooks=t.filter(this.isProperHook),this},se.prototype.setDefault=function(t){return this.defaultHook=t,this},se.prototype.isProperHook=function(t){return t&&"object"==typeof t&&"function"==typeof t.handler},se.prototype.isNewHook=function(t){return this.hooks.findIndex((function(e){return e===t}))<0},se.prototype.getHooks=function(){return this.hooks},se.prototype.empty=function(){return 0===this.hooks.length},se.prototype.apply=function(t,e){return this.empty()?this.defaultHook(t,e):this.hooks.reduce((function(t,r){return r.handler(t,e)}),t)},se.prototype.asSingleHook=function(){var t=this;return{handler:function(e,r){return t.apply(e,r)}}};var ae={type:Object,default:function(){return{model:[],schema:[],schemaOptions:[],schemaNode:[],schemaComponent:[]}}};var ue=oe.defaults.components.FormulateInput,le=ue.props,ce=(ue.created,ue.watch),he=ue.computed,de=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(ue,["props","created","watch","computed"]);function pe(t,e,r,n,i,o,s,a,u,l){"boolean"!=typeof s&&(u=a,a=s,s=!1);var c,h="function"==typeof r?r.options:r;if(t&&t.render&&(h.render=t.render,h.staticRenderFns=t.staticRenderFns,h._compiled=!0,i&&(h.functional=!0)),n&&(h._scopeId=n),o?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,u(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},h._ssrRegister=c):e&&(c=s?function(t){e.call(this,l(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),c)if(h.functional){var d=h.render;h.render=function(t,e){return c.call(e),d(t,e)}}else{var p=h.beforeCreate;h.beforeCreate=p?[].concat(p,c):[c]}return r}var fe=Object.assign({},de,{props:Object.assign({},le,{modelHook:{type:[Function,Object,Array],default:null},standalone:{type:Boolean,default:function(){return!1}}}),created:function(){this.applyInitialValue(),!this.standalone&&this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.applyDefaultValue(),this.disableErrors||"function"!=typeof this.observeErrors||this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),this.updateLocalAttributes(this.$attrs),this.performValidation()},computed:Object.assign({},he,{slotProps:function(){var t=this.$formulate.slotProps.bind(this.$formulate);return{label:t(this.type,"label",this.typeProps),help:t(this.type,"help",this.typeProps),errors:t(this.type,"errors",this.typeProps),repeatable:t(this.type,"repeatable",this.typeProps),addMore:t(this.type,"addMore",this.typeProps),remove:t(this.type,"remove",this.typeProps),component:t(this.type,"component",this.typeProps)}}}),watch:Object.assign({},ce,{"context.model":{handler:function(t,e){var r=new se;Array.isArray(this.modelHook)?this.modelHook.map((function(t){return r.addHook(t)})):"function"==typeof this.modelHook?r.addHook({handler:this.modelHook}):r.addHook(this.modelHook),(this.$formulate.options.hooks&&this.$formulate.options.hooks.model?this.$formulate.options.hooks.model:[]).map((function(t){return r.addHook(t)}));var n=t;"box"===this.context.classification&&"string"==typeof t&&0===t.length&&(n=!1),t!==e&&r.hooks.length>0&&(this.context.model=r.apply(n,{oldModel:e,context:this.context}))}}})}),me=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.outer,attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-has-value":t.hasValue,"data-type":t.type},on:{click:function(e){return t.$emit("outer-click")}}},[r("div",{class:t.context.classes.wrapper,on:{click:function(e){return t.$emit("wrapper-click")}}},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,t._g(t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.component,!1),t.listeners),[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():r(t.context.slotComponents.errors,t._b({tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}},"component",t.context.slotProps.errors,!1))],null,t.context)],2)};me._withStripped=!0;var ve=pe({render:me,staticRenderFns:[]},void 0,fe,void 0,!1,void 0,!1,void 0,void 0,void 0);function ye(t,e,r){void 0===r&&(r={});var n=r.hooks,i=r.h,o=r.state;if(t&&"object"==typeof t&&!Array.isArray(t)){var s=t.children;void 0===s&&(s=null);var a=t.component;void 0===a&&(a=ve);var u=t.depth;void 0===u&&(u=1);var l=t.modelHook,c=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(t,["children","component","depth","modelHook"]),h=a===ve?c.type||"text":"",d=c.name||h||"el",p=c.id||d+"-"+u+"-"+e,f=Array.isArray(s)?s.map((function(t){return Object.assign(t,{depth:u+1})})):s,m=(new se).setHooks(n.model).addHook(l).asSingleHook(),v=Object.assign({name:d,type:h,key:p,depth:u,component:a,definition:{attrs:Object.assign({},c,{modelHook:m})},children:ge(f,{hooks:n,h:i,state:o})});return(new se).setHooks(n.schemaNode).setDefault((function(){return v})).apply(v,{state:o})}return null}function ge(t,e){void 0===e&&(e={});var r=e.hooks,n=e.h,i=e.state;return Array.isArray(t)?t.map((function(t,e){var o=ye(t,e,{hooks:r,h:n,state:i});return(new se).setHooks(r.schemaComponent).setDefault((function(){return n(o.component,o.definition,o.children)})).apply(o)})):t}var be={functional:!1,name:"FormulateSchema",props:{schema:oe.defaults.components.FormulateForm.props.schema,hooks:ae,formClass:{type:String,default:null}},data:function(){return{schemaHooks:null,schemaOptionsHooks:null}},methods:{emit:function(t,e){this.$emit(t,e)}},beforeMount:function(){this.schemaHooks=(new se).setHooks(this.hooks.schema),this.schemaOptionsHooks=(new se).setHooks(this.hooks.schemaOptions).setDefault((function(t){return t}))},render:function(t){return this.schemaHooks.apply(t("div",{class:this.$props.formClass},ge(this.schema,this.schemaOptionsHooks.apply({hooks:this.hooks,h:t,state:{}},{emit:this.emit,props:this.$props}))),{emit:this.emit,props:this.$props})}},xe=function(t,e,r){void 0===r&&(r={}),this.input=t,this.fileList=t.files,this.files=[],this.options=Object.assign({},{mimes:{}},r),this.results=!1,this.context=e,Array.isArray(this.fileList)?this.rehydrateFileList(this.fileList):this.addFileList(this.fileList)};function _e(t,e){var r={};for(var n in t)r[n]=e(n,t[n]);return r}function ke(t,e){if(t===e)return!0;if(!t||!e)return!1;var r=Object.keys(t),n=Object.keys(e),i=r.length;if(n.length!==i)return!1;for(var o=0;o=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0)}),(function(t){e.progress=0,e.error=t,e.complete=!0}),t.options)}))).then((function(r){t.results=r,e(r)})).catch((function(t){throw new Error(t)}))}))},xe.prototype.removeFile=function(t){if(this.files=this.files.filter((function(e){return e.uuid!==t})),this.context.performValidation(),window&&this.fileList instanceof FileList){var e=new DataTransfer;this.files.map((function(t){return e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList}},xe.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},xe.prototype.getFileList=function(){return this.fileList},xe.prototype.getFiles=function(){return this.files},xe.prototype.toString=function(){var t=this.files.length?this.files.length+" files":"empty";return this.results?JSON.stringify(this.results,null," "):"FileUpload("+t+")"};var je={extends:oe.defaults.components.FormulateForm,components:{FormulateSchema:be},props:{hooks:ae,formClass:{type:String,default:null}},computed:{cleanedHooks:function(){var t=this,e=ae.default();return Object.keys(e).forEach((function(r){e[r]=(new se).parse(t.hooks[r]).getHooks()})),oe.merge(this.$formulate.options.hooks||{},e)}},watch:{formulateValue:{handler:function(t){var e=this;this.isVmodeled&&t&&"object"==typeof t&&Array.from(new Set(Object.keys(t).concat(Object.keys(this.proxy)))).forEach((function(r){ke(t[r],e.proxy[r])||(e.setFieldValue(r,t[r]),e.registry.has(r)&&!ke(t[r],e.registry.get(r).proxy)&&(e.registry.get(r).context.model=t[r]))}))},deep:!0}}},De=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.schema?r("FormulateSchema",{attrs:{schema:t.schema,hooks:t.cleanedHooks,formClass:t.formClass},on:{events:function(e){return t.$emit("events",e)}}}):t._e(),t._v(" "),t.hasFormErrorObservers?t._e():r("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default")],2)};De._withStripped=!0;var $e=pe({render:De,staticRenderFns:[]},void 0,je,void 0,!1,void 0,!1,void 0,void 0,void 0),Be=function(){this.store=new Map};Be.prototype.on=function(t,e){var r=this.store.get(t);r&&r.push(e)||this.store.set(t,[e])},Be.prototype.off=function(t,e){var r=this.store.get(t),n=r.indexOf(e);r&&n>-1&&r.splice(n,1)},Be.prototype.emit=function(t,e){this.store.get(t).slice().map((function(t){return t(e)}))};var Ie={hooks:{schemaOptions:[{handler:function(t,e){void 0===e&&(e={});var r=e.emit;return t.state=t.state||{},t.state.eventBus=new Be,t.state.eventBus.on("events",(function(t){return r("events",t)})),t}}],schemaNode:[{handler:function(t,e){void 0===e&&(e={});var r=e.state,n=t.definition.attrs,i=n.events;void 0===i&&(i=[]);var o=n.on;void 0===o&&(o={});var s=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(n,["events","on"]);return t.definition.attrs=s,t.definition.on=Object.assign({},o,i.reduce((function(e,n){return e[n]=function(e){o[n]&&o[n](e),r.eventBus.emit("events",{eventName:n,name:t.name,type:t.type,key:t.key,payload:e})},e}),{})),t}}]}};function Re(t){return(Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Me(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ne(t,e){for(var r=0;r=0||(i[r]=t[r]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function qe(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function We(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ue(t)););return t}function ze(t,e,r){return(ze="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=We(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(r):i.value}})(t,e,r||t)}function Ye(t,e,r,n){return(Ye="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,r,n){var i,o=We(t,e);if(o){if((i=Object.getOwnPropertyDescriptor(o,e)).set)return i.set.call(n,r),!0;if(!i.writable)return!1}if(i=Object.getOwnPropertyDescriptor(n,e)){if(!i.writable)return!1;i.value=r,Object.defineProperty(n,e,i)}else!function(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(n,e,r);return!0})(t,e,r,n)}function Ze(t,e,r,n,i){if(!Ye(t,e,r,n||t)&&i)throw new Error("failed to set property");return r}function Ke(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t))&&"[object Arguments]"!==Object.prototype.toString.call(t))return;var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Je(t){return"string"==typeof t||t instanceof String}var Xe="NONE",Qe="LEFT",tr="FORCE_LEFT",er="RIGHT",rr="FORCE_RIGHT";function nr(t){switch(t){case Qe:return tr;case er:return rr;default:return t}}function ir(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}var or=function(){function t(e,r,n,i){for(Me(this,t),this.value=e,this.cursorPos=r,this.oldValue=n,this.oldSelection=i;this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start}return Te(t,[{key:"startChangePos",get:function(){return Math.min(this.cursorPos,this.oldSelection.start)}},{key:"insertedCount",get:function(){return this.cursorPos-this.startChangePos}},{key:"inserted",get:function(){return this.value.substr(this.startChangePos,this.insertedCount)}},{key:"removedCount",get:function(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}},{key:"removed",get:function(){return this.oldValue.substr(this.startChangePos,this.removedCount)}},{key:"head",get:function(){return this.value.substring(0,this.startChangePos)}},{key:"tail",get:function(){return this.value.substring(this.startChangePos+this.insertedCount)}},{key:"removeDirection",get:function(){return!this.removedCount||this.insertedCount?Xe:this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos?er:Qe}}]),t}(),sr=function(){function t(e){Me(this,t),Object.assign(this,{inserted:"",rawInserted:"",skip:!1,tailShift:0},e)}return Te(t,[{key:"aggregate",value:function(t){return this.rawInserted+=t.rawInserted,this.skip=this.skip||t.skip,this.inserted+=t.inserted,this.tailShift+=t.tailShift,this}},{key:"offset",get:function(){return this.tailShift+this.inserted.length}}]),t}(),ar=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;Me(this,t),this.value=e,this.from=r,this.stop=n}return Te(t,[{key:"toString",value:function(){return this.value}},{key:"extend",value:function(t){this.value+=String(t)}},{key:"appendTo",value:function(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}},{key:"shiftBefore",value:function(t){if(this.from>=t||!this.value.length)return"";var e=this.value[0];return this.value=this.value.slice(1),e}},{key:"state",get:function(){return{value:this.value,from:this.from,stop:this.stop}},set:function(t){Object.assign(this,t)}}]),t}();function ur(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new ur.InputMask(t,e)}var lr=function(){function t(e){Me(this,t),this._value="",this._update(Object.assign({},t.DEFAULTS,{},e)),this.isInitialized=!0}return Te(t,[{key:"updateOptions",value:function(t){Object.keys(t).length&&this.withValueRefresh(this._update.bind(this,t))}},{key:"_update",value:function(t){Object.assign(this,t)}},{key:"reset",value:function(){this._value=""}},{key:"resolve",value:function(t){return this.reset(),this.append(t,{input:!0},""),this.doCommit(),this.value}},{key:"nearestInputPos",value:function(t,e){return t}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.value.slice(t,e)}},{key:"extractTail",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return new ar(this.extractInput(t,e),t)}},{key:"appendTail",value:function(t){return Je(t)&&(t=new ar(String(t))),t.appendTo(this)}},{key:"_appendCharRaw",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(t=this.doPrepare(t,e))?(this._value+=t,new sr({inserted:t,rawInserted:t})):new sr}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=this.state,i=this._appendCharRaw(t,e);if(i.inserted){var o,s=!1!==this.doValidate(e);if(s&&null!=r){var a=this.state;this.overwrite&&(o=r.state,r.shiftBefore(this.value.length));var u=this.appendTail(r);(s=u.rawInserted===r.toString())&&u.inserted&&(this.state=a)}s||(i=new sr,this.state=n,r&&o&&(r.state=o))}return i}},{key:"_appendPlaceholder",value:function(){return new sr}},{key:"append",value:function(t,e,r){if(!Je(t))throw new Error("value should be string");var n=new sr,i=Je(r)?new ar(String(r)):r;e.tail&&(e._beforeTailState=this.state);for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this._value=this.value.slice(0,t)+this.value.slice(e),new sr}},{key:"withValueRefresh",value:function(t){if(this._refreshing||!this.isInitialized)return t();this._refreshing=!0;var e=this.rawInputValue,r=this.value,n=t();return this.rawInputValue=e,this.value!==r&&0===r.indexOf(this.value)&&this.append(r.slice(this.value.length),{},""),delete this._refreshing,n}},{key:"runIsolated",value:function(t){if(this._isolated||!this.isInitialized)return t(this);this._isolated=!0;var e=this.state,r=t(this);return this.state=e,delete this._isolated,r}},{key:"doPrepare",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.prepare?this.prepare(t,this,e):t}},{key:"doValidate",value:function(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}},{key:"doCommit",value:function(){this.commit&&this.commit(this.value,this)}},{key:"doFormat",value:function(t){return this.format?this.format(t,this):t}},{key:"doParse",value:function(t){return this.parse?this.parse(t,this):t}},{key:"splice",value:function(t,e,r,n){var i=t+e,o=this.extractTail(i),s=this.nearestInputPos(t,n);return new sr({tailShift:s-t}).aggregate(this.remove(s)).aggregate(this.append(r,{input:!0},o))}},{key:"state",get:function(){return{_value:this.value}},set:function(t){this._value=t._value}},{key:"value",get:function(){return this._value},set:function(t){this.resolve(t)}},{key:"unmaskedValue",get:function(){return this.value},set:function(t){this.reset(),this.append(t,{},""),this.doCommit()}},{key:"typedValue",get:function(){return this.doParse(this.value)},set:function(t){this.value=this.doFormat(t)}},{key:"rawInputValue",get:function(){return this.extractInput(0,this.value.length,{raw:!0})},set:function(t){this.reset(),this.append(t,{raw:!0},""),this.doCommit()}},{key:"isComplete",get:function(){return!0}}]),t}();function cr(t){if(null==t)throw new Error("mask property should be defined");return t instanceof RegExp?ur.MaskedRegExp:Je(t)?ur.MaskedPattern:t instanceof Date||t===Date?ur.MaskedDate:t instanceof Number||"number"==typeof t||t===Number?ur.MaskedNumber:Array.isArray(t)||t===Array?ur.MaskedDynamic:ur.Masked&&t.prototype instanceof ur.Masked?t:t instanceof Function?ur.MaskedFunction:t instanceof ur.Masked?t.constructor:(console.warn("Mask not found for mask",t),ur.Masked)}function hr(t){if(ur.Masked&&t instanceof ur.Masked)return t;var e=(t=Object.assign({},t)).mask;if(ur.Masked&&e instanceof ur.Masked)return e;var r=cr(e);if(!r)throw new Error("Masked class is not found for provided mask, appropriate module needs to be import manually before creating mask.");return new r(t)}lr.DEFAULTS={format:function(t){return t},parse:function(t){return t}},ur.Masked=lr,ur.createMask=hr;var dr={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./},pr=function(){function t(e){Me(this,t);var r=e.mask,n=Ge(e,["mask"]);this.masked=hr({mask:r}),Object.assign(this,n)}return Te(t,[{key:"reset",value:function(){this._isFilled=!1,this.masked.reset()}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return 0===t&&e>=1?(this._isFilled=!1,this.masked.remove(t,e)):new sr}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._isFilled)return new sr;var r=this.masked.state,n=this.masked._appendChar(t,e);return n.inserted&&!1===this.doValidate(e)&&(n.inserted=n.rawInserted="",this.masked.state=r),n.inserted||this.isOptional||this.lazy||e.input||(n.inserted=this.placeholderChar),n.skip=!n.inserted&&!this.isOptional,this._isFilled=Boolean(n.inserted),n}},{key:"append",value:function(){var t;return(t=this.masked).append.apply(t,arguments)}},{key:"_appendPlaceholder",value:function(){var t=new sr;return this._isFilled||this.isOptional||(this._isFilled=!0,t.inserted=this.placeholderChar),t}},{key:"extractTail",value:function(){var t;return(t=this.masked).extractTail.apply(t,arguments)}},{key:"appendTail",value:function(){var t;return(t=this.masked).appendTail.apply(t,arguments)}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,r=arguments.length>2?arguments[2]:void 0;return this.masked.extractInput(t,e,r)}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xe,r=0,n=this.value.length,i=Math.min(Math.max(t,r),n);switch(e){case Qe:case tr:return this.isComplete?i:r;case er:case rr:return this.isComplete?i:n;case Xe:default:return i}}},{key:"doValidate",value:function(){var t,e;return(t=this.masked).doValidate.apply(t,arguments)&&(!this.parent||(e=this.parent).doValidate.apply(e,arguments))}},{key:"doCommit",value:function(){this.masked.doCommit()}},{key:"value",get:function(){return this.masked.value||(this._isFilled&&!this.isOptional?this.placeholderChar:"")}},{key:"unmaskedValue",get:function(){return this.masked.unmaskedValue}},{key:"isComplete",get:function(){return Boolean(this.masked.value)||this.isOptional}},{key:"state",get:function(){return{masked:this.masked.state,_isFilled:this._isFilled}},set:function(t){this.masked.state=t.masked,this._isFilled=t._isFilled}}]),t}(),fr=function(){function t(e){Me(this,t),Object.assign(this,e),this._value=""}return Te(t,[{key:"reset",value:function(){this._isRawInput=!1,this._value=""}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._value.length;return this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new sr}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xe,r=0,n=this._value.length;switch(e){case Qe:case tr:return r;case Xe:case er:case rr:default:return n}}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._value.length,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.raw&&this._isRawInput&&this._value.slice(t,e)||""}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new sr;if(this._value)return r;var n=this.char===t[0],i=n&&(this.isUnmasking||e.input||e.raw)&&!e.tail;return i&&(r.rawInserted=this.char),this._value=r.inserted=this.char,this._isRawInput=i&&(e.raw||e.input),r}},{key:"_appendPlaceholder",value:function(){var t=new sr;return this._value||(this._value=t.inserted=this.char),t}},{key:"extractTail",value:function(){arguments.length>1&&void 0!==arguments[1]||this.value.length;return new ar("")}},{key:"appendTail",value:function(t){return Je(t)&&(t=new ar(String(t))),t.appendTo(this)}},{key:"append",value:function(t,e,r){var n=this._appendChar(t,e);return null!=r&&(n.tailShift+=this.appendTail(r).tailShift),n}},{key:"doCommit",value:function(){}},{key:"value",get:function(){return this._value}},{key:"unmaskedValue",get:function(){return this.isUnmasking?this.value:""}},{key:"isComplete",get:function(){return!0}},{key:"state",get:function(){return{_value:this._value,_isRawInput:this._isRawInput}},set:function(t){Object.assign(this,t)}}]),t}(),mr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Me(this,t),this.chunks=e,this.from=r}return Te(t,[{key:"toString",value:function(){return this.chunks.map(String).join("")}},{key:"extend",value:function(e){if(String(e)){Je(e)&&(e=new ar(String(e)));var r=this.chunks[this.chunks.length-1],n=r&&(r.stop===e.stop||null==e.stop)&&e.from===r.from+r.toString().length;if(e instanceof ar)n?r.extend(e.toString()):this.chunks.push(e);else if(e instanceof t){if(null==e.stop)for(var i;e.chunks.length&&null==e.chunks[0].stop;)(i=e.chunks.shift()).from+=e.from,this.extend(i);e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}}},{key:"appendTo",value:function(e){if(!(e instanceof ur.MaskedPattern))return new ar(this.toString()).appendTo(e);for(var r=new sr,n=0;n=0)&&r.aggregate(e._appendPlaceholder(s)),a=i instanceof t&&e._blocks[s]),a){var u=a.appendTail(i);u.skip=!1,r.aggregate(u),e._value+=u.inserted;var l=i.toString().slice(u.rawInserted.length);l&&r.aggregate(e.append(l,{tail:!0}))}else r.aggregate(e.append(i.toString(),{tail:!0}))}return r}},{key:"shiftBefore",value:function(t){if(this.from>=t||!this.chunks.length)return"";for(var e=t-this.from,r=0;r=0}),ze(Ue(e.prototype),"_update",this).call(this,t)}}]),e}(lr);ur.MaskedRegExp=vr;var yr=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Me(this,e),t.definitions=Object.assign({},dr,t.definitions),qe(this,Ue(e).call(this,Object.assign({},e.DEFAULTS,{},t)))}return Le(e,t),Te(e,[{key:"_update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.definitions=Object.assign({},this.definitions,t.definitions),ze(Ue(e.prototype),"_update",this).call(this,t),this._rebuildMask()}},{key:"_rebuildMask",value:function(){var t=this,r=this.definitions;this._blocks=[],this._stops=[],this._maskedBlocks={};var n=this.mask;if(n&&r)for(var i=!1,o=!1,s=0;s1&&void 0!==arguments[1]?arguments[1]:{};t=this.doPrepare(t,e);var r=this._mapPosToBlock(this.value.length),n=new sr;if(!r)return n;for(var i=r.index;;++i){var o=this._blocks[i];if(!o)break;var s=o._appendChar(t,e),a=s.skip;if(n.aggregate(s),a||s.rawInserted)break}return n}},{key:"extractTail",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=new mr;return e===r||this._forEachBlocksInRange(e,r,(function(e,r,i,o){var s=e.extractTail(i,o);s.stop=t._findStopBefore(r),s.from=t._blockStartPos(r),s instanceof mr&&(s.blockIndex=r),n.extend(s)})),n}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t===e)return"";var n="";return this._forEachBlocksInRange(t,e,(function(t,e,i,o){n+=t.extractInput(i,o,r)})),n}},{key:"_findStopBefore",value:function(t){for(var e,r=0;r1&&void 0!==arguments[1]?arguments[1]:this.value.length,r=arguments.length>2?arguments[2]:void 0,n=this._mapPosToBlock(t);if(n){var i=this._mapPosToBlock(e),o=i&&n.index===i.index,s=n.offset,a=i&&o?i.offset:this._blocks[n.index].value.length;if(r(this._blocks[n.index],n.index,s,a),i&&!o){for(var u=n.index+1;u0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=ze(Ue(e.prototype),"remove",this).call(this,t,r);return this._forEachBlocksInRange(t,r,(function(t,e,r,i){n.aggregate(t.remove(r,i))})),n}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xe,r=this._mapPosToBlock(t)||{index:0,offset:0},n=r.offset,i=r.index,o=this._blocks[i];if(!o)return t;var s=n;0!==s&&s0){var c=l-1,h=this._blocks[c],d=h.nearestInputPos(0,Xe);if(!h.value.length||d!==h.value.length)return this._blockStartPos(l)}for(var p=l,f=p;f=0;--y){var g=this._blocks[y],b=g.nearestInputPos(0,Xe);if(!g.value.length||b!==g.value.length)return this._blockStartPos(y)+g.value.length}return t}if(e===Qe||e===tr){for(var x,_=l;_=0;--w){var P=this._blocks[w],S=P.nearestInputPos(P.value.length,tr);if(P.value&&0===S||(A=w),0!==S){if(S!==P.value.length)return this._blockStartPos(w)+S;F=w;break}}if(e===Qe)for(var O=F+1;O<=Math.min(l,this._blocks.length-1);++O){var C=this._blocks[O],V=C.nearestInputPos(0,Xe),j=this._blockStartPos(O)+V;if(j>t)break;if(V!==C.value.length)return j}if(F>=0)return this._blockStartPos(F)+this._blocks[F].value.length;if(e===tr||this.lazy&&!this.extractInput()&&!gr(this._blocks[l]))return 0;if(null!=A)return this._blockStartPos(A);for(var D=l;D=0;--G){var q=this._blocks[G],W=q.nearestInputPos(q.value.length,Qe);if(0!==W){var z=this._blockStartPos(G)+W;if(z>=t)return z;break}}}return t}},{key:"maskedBlock",value:function(t){return this.maskedBlocks(t)[0]}},{key:"maskedBlocks",value:function(t){var e=this,r=this._maskedBlocks[t];return r?r.map((function(t){return e._blocks[t]})):[]}},{key:"state",get:function(){return Object.assign({},ze(Ue(e.prototype),"state",this),{_blocks:this._blocks.map((function(t){return t.state}))})},set:function(t){var r=t._blocks,n=Ge(t,["_blocks"]);this._blocks.forEach((function(t,e){return t.state=r[e]})),Ze(Ue(e.prototype),"state",n,this,!0)}},{key:"isComplete",get:function(){return this._blocks.every((function(t){return t.isComplete}))}},{key:"unmaskedValue",get:function(){return this._blocks.reduce((function(t,e){return t+e.unmaskedValue}),"")},set:function(t){Ze(Ue(e.prototype),"unmaskedValue",t,this,!0)}},{key:"value",get:function(){return this._blocks.reduce((function(t,e){return t+e.value}),"")},set:function(t){Ze(Ue(e.prototype),"value",t,this,!0)}}]),e}(lr);function gr(t){if(!t)return!1;var e=t.value;return!e||t.nearestInputPos(0,Xe)!==e.length}yr.DEFAULTS={lazy:!0,placeholderChar:"_"},yr.STOP_CHAR="`",yr.ESCAPE_CHAR="\\",yr.InputDefinition=pr,yr.FixedDefinition=fr,ur.MaskedPattern=yr;var br=function(t){function e(){return Me(this,e),qe(this,Ue(e).apply(this,arguments))}return Le(e,t),Te(e,[{key:"_update",value:function(t){t=Object.assign({to:this.to||0,from:this.from||0},t);var r=String(t.to).length;null!=t.maxLength&&(r=Math.max(r,t.maxLength)),t.maxLength=r;for(var n=String(t.from).padStart(r,"0"),i=String(t.to).padStart(r,"0"),o=0;o1&&void 0!==arguments[1]?arguments[1]:{};if(t=ze(Ue(e.prototype),"doPrepare",this).call(this,t,r).replace(/\D/g,""),!this.autofix)return t;for(var n=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0"),o=this.value,s="",a=0;athis.to?s+=i[u.length-1]:s+=t[a]}return s}},{key:"doValidate",value:function(){var t,r=arguments,n=this.value,i=n.search(/[^0]/);if(-1===i&&n.length<=this._matchFrom)return!0;for(var o=this.boundaries(n),s=Ke(o,2),a=s[0],u=s[1],l=arguments.length,c=new Array(l),h=0;h=0}},{key:"date",get:function(){return this.typedValue},set:function(t){this.typedValue=t}},{key:"typedValue",get:function(){return this.isComplete?ze(Ue(e.prototype),"typedValue",this):null},set:function(t){Ze(Ue(e.prototype),"typedValue",t,this,!0)}}]),e}(yr);xr.DEFAULTS={pattern:"d{.}`m{.}`Y",format:function(t){return[String(t.getDate()).padStart(2,"0"),String(t.getMonth()+1).padStart(2,"0"),t.getFullYear()].join(".")},parse:function(t){var e=Ke(t.split("."),3),r=e[0],n=e[1],i=e[2];return new Date(i,n-1,r)}},xr.GET_DEFAULT_BLOCKS=function(){return{d:{mask:br,from:1,to:31,maxLength:2},m:{mask:br,from:1,to:12,maxLength:2},Y:{mask:br,from:1900,to:9999}}},ur.MaskedDate=xr;var _r=function(){function t(){Me(this,t)}return Te(t,[{key:"select",value:function(t,e){if(null!=t&&null!=e&&(t!==this.selectionStart||e!==this.selectionEnd))try{this._unsafeSelect(t,e)}catch(t){}}},{key:"_unsafeSelect",value:function(t,e){}},{key:"bindEvents",value:function(t){}},{key:"unbindEvents",value:function(){}},{key:"selectionStart",get:function(){var t;try{t=this._unsafeSelectionStart}catch(t){}return null!=t?t:this.value.length}},{key:"selectionEnd",get:function(){var t;try{t=this._unsafeSelectionEnd}catch(t){}return null!=t?t:this.value.length}},{key:"isActive",get:function(){return!1}}]),t}();ur.MaskElement=_r;var kr=function(t){function e(t){var r;return Me(this,e),(r=qe(this,Ue(e).call(this))).input=t,r._handlers={},r}return Le(e,t),Te(e,[{key:"_unsafeSelect",value:function(t,e){this.input.setSelectionRange(t,e)}},{key:"bindEvents",value:function(t){var r=this;Object.keys(t).forEach((function(n){return r._toggleEventHandler(e.EVENTS_MAP[n],t[n])}))}},{key:"unbindEvents",value:function(){var t=this;Object.keys(this._handlers).forEach((function(e){return t._toggleEventHandler(e)}))}},{key:"_toggleEventHandler",value:function(t,e){this._handlers[t]&&(this.input.removeEventListener(t,this._handlers[t]),delete this._handlers[t]),e&&(this.input.addEventListener(t,e),this._handlers[t]=e)}},{key:"rootElement",get:function(){return this.input.getRootNode?this.input.getRootNode():document}},{key:"isActive",get:function(){return this.input===this.rootElement.activeElement}},{key:"_unsafeSelectionStart",get:function(){return this.input.selectionStart}},{key:"_unsafeSelectionEnd",get:function(){return this.input.selectionEnd}},{key:"value",get:function(){return this.input.value},set:function(t){this.input.value=t}}]),e}(_r);kr.EVENTS_MAP={selectionChange:"keydown",input:"input",drop:"drop",click:"click",focus:"focus",commit:"blur"},ur.HTMLMaskElement=kr;var Er=function(t){function e(){return Me(this,e),qe(this,Ue(e).apply(this,arguments))}return Le(e,t),Te(e,[{key:"_unsafeSelect",value:function(t,e){if(this.rootElement.createRange){var r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,t),r.setEnd(this.input.lastChild||this.input,e);var n=this.rootElement,i=n.getSelection&&n.getSelection();i&&(i.removeAllRanges(),i.addRange(r))}}},{key:"_unsafeSelectionStart",get:function(){var t=this.rootElement,e=t.getSelection&&t.getSelection();return e&&e.anchorOffset}},{key:"_unsafeSelectionEnd",get:function(){var t=this.rootElement,e=t.getSelection&&t.getSelection();return e&&this._unsafeSelectionStart+String(e).length}},{key:"value",get:function(){return this.input.textContent},set:function(t){this.input.textContent=t}}]),e}(kr);ur.HTMLContenteditableMaskElement=Er;var Ar=function(){function t(e,r){Me(this,t),this.el=e instanceof _r?e:e.isContentEditable&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName?new Er(e):new kr(e),this.masked=hr(r),this._listeners={},this._value="",this._unmaskedValue="",this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}return Te(t,[{key:"maskEquals",value:function(t){return null==t||t===this.masked.mask||t===Date&&this.masked instanceof xr}},{key:"_bindEvents",value:function(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange})}},{key:"_unbindEvents",value:function(){this.el&&this.el.unbindEvents()}},{key:"_fireEvent",value:function(t){for(var e=arguments,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i=0&&this._listeners[t].splice(r,1),this}},{key:"_onInput",value:function(t){if(this._inputEvent=t,this._abortUpdateCursor(),!this._selection)return this.updateValue();var e=new or(this.el.value,this.cursorPos,this.value,this._selection),r=this.masked.rawInputValue,n=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection).offset,i=r===this.masked.rawInputValue?e.removeDirection:Xe,o=this.masked.nearestInputPos(e.startChangePos+n,i);this.updateControl(),this.updateCursor(o),delete this._inputEvent}},{key:"_onChange",value:function(){this.value!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}},{key:"_onDrop",value:function(t){t.preventDefault(),t.stopPropagation()}},{key:"_onFocus",value:function(t){this.alignCursorFriendly()}},{key:"_onClick",value:function(t){this.alignCursorFriendly()}},{key:"destroy",value:function(){this._unbindEvents(),this._listeners.length=0,delete this.el}},{key:"mask",get:function(){return this.masked.mask},set:function(t){if(!this.maskEquals(t))if(t instanceof ur.Masked||this.masked.constructor!==cr(t)){var e=hr({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}else this.masked.updateOptions({mask:t})}},{key:"value",get:function(){return this._value},set:function(t){this.masked.value=t,this.updateControl(),this.alignCursor()}},{key:"unmaskedValue",get:function(){return this._unmaskedValue},set:function(t){this.masked.unmaskedValue=t,this.updateControl(),this.alignCursor()}},{key:"typedValue",get:function(){return this.masked.typedValue},set:function(t){this.masked.typedValue=t,this.updateControl(),this.alignCursor()}},{key:"selectionStart",get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}},{key:"cursorPos",get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd},set:function(t){this.el&&this.el.isActive&&(this.el.select(t,t),this._saveSelection())}}]),t}();ur.InputMask=Ar;var Fr=function(t){function e(){return Me(this,e),qe(this,Ue(e).apply(this,arguments))}return Le(e,t),Te(e,[{key:"_update",value:function(t){t.enum&&(t.mask="*".repeat(t.enum[0].length)),ze(Ue(e.prototype),"_update",this).call(this,t)}},{key:"doValidate",value:function(){for(var t,r=arguments,n=this,i=arguments.length,o=new Array(i),s=0;s=0}))&&(t=ze(Ue(e.prototype),"doValidate",this)).call.apply(t,[this].concat(o))}}]),e}(yr);ur.MaskedEnum=Fr;var wr=function(t){function e(t){return Me(this,e),qe(this,Ue(e).call(this,Object.assign({},e.DEFAULTS,{},t)))}return Le(e,t),Te(e,[{key:"_update",value:function(t){ze(Ue(e.prototype),"_update",this).call(this,t),this._updateRegExps()}},{key:"_updateRegExps",value:function(){var t="^"+(this.allowNegative?"[+|\\-]?":""),e=(this.scale?"("+ir(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExpInput=new RegExp(t+"(0|([1-9]+\\d*))?"+e),this._numberRegExp=new RegExp(t+"\\d*"+e),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(ir).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(ir(this.thousandsSeparator),"g")}},{key:"_removeThousandsSeparators",value:function(t){return t.replace(this._thousandsSeparatorRegExp,"")}},{key:"_insertThousandsSeparators",value:function(t){var e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}},{key:"doPrepare",value:function(t){for(var r,n=arguments,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s1&&void 0!==arguments[1]&&arguments[1],r=0,n=0;n0&&void 0!==arguments[0]?arguments[0]:this._value;return this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2?arguments[2]:void 0,i=this._adjustRangeWithSeparators(t,r),o=Ke(i,2);return t=o[0],r=o[1],this._removeThousandsSeparators(ze(Ue(e.prototype),"extractInput",this).call(this,t,r,n))}},{key:"_appendCharRaw",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.thousandsSeparator)return ze(Ue(e.prototype),"_appendCharRaw",this).call(this,t,r);var n=r.tail&&r._beforeTailState?r._beforeTailState._value:this._value,i=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);var o=ze(Ue(e.prototype),"_appendCharRaw",this).call(this,t,r);this._value=this._insertThousandsSeparators(this._value);var s=r.tail&&r._beforeTailState?r._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(s);return o.tailShift+=(a-i)*this.thousandsSeparator.length,o.skip=!o.rawInserted&&t===this.thousandsSeparator,o}},{key:"_findSeparatorAround",value:function(t){if(this.thousandsSeparator){var e=t-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,e);if(r<=t)return r}return-1}},{key:"_adjustRangeWithSeparators",value:function(t,e){var r=this._findSeparatorAround(t);r>=0&&(t=r);var n=this._findSeparatorAround(e);return n>=0&&(e=n+this.thousandsSeparator.length),[t,e]}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,r=this._adjustRangeWithSeparators(t,e),n=Ke(r,2);t=n[0],e=n[1];var i=this.value.slice(0,t),o=this.value.slice(e),s=this._separatorsCount(i.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(i+o));var a=this._separatorsCountFromSlice(i);return new sr({tailShift:(a-s)*this.thousandsSeparator.length})}},{key:"nearestInputPos",value:function(t,e){if(!this.thousandsSeparator)return t;switch(e){case Xe:case Qe:case tr:var r=this._findSeparatorAround(t-1);if(r>=0){var n=r+this.thousandsSeparator.length;if(t=0)return i+this.thousandsSeparator.length}return t}},{key:"doValidate",value:function(t){var r=(t.input?this._numberRegExpInput:this._numberRegExp).test(this._removeThousandsSeparators(this.value));if(r){var n=this.number;r=r&&!isNaN(n)&&(null==this.min||this.min>=0||this.min<=this.number)&&(null==this.max||this.max<=0||this.number<=this.max)}return r&&ze(Ue(e.prototype),"doValidate",this).call(this,t)}},{key:"doCommit",value:function(){if(this.value){var t=this.number,r=t;null!=this.min&&(r=Math.max(r,this.min)),null!=this.max&&(r=Math.min(r,this.max)),r!==t&&(this.unmaskedValue=String(r));var n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&(n=this._padFractionalZeros(n)),this._value=n}ze(Ue(e.prototype),"doCommit",this).call(this)}},{key:"_normalizeZeros",value:function(t){var e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,(function(t,e,r,n){return e+n})),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}},{key:"_padFractionalZeros",value:function(t){if(!t)return t;var e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}},{key:"unmaskedValue",get:function(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,".")},set:function(t){Ze(Ue(e.prototype),"unmaskedValue",t.replace(".",this.radix),this,!0)}},{key:"typedValue",get:function(){return Number(this.unmaskedValue)},set:function(t){Ze(Ue(e.prototype),"unmaskedValue",String(t),this,!0)}},{key:"number",get:function(){return this.typedValue},set:function(t){this.typedValue=t}},{key:"allowNegative",get:function(){return this.signed||null!=this.min&&this.min<0||null!=this.max&&this.max<0}}]),e}(lr);wr.DEFAULTS={radix:",",thousandsSeparator:"",mapToRadix:["."],scale:2,signed:!1,normalizeZeros:!0,padFractionalZeros:!1},ur.MaskedNumber=wr;var Pr=function(t){function e(){return Me(this,e),qe(this,Ue(e).apply(this,arguments))}return Le(e,t),Te(e,[{key:"_update",value:function(t){t.mask&&(t.validate=t.mask),ze(Ue(e.prototype),"_update",this).call(this,t)}}]),e}(lr);ur.MaskedFunction=Pr;var Sr=function(t){function e(t){var r;return Me(this,e),(r=qe(this,Ue(e).call(this,Object.assign({},e.DEFAULTS,{},t)))).currentMask=null,r}return Le(e,t),Te(e,[{key:"_update",value:function(t){ze(Ue(e.prototype),"_update",this).call(this,t),"mask"in t&&(this.compiledMasks=Array.isArray(t.mask)?t.mask.map((function(t){return hr(t)})):[])}},{key:"_appendCharRaw",value:function(){var t,e=this._applyDispatch.apply(this,arguments);this.currentMask&&e.aggregate((t=this.currentMask)._appendChar.apply(t,arguments));return e}},{key:"_applyDispatch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.tail&&null!=e._beforeTailState?e._beforeTailState._value:this.value,n=this.rawInputValue,i=e.tail&&null!=e._beforeTailState?e._beforeTailState._rawInputValue:n,o=n.slice(i.length),s=this.currentMask,a=new sr,u=s&&s.state;if(this.currentMask=this.doDispatch(t,Object.assign({},e)),this.currentMask)if(this.currentMask!==s){this.currentMask.reset();var l=this.currentMask.append(i,{raw:!0});a.tailShift=l.inserted.length-r.length,o&&(a.tailShift+=this.currentMask.append(o,{raw:!0,tail:!0}).tailShift)}else this.currentMask.state=u;return a}},{key:"_appendPlaceholder",value:function(){var t=this._applyDispatch.apply(this,arguments);return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}},{key:"doDispatch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.dispatch(t,this,e)}},{key:"doValidate",value:function(){for(var t,r,n=arguments,i=arguments.length,o=new Array(i),s=0;s1&&void 0!==arguments[1]?arguments[1]:Or.MASKED,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Or.MASKED,n=hr(t);return function(t){return n.runIsolated((function(n){return n[e]=t,n[r]}))}}ur.PIPE_TYPE=Or,ur.createPipe=Cr,ur.pipe=function(t){for(var e=arguments,r=arguments.length,n=new Array(r>1?r-1:0),i=1;in)},alpha:function(t,e){var r=t.value;void 0===e&&(e="default");var n={default:/^[a-zA-ZÀ-ÖØ-öø-ÿĄąĆćĘꣳŃńŚśŹźŻż]+$/,latin:/^[a-zA-Z]+$/},i=n.hasOwnProperty(e)?e:"default";return Promise.resolve(n[i].test(r))},alphanumeric:function(t,e){var r=t.value;void 0===e&&(e="default");var n={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿĄąĆćĘꣳŃńŚśŹźŻż]+$/,latin:/^[a-zA-Z0-9]+$/},i=n.hasOwnProperty(e)?e:"default";return Promise.resolve(n[i].test(r))},before:function(t,e){var r=t.value;void 0===e&&(e=!1);var n=Date.parse(e||new Date),i=Date.parse(r);return Promise.resolve(!isNaN(i)&&ie&&ie&&i.length()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},endsWith:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.endsWith(t)})):"string"==typeof e&&0===r.length)},in:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve(void 0!==r.find((function(t){return"object"==typeof t?ke(t,e):t===e})))},matches:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve(!!r.find((function(t){return"string"==typeof t&&"/"===t.substr(0,1)&&"/"===t.substr(-1)&&(t=new RegExp(t.substr(1,t.length-2))),t instanceof RegExp?t.test(e):t===e})))},mime:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve(function(){if(e instanceof xe)for(var t=e.getFiles(),n=0;n=e):!isNaN(n)&&"length"!==r||"value"===r?(n=isNaN(n)?n:Number(n))>=e:("string"==typeof n||"length"===r)&&(n=isNaN(n)?n:n.toString()).length>=e)},max:function(t,e,r){var n=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(n)?(e=isNaN(e)?e:Number(e),n.length<=e):!isNaN(n)&&"length"!==r||"value"===r?(n=isNaN(n)?n:Number(n))<=e:("string"==typeof n||"length"===r)&&(n=isNaN(n)?n:n.toString()).length<=e)},not:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve(void 0===r.find((function(t){return"object"==typeof t?ke(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var r=t.value;return void 0===e&&(e=!0),Promise.resolve(!(e&&!["no","false"].includes(e))||(Array.isArray(r)?!!r.length:r instanceof xe?r.getFiles().length>0:"string"==typeof r?!!r:"object"!=typeof r||!!r&&!!Object.keys(r).length))},startsWith:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.startsWith(t)})):"string"==typeof e&&0===r.length)},url:function(t){var r=t.value;return Promise.resolve(e(r))},bail:function(){return Promise.resolve(!0)},optional:function(t){var e=t.value;return Promise.resolve(!Ve(e))}},Rr="image/",Mr={csv:"text/csv",gif:Rr+"gif",jpg:Rr+"jpeg",jpeg:Rr+"jpeg",png:Rr+"png",pdf:"application/pdf",svg:Rr+"svg+xml"},Nr=["outer","wrapper","label","element","input","help","errors","error","decorator","rangeValue","uploadArea","uploadAreaMask","files","file","fileName","fileRemove","fileProgress","fileUploadError","fileImagePreview","fileProgressInner","grouping","groupRepeatable","groupRepeatableRemove","groupAddMore"],Tr={hasErrors:function(t){return t.hasErrors},hasValue:function(t){return t.hasValue},isValid:function(t){return t.isValid}},Lr=function(t,e,r){var n=[];switch(e){case"label":n.push(t+"--"+r.labelPosition);break;case"element":var i="group"===r.classification?"group":r.type;n.push(t+"--"+i),"group"===i&&n.push("formulate-input-group");break;case"help":n.push(t+"--"+r.helpPosition)}return n},Ur=(Vr=[""].concat(Object.keys(Tr).map((function(t){return Ae(t)}))),Nr.reduce((function(t,e){return t.concat(Vr.reduce((function(t,r){return t.push(""+e+r+"Class"),t}),[]))}),[]));function Hr(t,e,r){switch(typeof e){case"string":return e;case"function":return e(r,Fe(t));case"object":if(Array.isArray(e))return Fe(t).concat(e);default:return t}}function Gr(t){return Nr.reduce((function(e,r){var n;return Object.assign(e,((n={})[r]=function(t,e){var r=t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()})),n="formulate"+("file"===r.substr(0,4)?"":"-input")+(["decorator","range-value"].includes(r)?"-element":"")+("outer"!==r?"-"+r:"");return"input"===r?[]:[n].concat(Lr(n,t,e))}(r,t),n))}),{})}function qr(t,e,r,n){return new Promise((function(r,i){var o=(n.fauxUploaderDuration||2e3)*(.5+Math.random()),s=performance.now(),a=function(){return setTimeout((function(){var n=performance.now()-s,i=Math.min(100,Math.round(n/o*100));if(e(i),i>=100)return r({url:"http://via.placeholder.com/350x150.png",name:t.name});a()}),20)};a()}))}function Wr(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}var zr={inheritAttrs:!1,functional:!0,render:function(t,e){for(var r=e.props,n=e.data,i=e.parent,o=e.children,s=i,a=(r.name,r.forceWrap),u=r.context,l=Wr(r,["name","forceWrap","context"]);s&&"FormulateInput"!==s.$options.name;)s=s.$parent;if(!s)return null;if(s.$scopedSlots&&s.$scopedSlots[r.name])return s.$scopedSlots[r.name](Object.assign({},u,l));if(Array.isArray(o)&&(o.length>1||a&&o.length>0)){var c=n.attrs,h=(c.name,c.context,Wr(c,["name","context"]));return t("div",Object.assign({},n,{attrs:h}),o)}return Array.isArray(o)&&1===o.length?o[0]:null}};function Yr(t,e){if(t&&"object"==typeof t&&!Array.isArray(t)){var r=t.children;void 0===r&&(r=null);var n=t.component;void 0===n&&(n="FormulateInput");var i=t.depth;void 0===i&&(i=1);var o=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(t,["children","component","depth"]),s="FormulateInput"===n?o.type||"text":"",a=o.name||s||"el",u=o.id||a+"-"+i+"-"+e,l=Array.isArray(r)?r.map((function(t){return Object.assign(t,{depth:i+1})})):r;return Object.assign({key:u,depth:i,attrs:o,component:n},l?{children:l}:{})}return null}var Zr={functional:!0,render:function(t,e){return function t(e,r){return Array.isArray(r)?r.map((function(r){var n=Yr(r);return e(n.component,{attrs:n.attrs},n.children?t(e,n.children):null)})):r}(t,e.props.schema)}};function Kr(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}var Jr=function(t){this.registry=new Map,this.ctx=t};function Xr(t){return new Jr(t).dataProps()}function Qr(){return{hasInitialValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue||this.values&&"object"==typeof this.values||this.isGrouping&&"object"==typeof this.context.model[this.index]},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},initialValues:function(){return Oe(this.$options.propsData,"formulateValue")&&"object"==typeof this.formulateValue?Object.assign({},this.formulateValue):Oe(this.$options.propsData,"values")&&"object"==typeof this.values?Object.assign({},this.values):this.isGrouping&&"object"==typeof this.context.model[this.index]?this.context.model[this.index]:{}}}}function tn(t){void 0===t&&(t=[]);var e={applyInitialValues:function(){this.hasInitialValue&&(this.proxy=this.initialValues)},setFieldValue:function(t,e){var r;if(void 0===e){var n=this.proxy,i=(n[t],Kr(n,[String(t)]));this.proxy=i}else Object.assign(this.proxy,((r={})[t]=e,r));this.$emit("input",Object.assign({},this.proxy))},valueDeps:function(t){var e=this;return Object.keys(this.proxy).reduce((function(r,n){return Object.defineProperty(r,n,{enumerable:!0,get:function(){var r=e.registry.get(n);return e.deps.set(t,e.deps.get(t)||new Set),r&&(e.deps.set(r,e.deps.get(r)||new Set),e.deps.get(r).add(t.name)),e.deps.get(t).add(n),e.proxy[n]}})}),Object.create(null))},validateDeps:function(t){var e=this;this.deps.has(t)&&this.deps.get(t).forEach((function(t){return e.registry.has(t)&&e.registry.get(t).performValidation()}))},hasValidationErrors:function(){return Promise.all(this.registry.reduce((function(t,e,r){return t.push(e.performValidation()&&e.getValidationErrors()),t}),[])).then((function(t){return t.some((function(t){return t.hasErrors}))}))},showErrors:function(){this.childrenShouldShowErrors=!0,this.registry.map((function(t){t.formShouldShowErrors=!0}))},hideErrors:function(){this.childrenShouldShowErrors=!1,this.registry.map((function(t){t.formShouldShowErrors=!1,t.behavioralErrorVisibility=!1}))},setValues:function(t){var e=this;Array.from(new Set(Object.keys(t).concat(Object.keys(this.proxy)))).forEach((function(r){ke(t[r],e.proxy[r])||(e.setFieldValue(r,t[r]),e.registry.has(r)&&!ke(t[r],e.registry.get(r).proxy)&&(e.registry.get(r).context.model=t[r]))}))}};return Object.keys(e).reduce((function(r,n){var i;return t.includes(n)?r:Object.assign({},r,((i={})[n]=e[n],i))}),{})}function en(t,e){void 0===e&&(e=[]);var r={formulateSetter:t.setFieldValue,formulateRegister:t.register,formulateDeregister:t.deregister,getFormValues:t.valueDeps,validateDependents:t.validateDeps};return Object.keys(r).filter((function(t){return!e.includes(t)})).reduce((function(t,e){var n;return Object.assign(t,((n={})[e]=r[e],n))}),{})}Jr.prototype.add=function(t,e){return this.registry.set(t,e),this},Jr.prototype.remove=function(t){this.ctx.deps.delete(this.registry.get(t)),this.ctx.deps.forEach((function(e){return e.delete(t)})),this.registry.delete(t);var e=this.ctx.proxy,r=(e[t],Kr(e,[String(t)]));return this.ctx.proxy=r,this},Jr.prototype.has=function(t){return this.registry.has(t)},Jr.prototype.get=function(t){return this.registry.get(t)},Jr.prototype.map=function(t){var e={};return this.registry.forEach((function(r,n){var i;return Object.assign(e,((i={})[n]=t(r,n),i))})),e},Jr.prototype.keys=function(){return Array.from(this.registry.keys())},Jr.prototype.register=function(t,e){if(this.registry.has(t))return!1;this.registry.set(t,e);var r=Oe(e.$options.propsData,"formulateValue"),n=Oe(e.$options.propsData,"value");r||!this.ctx.hasInitialValue||Ve(this.ctx.initialValues[t])?!r&&!n||ke(e.proxy,this.ctx.initialValues[t])||this.ctx.setFieldValue(t,e.proxy):e.context.model=this.ctx.initialValues[t],this.childrenShouldShowErrors&&(e.formShouldShowErrors=!0)},Jr.prototype.reduce=function(t,e){return this.registry.forEach((function(r,n){e=t(e,r,n)})),e},Jr.prototype.dataProps=function(){var t=this;return{proxy:{},registry:this,register:this.register.bind(this),deregister:function(e){return t.remove(e)},childrenShouldShowErrors:!1,deps:new Map}};var rn=function(t){this.form=t};rn.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},rn.prototype.values=function(){var t=this;return new Promise((function(e,r){var n=[],i=function t(e){if("object"!=typeof e)return e;var r=Array.isArray(e)?[]:{};for(var n in e)e[n]instanceof xe||Se(e[n])?r[n]=e[n]:r[n]=t(e[n]);return r}(t.form.proxy),o=function(e){"object"==typeof t.form.proxy[e]&&t.form.proxy[e]instanceof xe&&n.push(t.form.proxy[e].upload().then((function(t){var r;return Object.assign(i,((r={})[e]=t,r))})))};for(var s in i)o(s);Promise.all(n).then((function(){return e(i)})).catch((function(t){return r(t)}))}))};var nn={provide:function(){return Object.assign({},en(this),{observeErrors:this.addErrorObserver,removeErrorObserver:this.removeErrorObserver,formulateFieldValidation:this.formulateFieldValidation})},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}},values:{type:[Object,Boolean],default:!1},errors:{type:[Object,Boolean],default:!1},formErrors:{type:Array,default:function(){return[]}},schema:{type:[Array,Boolean],default:!1}},data:function(){return Object.assign({},Xr(this),{formShouldShowErrors:!1,errorObservers:[],namedErrors:[],namedFieldErrors:{}})},computed:Object.assign({},Qr(),{formContext:function(){return{errors:this.mergedFormErrors}},classes:function(){var t={"formulate-form":!0};return this.name&&(t["formulate-form--"+this.name]=!0),t},mergedFormErrors:function(){return this.formErrors.concat(this.namedErrors)},mergedFieldErrors:function(){var t={};if(this.errors)for(var e in this.errors)t[e]=Fe(this.errors[e]);for(var r in this.namedFieldErrors)t[r]=Fe(this.namedFieldErrors[r]);return t},hasFormErrorObservers:function(){return!!this.errorObservers.filter((function(t){return"form"===t.type})).length}}),watch:{formulateValue:{handler:function(t){this.isVmodeled&&t&&"object"==typeof t&&this.setValues(t)},deep:!0},mergedFormErrors:function(t){this.errorObservers.filter((function(t){return"form"===t.type})).forEach((function(e){return e.callback(t)}))},mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type})).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0}},created:function(){this.$formulate.register(this),this.applyInitialValues()},destroyed:function(){this.$formulate.deregister(this)},methods:Object.assign({},tn(),{applyErrors:function(t){var e=t.formErrors,r=t.inputErrors;this.namedErrors=e,this.namedFieldErrors=r},addErrorObserver:function(t){this.errorObservers.find((function(e){return t.callback===e.callback}))||(this.errorObservers.push(t),"form"===t.type?t.callback(this.mergedFormErrors):Oe(this.mergedFieldErrors,t.field)&&t.callback(this.mergedFieldErrors[t.field]))},removeErrorObserver:function(t){this.errorObservers=this.errorObservers.filter((function(e){return e.callback!==t}))},registerErrorComponent:function(t){this.errorComponents.includes(t)||this.errorComponents.push(t)},formSubmitted:function(){var t=this;this.showErrors();var e=new rn(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},formulateFieldValidation:function(t){this.$emit("validation",t)}})},on=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.schema?r("FormulateSchema",{attrs:{schema:t.schema}}):t._e(),t._v(" "),t.hasFormErrorObservers?t._e():r("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default")],2)};on._withStripped=!0;var sn=pe({render:on,staticRenderFns:[]},void 0,nn,void 0,!1,void 0,!1,void 0,void 0,void 0);var an={context:function(){return hn.call(this,Object.assign({},{addLabel:this.logicalAddLabel,attributes:this.elementAttributes,blurHandler:cn.bind(this),classification:this.classification,component:this.component,disableErrors:this.disableErrors,errors:this.explicitErrors,formShouldShowErrors:this.formShouldShowErrors,getValidationErrors:this.getValidationErrors.bind(this),hasGivenName:this.hasGivenName,hasValue:this.hasValue,hasLabel:this.label&&"button"!==this.classification,hasValidationErrors:this.hasValidationErrors.bind(this),help:this.help,helpPosition:this.logicalHelpPosition,id:this.id||this.defaultId,isValid:this.isValid,imageBehavior:this.imageBehavior,label:this.label,labelPosition:this.logicalLabelPosition,limit:this.limit===1/0?this.limit:parseInt(this.limit,10),name:this.nameOrFallback,minimum:parseInt(this.minimum,10),performValidation:this.performValidation.bind(this),pseudoProps:this.pseudoProps,preventWindowDrops:this.preventWindowDrops,repeatable:this.repeatable,rootEmit:this.$emit.bind(this),setErrors:this.setErrors.bind(this),showValidationErrors:this.showValidationErrors,slotComponents:this.slotComponents,slotProps:this.slotProps,type:this.type,uploadBehavior:this.uploadBehavior,uploadUrl:this.mergedUploadUrl,uploader:this.uploader||this.$formulate.getUploader(),validationErrors:this.validationErrors,value:this.value,visibleValidationErrors:this.visibleValidationErrors,isSubField:this.isSubField,classes:this.classes},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification){var t=this.id||this.elementAttributes.id.replace(/[^0-9]/g,"");return this.type+"_"+t}if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},hasGivenName:function(){return"boolean"!=typeof this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:ln.call(this,this.options),optionGroups:!!this.optionGroups&&_e(this.optionGroups,(function(e,r){return ln.call(t,r)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:ln.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.filteredAttributes);this.id?t.id=this.id:t.id=this.defaultId;this.hasGivenName&&(t.name=this.name);this.help&&(t["aria-describedby"]=t.id+"-help");!this.classes.input||Array.isArray(this.classes.input)&&!this.classes.input.length||(t.class=this.classes.input);return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},logicalHelpPosition:function(){if(this.helpPosition)return this.helpPosition;switch(this.classification){case"group":return"before";default:return"after"}},mergedUploadUrl:function(){return this.uploadUrl||this.$formulate.getUploadUrl()},hasValue:function(){var t=this,e=this.proxy;if("box"===this.classification&&this.isGrouped)return Array.isArray(e)?e.some((function(e){return e===t.value})):this.value===e;return!Ve(e)},visibleValidationErrors:function(){return this.showValidationErrors&&this.validationErrors.length?this.validationErrors:[]},slotComponents:function(){var t=this.$formulate.slotComponent.bind(this.$formulate);return{label:t(this.type,"label"),help:t(this.type,"help"),errors:t(this.type,"errors"),repeatable:t(this.type,"repeatable"),addMore:t(this.type,"addMore"),remove:t(this.type,"remove")}},logicalAddLabel:function(){if("boolean"==typeof this.addLabel)return"+ "+(this.label||this.name||"Add");return this.addLabel},classes:function(){return this.$formulate.classes(Object.assign({},this.$props,this.pseudoProps,{classification:this.classification,hasErrors:this.hasVisibleErrors,hasValue:this.hasValue,helpPosition:this.logicalHelpPosition,isValid:this.isValid,labelPosition:this.logicalLabelPosition,type:this.type,value:this.proxy}))},showValidationErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;if("file"===this.classification&&"live"===this.uploadBehavior&&dn.call(this))return!0;return this.behavioralErrorVisibility},slotProps:function(){var t=this.$formulate.slotProps.bind(this.$formulate);return{label:t(this.type,"label",this.typeProps),help:t(this.type,"help",this.typeProps),errors:t(this.type,"errors",this.typeProps),repeatable:t(this.type,"repeatable",this.typeProps),addMore:t(this.type,"addMore",this.typeProps),remove:t(this.type,"remove",this.typeProps)}},pseudoProps:function(){return un(this.localAttributes,Ur)},isValid:function(){return!this.hasErrors},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedValidationName:function(){if(this.validationName)return this.validationName;if("string"==typeof this.name)return this.name;if(this.label)return this.label;return this.type},explicitErrors:function(){return Fe(this.errors).concat(this.localErrors).concat(Fe(this.error))},allErrors:function(){return this.explicitErrors.concat(Fe(this.validationErrors))},hasVisibleErrors:function(){return Array.isArray(this.validationErrors)&&this.validationErrors.length&&this.showValidationErrors||!!this.explicitErrors.length},hasErrors:function(){return!!this.allErrors.length},filteredAttributes:function(){var t=this,e=Object.keys(this.pseudoProps).concat(Object.keys(this.typeProps));return Object.keys(this.localAttributes).reduce((function(r,n){return e.includes(Ee(n))||(r[n]=t.localAttributes[n]),r}),{})},typeProps:function(){return un(this.localAttributes,this.$formulate.typeProps(this.type))},listeners:function(){var t=this.$listeners;t.input;return function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(t,["input"])}};function un(t,e){return Object.keys(t).reduce((function(r,n){var i=Ee(n);return e.includes(i)&&(r[i]=t[n]),r}),{})}function ln(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var e=[];for(var r in t)e.push({value:r,label:t[r],id:this.elementAttributes.id+"_"+r});return e}return t}function cn(){"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function hn(t){return Object.defineProperty(t,"model",{get:dn.bind(this),set:pn.bind(this)})}function dn(){var t=this.isVmodeled?"formulateValue":"proxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]||0===this[t]?this[t]:""}function pn(t){var e=!1;ke(t,this.proxy)||(this.proxy=t,e=!0),this.context.name&&"function"==typeof this.formulateSetter&&this.formulateSetter(this.context.name,t),e&&this.$emit("input",t)}var fn={name:"FormulateInput",inheritAttrs:!1,provide:function(){return{formulateRegisterRule:this.registerRule,formulateRemoveRule:this.removeRule}},inject:{formulateSetter:{default:void 0},formulateFieldValidation:{default:function(){return function(){return{}}}},formulateRegister:{default:void 0},formulateDeregister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}},validateDependents:{default:function(){return function(){}}},observeErrors:{default:void 0},removeErrorObserver:{default:void 0},isSubField:{default:function(){return function(){return!1}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},limit:{type:[String,Number],default:1/0,validator:function(t){return 1/0}},minimum:{type:[String,Number],default:0,validator:function(t){return parseInt(t,10)==t}},help:{type:[String,Boolean],default:!1},helpPosition:{type:[String,Boolean],default:!1},isGrouped:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},repeatable:{type:Boolean,default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live","submit"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}},checked:{type:[String,Boolean],default:!1},disableErrors:{type:Boolean,default:!1},addLabel:{type:[Boolean,String],default:!1}},data:function(){return{defaultId:this.$formulate.nextId(this),localAttributes:{},localErrors:[],proxy:this.getInitialValue(),behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve(),ruleRegistry:[],messageRegistry:{}}},computed:Object.assign({},an,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)},parsedValidationRules:function(){var t=this,e={};return Object.keys(this.validationRules).forEach((function(r){e[Ee(r)]=t.validationRules[r]})),e},messages:function(){var t=this,e={};return Object.keys(this.validationMessages).forEach((function(r){e[Ee(r)]=t.validationMessages[r]})),Object.keys(this.messageRegistry).forEach((function(r){e[Ee(r)]=t.messageRegistry[r]})),e}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},proxy:function(t,e){this.performValidation(),this.isVmodeled||ke(t,e)||(this.context.model=t),this.validateDependents(this)},formulateValue:function(t,e){this.isVmodeled&&!ke(t,e)&&(this.context.model=t)},showValidationErrors:{handler:function(t){this.$emit("error-visibility",t)},immediate:!0}},created:function(){this.applyInitialValue(),this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.applyDefaultValue(),this.disableErrors||"function"!=typeof this.observeErrors||this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),this.updateLocalAttributes(this.$attrs),this.performValidation()},beforeDestroy:function(){this.disableErrors||"function"!=typeof this.removeErrorObserver||this.removeErrorObserver(this.setErrors),"function"==typeof this.formulateDeregister&&this.formulateDeregister(this.nameOrFallback)},methods:{getInitialValue:function(){var t=this.$formulate.classify(this.type);return"box"===(t="box"===t&&this.options?"group":t)&&this.checked?this.value||!0:Oe(this.$options.propsData,"value")&&"box"!==t?this.value:Oe(this.$options.propsData,"formulateValue")?this.formulateValue:""},applyInitialValue:function(){!ke(this.context.model,this.proxy)&&Oe(this.$options.propsData,"options")&&"box"===this.classification&&(this.context.model=this.proxy)},applyDefaultValue:function(){"select"===this.type&&!this.context.placeholder&&Ve(this.proxy)&&!this.isVmodeled&&!1===this.value&&this.context.options.length&&(this.context.model=this.context.options[0].value)},updateLocalAttributes:function(t){ke(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=we(this.validation,this.$formulate.rules(this.parsedValidationRules));return e=this.ruleRegistry.length?this.ruleRegistry.concat(e):e,this.pendingValidation=this.runRules(e).then((function(e){return t.didValidate(e)})),this.pendingValidation},runRules:function(t){var e=this,r=function(t){var r=t[0],n=t[1],i=t[2],o=(t[3],r.apply(void 0,[{value:e.context.model,getFormValues:function(){for(var t,r=[],n=arguments.length;n--;)r[n]=arguments[n];return(t=e).getFormValues.apply(t,[e].concat(r))},name:e.context.name}].concat(n)));return(o=o instanceof Promise?o:Promise.resolve(o)).then((function(t){return!t&&e.getMessage(i,n)}))};return new Promise((function(e){var n=function(t,i){void 0===i&&(i=[]);var o=t.shift();Array.isArray(o)&&o.length?Promise.all(o.map(r)).then((function(t){return t.filter((function(t){return!!t}))})).then((function(r){return(r=Array.isArray(r)?r:[]).length&&o.bail||!t.length?e(i.concat(r).filter((function(t){return!Ve(t)}))):n(t,i.concat(r))})):e([])};n(function(t){var e=[],r=t.findIndex((function(t){return"bail"===t[2].toLowerCase()})),n=t.findIndex((function(t){return"optional"===t[2].toLowerCase()}));if(n>=0){var i=t.splice(n,1);e.push(Object.defineProperty(i,"bail",{value:!0}))}if(r>=0){var o=t.splice(0,r+1).slice(0,-1);o.length&&e.push(o),t.map((function(t){return e.push(Object.defineProperty([t],"bail",{value:!0}))}))}else e.push(t);return e.reduce((function(t,e){var r=function(t,e){if(void 0===e&&(e=!1),t.length<2)return Object.defineProperty([t],"bail",{value:e});var n=[],i=t.findIndex((function(t){return"^"===t[3]}));if(i>=0){var o=t.splice(0,i);o.length&&n.push.apply(n,r(o,e)),n.push(Object.defineProperty([t.shift()],"bail",{value:!0})),t.length&&n.push.apply(n,r(t,e))}else n.push(t);return n};return t.concat(r(e))}),[])}(t))}))},didValidate:function(t){var e=!ke(t,this.validationErrors);if(this.validationErrors=t,e){var r=this.getErrorObject();this.$emit("validation",r),this.formulateFieldValidation&&"function"==typeof this.formulateFieldValidation&&this.formulateFieldValidation(r)}},getMessage:function(t,e){var r=this;return this.getMessageFunc(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues(this),getFormValues:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];return(t=r).getFormValues.apply(t,[r].concat(e))}})},getMessageFunc:function(t){var e=this;if("optional"===(t=Ee(t)))return function(){return[]};if(this.messages&&void 0!==this.messages[t])switch(typeof this.messages[t]){case"function":return this.messages[t];case"string":case"boolean":return function(){return e.messages[t]}}return function(r){return e.$formulate.validationMessage(t,r,e)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))},getValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){return t.pendingValidation.then((function(){return e(t.getErrorObject())}))}))}))},getErrorObject:function(){return{name:this.context.nameOrFallback||this.context.name,errors:this.validationErrors.filter((function(t){return"string"==typeof t})),hasErrors:!!this.validationErrors.length}},setErrors:function(t){this.localErrors=Fe(t)},registerRule:function(t,e,r,n){void 0===n&&(n=null),this.ruleRegistry.some((function(t){return t[2]===r}))||(this.ruleRegistry.push([t,e,r]),null!==n&&(this.messageRegistry[r]=n))},removeRule:function(t){var e=this.ruleRegistry.findIndex((function(e){return e[2]===t}));e>=0&&(this.ruleRegistry.splice(e,1),delete this.messageRegistry[t])}}},mn=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.outer,attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-has-value":t.hasValue,"data-type":t.type}},[r("div",{class:t.context.classes.wrapper},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,t._g(t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.component,!1),t.listeners),[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():r(t.context.slotComponents.errors,t._b({tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}},"component",t.context.slotProps.errors,!1))],null,t.context)],2)};mn._withStripped=!0;var vn=pe({render:mn,staticRenderFns:[]},void 0,fn,void 0,!1,void 0,!1,void 0,void 0,void 0),yn={inject:{observeErrors:{default:!1},removeErrorObserver:{default:!1}},props:{context:{type:Object,default:function(){return{}}},type:{type:String,default:"form"}},data:function(){return{boundSetErrors:this.setErrors.bind(this),localErrors:[]}},computed:{visibleValidationErrors:function(){return Array.isArray(this.context.visibleValidationErrors)?this.context.visibleValidationErrors:[]},errors:function(){return Array.isArray(this.context.errors)?this.context.errors:[]},mergedErrors:function(){return this.errors.concat(this.localErrors)},visibleErrors:function(){return Array.from(new Set(this.mergedErrors.concat(this.visibleValidationErrors))).filter((function(t){return"string"==typeof t}))},outerClass:function(){return"input"===this.type&&this.context.classes?this.context.classes.errors:"formulate-"+this.type+"-errors"},itemClass:function(){return"input"===this.type&&this.context.classes?this.context.classes.error:"formulate-"+this.type+"-error"}},created:function(){"form"!==this.type||"function"!=typeof this.observeErrors||Array.isArray(this.context.errors)||this.observeErrors({callback:this.boundSetErrors,type:this.type})},destroyed:function(){"form"!==this.type||"function"!=typeof this.removeErrorObserver||Array.isArray(this.context.errors)||this.removeErrorObserver(this.boundSetErrors)},methods:{setErrors:function(t){this.localErrors=Fe(t)}}},gn=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.visibleErrors.length?r("ul",{class:t.outerClass},t._l(t.visibleErrors,(function(e){return r("li",{key:e,class:t.itemClass,domProps:{textContent:t._s(e)}})})),0):t._e()};gn._withStripped=!0;var bn=pe({render:gn,staticRenderFns:[]},void 0,yn,void 0,!1,void 0,!1,void 0,void 0,void 0),xn={props:{context:{type:Object,required:!0}}},_n=function(){var t=this.$createElement,e=this._self._c||t;return this.context.help?e("div",{class:this.context.classes.help,attrs:{id:this.context.id+"-help"},domProps:{textContent:this._s(this.context.help)}}):this._e()};_n._withStripped=!0;var kn=pe({render:_n,staticRenderFns:[]},void 0,xn,void 0,!1,void 0,!1,void 0,void 0,void 0),En={name:"FormulateGrouping",props:{context:{type:Object,required:!0}},provide:function(){return{isSubField:function(){return!0},registerProvider:this.registerProvider,deregisterProvider:this.deregisterProvider}},data:function(){return{providers:[]}},inject:["formulateRegisterRule","formulateRemoveRule"],computed:{items:function(){return Array.isArray(this.context.model)?this.context.repeatable||0!==this.context.model.length?this.context.model.map((function(t){return Ce(t,t.__id)})):[Ce({})]:new Array(this.context.minimum||1).fill("").map((function(){return Ce({})}))},formShouldShowErrors:function(){return this.context.formShouldShowErrors}},watch:{providers:function(){this.formShouldShowErrors&&this.showErrors()},formShouldShowErrors:function(t){t&&this.showErrors()}},created:function(){this.formulateRegisterRule(this.validateGroup.bind(this),[],"formulateGrouping",!0)},destroyed:function(){this.formulateRemoveRule("formulateGrouping")},methods:{getAtIndex:function(t){return void 0!==this.context.model[t]&&this.context.model[t].__id?this.context.model[t]:void 0!==this.context.model[t]?Ce(this.context.model[t]):void 0===this.context.model[t]&&void 0!==this.items[t]?Ce({},this.items[t].__id):Ce({})},setFieldValue:function(t,e,r){var n,i=Array.isArray(this.context.model)?this.context.model:[],o=this.getAtIndex(t),s=Ce(Object.assign({},o,((n={})[e]=r,n)),o.__id);i.splice(t,1,s),this.context.model=i},validateGroup:function(){return Promise.all(this.providers.reduce((function(t,e){return e&&"function"==typeof e.hasValidationErrors&&t.push(e.hasValidationErrors()),t}),[])).then((function(t){return!t.some((function(t){return!!t}))}))},showErrors:function(){this.providers.forEach((function(t){return t&&"function"==typeof t.showErrors&&t.showErrors()}))},removeItem:function(t){Array.isArray(this.context.model)&&this.context.model.length>this.context.minimum?this.context.model.splice(t,1):this.items.length>this.context.minimum&&(this.context.model=new Array(this.items.length-1).fill("").map((function(){return Ce({})})))},registerProvider:function(t){this.providers.some((function(e){return e===t}))||this.providers.push(t)},deregisterProvider:function(t){this.providers=this.providers.filter((function(e){return e!==t}))}}},An=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{class:t.context.classes.grouping,attrs:{name:"grouping",context:t.context,"force-wrap":t.context.repeatable}},t._l(t.items,(function(e,n){return r("FormulateRepeatableProvider",{key:e.__id,attrs:{index:n,"set-field-value":function(e,r){return t.setFieldValue(n,e,r)},context:t.context},on:{remove:t.removeItem}},[t._t("default")],2)})),1)};An._withStripped=!0;var Fn=pe({render:An,staticRenderFns:[]},void 0,En,void 0,!1,void 0,!1,void 0,void 0,void 0),wn={props:{context:{type:Object,required:!0}}},Pn=function(){var t=this.$createElement;return(this._self._c||t)("label",{class:this.context.classes.label,attrs:{for:this.context.id},domProps:{textContent:this._s(this.context.label)}})};Pn._withStripped=!0;var Sn=pe({render:Pn,staticRenderFns:[]},void 0,wn,void 0,!1,void 0,!1,void 0,void 0,void 0),On={props:{context:{type:Object,required:!0},addMore:{type:Function,required:!0}}},Cn=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{class:this.context.classes.groupAddMore},[e("FormulateInput",{attrs:{type:"button",label:this.context.addLabel,"data-minor":"","data-ghost":""},on:{click:this.addMore}})],1)};Cn._withStripped=!0;var Vn=pe({render:Cn,staticRenderFns:[]},void 0,On,void 0,!1,void 0,!1,void 0,void 0,void 0),jn={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},attributes:function(){return this.context.attributes||{}},hasValue:function(){return this.context.hasValue}}},Dn={name:"FormulateInputBox",mixins:[jn]},$n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type}},["radio"===t.type?r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1),t.$listeners)):r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,i=!!n.checked;if(Array.isArray(r)){var o=t.context.value,s=t._i(r,o);n.checked?s<0&&t.$set(t.context,"model",r.concat([o])):s>-1&&t.$set(t.context,"model",r.slice(0,s).concat(r.slice(s+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1),t.$listeners)),t._v(" "),r("label",{tag:"component",class:t.context.classes.decorator,attrs:{for:t.attributes.id}})],1)};$n._withStripped=!0;var Bn=pe({render:$n,staticRenderFns:[]},void 0,Dn,void 0,!1,void 0,!1,void 0,void 0,void 0),In={name:"FormulateInputText",mixins:[jn]},Rn=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,i=!!n.checked;if(Array.isArray(r)){var o=t._i(r,null);n.checked?o<0&&t.$set(t.context,"model",r.concat([null])):o>-1&&t.$set(t.context,"model",r.slice(0,o).concat(r.slice(o+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1),t.$listeners)):"radio"===t.type?r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1),t.$listeners)):r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1),t.$listeners))])};Rn._withStripped=!0;var Mn=pe({render:Rn,staticRenderFns:[]},void 0,In,void 0,!1,void 0,!1,void 0,void 0,void 0),Nn={name:"FormulateFiles",props:{files:{type:xe,required:!0},imagePreview:{type:Boolean,default:!1},context:{type:Object,required:!0}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},Tn=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.fileUploads.length?r("ul",{class:t.context.classes.files},t._l(t.fileUploads,(function(e){return r("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":!(!t.imagePreview||!e.previewData)}},[r("div",{class:t.context.classes.file},[t.imagePreview&&e.previewData?r("div",{class:t.context.classes.fileImagePreview},[r("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),r("div",{class:t.context.classes.fileName,attrs:{title:e.name},domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?r("div",{class:t.context.classes.fileProgress,attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[r("div",{class:t.context.classes.fileProgressInner,style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?r("div",{class:t.context.classes.fileRemove,on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?r("div",{class:t.context.classes.fileUploadError,domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};Tn._withStripped=!0;var Ln={name:"FormulateInputFile",components:{FormulateFiles:pe({render:Tn,staticRenderFns:[]},void 0,Nn,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[jn],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof xe&&this.context.model.files.length)}},created:function(){Array.isArray(this.context.model)&&"string"==typeof this.context.model[0][this.$formulate.getFileUrlKey()]&&(this.context.model=this.$formulate.createUpload({files:this.context.model},this.context))},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){var t=this;this.isOver=!1;var e=this.$refs.file;e.files.length&&(this.context.model=this.$formulate.createUpload(e,this.context),this.$nextTick((function(){return t.attemptImmediateUpload()})))},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof xe&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},Un=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[r("div",{class:t.context.classes.uploadArea,attrs:{"data-has-files":t.hasFiles}},[r("input",t._g(t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1),t.$listeners)),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],class:t.context.classes.uploadAreaMask}),t._v(" "),t.hasFiles?r("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior,context:t.context}}):t._e()],1)])};Un._withStripped=!0;var Hn=pe({render:Un,staticRenderFns:[]},void 0,Ln,void 0,!1,void 0,!1,void 0,void 0,void 0),Gn={props:{context:{type:Object,required:!0},removeItem:{type:Function,required:!0},index:{type:Number,required:!0}}},qn=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.groupRepeatable},[r("FormulateSlot",{attrs:{name:"remove",context:t.context,"remove-item":t.removeItem}},[r(t.context.slotComponents.remove,t._b({tag:"component",attrs:{context:t.context,"remove-item":t.removeItem}},"component",t.context.slotProps.remove,!1))],1),t._v(" "),t._t("default")],2)};qn._withStripped=!0;var Wn=pe({render:qn,staticRenderFns:[]},void 0,Gn,void 0,!1,void 0,!1,void 0,void 0,void 0);function zn(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}var Yn={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},subType:function(){return"group"===this.context.type?"grouping":"inputs"},optionsWithContext:function(){var t=this,e=this.context,r=e.attributes,n=(r.id,zn(r,["id"])),i=(e.blurHandler,e.classification,e.component,e.getValidationErrors,e.hasLabel,e.hasValidationErrors,e.isSubField,e.isValid,e.labelPosition,e.options,e.performValidation,e.setErrors,e.slotComponents,e.slotProps,e.validationErrors,e.visibleValidationErrors,e.classes,e.showValidationErrors,e.rootEmit,e.help,e.pseudoProps,zn(e,["attributes","blurHandler","classification","component","getValidationErrors","hasLabel","hasValidationErrors","isSubField","isValid","labelPosition","options","performValidation","setErrors","slotComponents","slotProps","validationErrors","visibleValidationErrors","classes","showValidationErrors","rootEmit","help","pseudoProps"]));return this.options.map((function(e){return t.groupItemContext(i,e,n)}))},totalItems:function(){return Array.isArray(this.context.model)?this.context.model.length:this.context.minimum||1},canAddMore:function(){return this.context.repeatable&&this.totalItems-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,i=!!n.checked;if(Array.isArray(r)){var o=t._i(r,null);n.checked?o<0&&t.$set(t.context,"model",r.concat([null])):o>-1&&t.$set(t.context,"model",r.slice(0,o).concat(r.slice(o+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1),t.$listeners)):"radio"===t.type?r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1),t.$listeners)):r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1),t.$listeners)),t._v(" "),t.context.showValue?r("div",{class:t.context.classes.rangeValue,domProps:{textContent:t._s(t.context.model)}}):t._e()])};ii._withStripped=!0;var oi=pe({render:ii,staticRenderFns:[]},void 0,ni,void 0,!1,void 0,!1,void 0,void 0,void 0),si={name:"FormulateInputTextArea",mixins:[jn]},ai=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.element,attrs:{"data-type":"textarea"}},[r("textarea",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1),t.$listeners))])};ai._withStripped=!0;var ui=pe({render:ai,staticRenderFns:[]},void 0,si,void 0,!1,void 0,!1,void 0,void 0,void 0),li={provide:function(){var t=this;return Object.assign({},en(this,["getFormValues"]),{formulateSetter:function(e,r){return t.setFieldValue(e,r)}})},inject:{registerProvider:"registerProvider",deregisterProvider:"deregisterProvider"},props:{index:{type:Number,required:!0},context:{type:Object,required:!0},setFieldValue:{type:Function,required:!0}},data:function(){return Object.assign({},Xr(this),{isGrouping:!0})},computed:Object.assign({},Qr()),created:function(){this.registerProvider(this)},beforeDestroy:function(){this.deregisterProvider(this)},methods:Object.assign({},tn(["setFieldValue"]),{removeItem:function(){this.$emit("remove",this.index)}})},ci=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{attrs:{name:"repeatable",context:t.context,index:t.index,"remove-item":t.removeItem}},[r(t.context.slotComponents.repeatable,t._b({tag:"component",attrs:{context:t.context,index:t.index,"remove-item":t.removeItem}},"component",t.context.slotProps.repeatable,!1),[r("FormulateSlot",{attrs:{context:t.context,index:t.index,name:"default"}})],1)],1)};ci._withStripped=!0;var hi=pe({render:ci,staticRenderFns:[]},void 0,li,void 0,!1,void 0,!1,void 0,void 0,void 0),di={props:{context:{type:Object,required:!0},removeItem:{type:Function,required:!0}}},pi=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.context.repeatable?r("a",{class:t.context.classes.groupRepeatableRemove,attrs:{role:"button"},domProps:{textContent:t._s("Remove")},on:{click:function(e){return e.preventDefault(),t.removeItem(e)},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.removeItem(e)}}}):t._e()};pi._withStripped=!0;var fi=pe({render:pi,staticRenderFns:[]},void 0,di,void 0,!1,void 0,!1,void 0,void 0,void 0),mi=function(){this.options={},this.defaults={components:{FormulateSlot:zr,FormulateForm:sn,FormulateHelp:kn,FormulateLabel:Sn,FormulateInput:vn,FormulateErrors:bn,FormulateSchema:Zr,FormulateAddMore:Vn,FormulateGrouping:Fn,FormulateInputBox:Bn,FormulateInputText:Mn,FormulateInputFile:Hn,FormulateRepeatable:Wn,FormulateInputGroup:Kn,FormulateInputButton:Qn,FormulateInputSelect:ri,FormulateInputSlider:oi,FormulateInputTextArea:ui,FormulateRepeatableRemove:fi,FormulateRepeatableProvider:hi},slotComponents:{label:"FormulateLabel",help:"FormulateHelp",errors:"FormulateErrors",repeatable:"FormulateRepeatable",addMore:"FormulateAddMore",remove:"FormulateRepeatableRemove"},slotProps:{},library:Br,rules:Ir,mimes:Mr,locale:!1,uploader:qr,uploadUrl:!1,fileUrlKey:"url",uploadJustCompleteDuration:1e3,errorHandler:function(t){return t},plugins:[d],locales:{},idPrefix:"formulate-",baseClasses:function(t){return t},coreClasses:Gr,classes:{}},this.registry=new Map,this.idRegistry={}};mi.prototype.install=function(t,e){var r=this;t.prototype.$formulate=this,this.options=this.defaults;var n=this.defaults.plugins;for(var i in e&&Array.isArray(e.plugins)&&e.plugins.length&&(n=n.concat(e.plugins)),n.forEach((function(t){return"function"==typeof t?t(r):null})),this.extend(e||{}),this.options.components)t.component(i,this.options.components[i])},mi.prototype.nextId=function(t){var e=!(!t.$route||!t.$route.path)&&t.$route.path?t.$route.path.replace(/[/\\.\s]/g,"-"):"global";return Object.prototype.hasOwnProperty.call(this.idRegistry,e)||(this.idRegistry[e]=0),""+this.options.idPrefix+e+"-"+ ++this.idRegistry[e]},mi.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge(this.options,t),this;throw new Error("Formulate.extend expects an object, was "+typeof t)},mi.prototype.merge=function(t,e,r){void 0===r&&(r=!0);var n={};for(var i in t)e.hasOwnProperty(i)?l(e[i])&&l(t[i])?n[i]=this.merge(t[i],e[i],r):r&&Array.isArray(t[i])&&Array.isArray(e[i])?n[i]=t[i].concat(e[i]):n[i]=e[i]:n[i]=t[i];for(var o in e)n.hasOwnProperty(o)||(n[o]=e[o]);return n},mi.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},mi.prototype.classes=function(t){var e=this,r=this.options.coreClasses(t),n=this.options.baseClasses(r,t);return Object.keys(n).reduce((function(r,i){var o,s=Hr(n[i],e.options.classes[i],t);return s=function(t,e,r,n){return Object.keys(Tr).reduce((function(e,i){if(Tr[i](n)){var o=""+t+Ae(i),s=o+"Class";if(r[o])e=Hr(e,"string"==typeof r[o]?Fe(r[o]):r[o],n);if(n[s])e=Hr(e,"string"==typeof n[s]?Fe(n[s]):n[o+"Class"],n)}return e}),e)}(i,s=Hr(s,t[i+"Class"],t),e.options.classes,t),Object.assign(r,((o={})[i]=s,o))}),{})},mi.prototype.typeProps=function(t){var e=function(t){return Object.keys(t).reduce((function(e,r){return Array.isArray(t[r])?e.concat(t[r]):e}),[])},r=e(this.options.slotProps);return this.options.library[t]?r.concat(e(this.options.library[t].slotProps||{})):r},mi.prototype.slotProps=function(t,e,r){var n=Array.isArray(this.options.slotProps[e])?this.options.slotProps[e]:[],i=this.options.library[t];return i&&i.slotProps&&Array.isArray(i.slotProps[e])&&(n=n.concat(i.slotProps[e])),n.reduce((function(t,e){var n;return Object.assign(t,((n={})[e]=r[e],n))}),{})},mi.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},mi.prototype.slotComponent=function(t,e){var r=this.options.library[t];return r&&r.slotComponents&&r.slotComponents[e]?r.slotComponents[e]:this.options.slotComponents[e]},mi.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},mi.prototype.i18n=function(t){if(t.$i18n)switch(typeof t.$i18n.locale){case"string":return t.$i18n.locale;case"function":return t.$i18n.locale()}return!1},mi.prototype.getLocale=function(t){var e=this;return this.selectedLocale||(this.selectedLocale=[this.options.locale,this.i18n(t),"en"].reduce((function(t,r){if(t)return t;if(r){var n=function(t){return t.split("-").reduce((function(t,e){return t.length&&t.unshift(t[0]+"-"+e),t.length?t:[e]}),[])}(r).find((function(t){return Oe(e.options.locales,t)}));n&&(t=n)}return t}),!1)),this.selectedLocale},mi.prototype.validationMessage=function(t,e,r){var n=this.options.locales[this.getLocale(r)];return n.hasOwnProperty(t)?n[t](e):n.hasOwnProperty("default")?n.default(e):"Invalid field value"},mi.prototype.register=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.set(t.name,t)},mi.prototype.deregister=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.has(t.name)&&this.registry.delete(t.name)},mi.prototype.handle=function(t,e,r){void 0===r&&(r=!1);var n=r?t:this.options.errorHandler(t,e);return e&&this.registry.has(e)&&this.registry.get(e).applyErrors({formErrors:Fe(n.formErrors),inputErrors:n.inputErrors||{}}),n},mi.prototype.reset=function(t,e){void 0===e&&(e={}),this.resetValidation(t),this.setValues(t,e)},mi.prototype.submit=function(t){this.registry.get(t).formSubmitted()},mi.prototype.resetValidation=function(t){var e=this.registry.get(t);e.hideErrors(t),e.namedErrors=[],e.namedFieldErrors={}},mi.prototype.setValues=function(t,e){e&&!Array.isArray(e)&&"object"==typeof e&&this.registry.get(t).setValues(Object.assign({},e))},mi.prototype.getUploader=function(){return this.options.uploader||!1},mi.prototype.getUploadUrl=function(){return this.options.uploadUrl||!1},mi.prototype.getFileUrlKey=function(){return this.options.fileUrlKey||"url"},mi.prototype.createUpload=function(t,e){return new xe(t,e,this.options)};var vi=new mi,yi={FormulateForm:$e,FormulateSchema:be,FormulateInput:ve},gi={formEvents:Ie,enforceNumber:Dr,textMask:jr};return t.components=yi,t.default=function(t){void 0===t&&(t={});var e=vi.merge({features:{formEvents:!0,textMask:!1,enforceNumber:!1},override:{FormulateForm:!0,FormulateInput:!0,FormulateSchema:!0}},t);return function(t){e.override.FormulateForm&&t.extend({components:{FormulateForm:$e}}),e.override.FormulateInput&&t.extend({components:{FormulateInput:ve}}),e.override.FormulateSchema&&t.extend({components:{FormulateSchema:be}}),e.features.formEvents&&t.extend(Ie),e.features.textMask&&t.extend(jr),e.features.enforceNumber&&t.extend(Dr)}},t.features=gi,t}({}); +function u(t){return!0==(null!=(e=t)&&"object"==typeof e&&!1===Array.isArray(e))&&"[object Object]"===Object.prototype.toString.call(t);var e}function l(t){var e,r;return!1!==u(t)&&("function"==typeof(e=t.constructor)&&(!1!==u(r=e.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf")))}function c(t){return"string"==typeof t?t[0].toUpperCase()+t.substr(1):t}var h={accepted:function(t){return"Please accept the "+t.name+"."},after:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?c(e)+" must be after "+r[0]+".":c(e)+" must be a later date."},alpha:function(t){return c(t.name)+" can only contain alphabetical characters."},alphanumeric:function(t){return c(t.name)+" can only contain letters and numbers."},before:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?c(e)+" must be before "+r[0]+".":c(e)+" must be an earlier date."},between:function(t){var e=t.name,r=t.value,n=t.args,o=!(!Array.isArray(n)||!n[2])&&n[2];return!isNaN(r)&&"length"!==o||"value"===o?c(e)+" must be between "+n[0]+" and "+n[1]+".":c(e)+" must be between "+n[0]+" and "+n[1]+" characters long."},confirm:function(t){var e=t.name;return t.args,c(e)+" does not match."},date:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?c(e)+" is not a valid date, please use the format "+r[0]:c(e)+" is not a valid date."},default:function(t){return t.name,"This field isn’t valid."},email:function(t){t.name;var e=t.value;return e?"“"+e+"” is not a valid email address.":"Please enter a valid email address."},endsWith:function(t){t.name;var e=t.value;return e?"“"+e+"” doesn’t end with a valid value.":"This field doesn’t end with a valid value."},in:function(t){var e=t.name,r=t.value;return"string"==typeof r&&r?"“"+c(r)+"” is not an allowed "+e+".":"This is not an allowed "+e+"."},matches:function(t){return c(t.name)+" is not an allowed value."},max:function(t){var e=t.name,r=t.value,n=t.args;if(Array.isArray(r))return"You may only select "+n[0]+" "+e+".";var o=!(!Array.isArray(n)||!n[1])&&n[1];return!isNaN(r)&&"length"!==o||"value"===o?c(e)+" must be less than or equal to "+n[0]+".":c(e)+" must be less than or equal to "+n[0]+" characters long."},mime:function(t){var e=t.name,r=t.args;return c(e)+" must be of the type: "+(r[0]||"No file formats allowed.")},min:function(t){var e=t.name,r=t.value,n=t.args;if(Array.isArray(r))return"You need at least "+n[0]+" "+e+".";var o=!(!Array.isArray(n)||!n[1])&&n[1];return!isNaN(r)&&"length"!==o||"value"===o?c(e)+" must be at least "+n[0]+".":c(e)+" must be at least "+n[0]+" characters long."},not:function(t){var e=t.name;return"“"+t.value+"” is not an allowed "+e+"."},number:function(t){return c(t.name)+" must be a number."},required:function(t){return c(t.name)+" is required."},startsWith:function(t){t.name;var e=t.value;return e?"“"+e+"” doesn’t start with a valid value.":"This field doesn’t start with a valid value."},url:function(t){return t.name,"Please include a valid url."}};function p(t){var e;t.extend({locales:(e={},e.en=h,e)})}var d=function(t,e){return{classification:t,component:"FormulateInput"+(e||t[0].toUpperCase()+t.substr(1))}},f=Object.assign({},["text","email","number","color","date","hidden","month","password","search","tel","time","url","week","datetime-local"].reduce((function(t,e){var r;return Object.assign({},t,((r={})[e]=d("text"),r))}),{}),{range:d("slider"),textarea:d("textarea","TextArea"),checkbox:d("box"),radio:d("box"),submit:d("button"),button:d("button"),select:d("select"),file:d("file"),image:d("file"),group:d("group")});function m(t,e){var r={};for(var n in t)r[n]=e(n,t[n]);return r}function v(t,e,r){if(void 0===r&&(r=!1),t===e)return!0;if(!t||!e)return!1;if("object"!=typeof t&&"object"!=typeof e)return t===e;var n=Object.keys(t),o=Object.keys(e),i=n.length;if(o.length!==i)return!1;for(var s=0;s=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0,t.context.rootEmit("file-upload-complete",e))}),(function(n){e.progress=0,e.error=n,e.complete=!0,t.context.rootEmit("file-upload-error",n),r(n)}),t.options)}))).then((function(r){t.results=t.mapUUID(r),e(r)})).catch((function(t){throw new Error(t)}))}))},C.prototype.removeFile=function(t){var e=this.files.length;if(this.files=this.files.filter((function(e){return e&&e.uuid!==t})),Array.isArray(this.results)&&(this.results=this.results.filter((function(e){return e&&e.__id!==t}))),this.context.performValidation(),window&&this.fileList instanceof FileList&&this.supportsDataTransfers){var r=new DataTransfer;this.files.forEach((function(t){return r.items.add(t.file)})),this.fileList=r.files,this.input.files=this.fileList}else this.fileList=this.fileList.filter((function(e){return e&&e.__id!==t}));e>this.files.length&&this.context.rootEmit("file-removed",this.files)},C.prototype.mergeFileList=function(t){if(this.addFileList(t.files),this.supportsDataTransfers){var e=new DataTransfer;this.files.forEach((function(t){t.file instanceof File&&e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList,t.files=(new DataTransfer).files}this.context.performValidation(),this.loadPreviews(),"delayed"!==this.context.uploadBehavior&&this.upload()},C.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},C.prototype.dataTransferCheck=function(){try{new DataTransfer,this.supportsDataTransfers=!0}catch(t){this.supportsDataTransfers=!1}},C.prototype.getFiles=function(){return this.files},C.prototype.mapUUID=function(t){var e=this;return t.map((function(t,r){return e.files[r].path=void 0!==t&&t,t&&F(t,e.files[r].uuid)}))},C.prototype.toString=function(){var t=this.files.length?this.files.length+" files":"empty";return this.results?JSON.stringify(this.results,null," "):"FileUpload("+t+")"};var P,S={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var r=t.value;void 0===e&&(e=!1);var n=Date.parse(e||new Date),o=Date.parse(r);return Promise.resolve(!isNaN(o)&&o>n)},alpha:function(t,e){var r=t.value;void 0===e&&(e="default");var n={default:/^[a-zA-ZÀ-ÖØ-öø-ÿĄąĆćĘꣳŃńŚśŹźŻż]+$/,latin:/^[a-zA-Z]+$/},o=n.hasOwnProperty(e)?e:"default";return Promise.resolve(n[o].test(r))},alphanumeric:function(t,e){var r=t.value;void 0===e&&(e="default");var n={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿĄąĆćĘꣳŃńŚśŹźŻż]+$/,latin:/^[a-zA-Z0-9]+$/},o=n.hasOwnProperty(e)?e:"default";return Promise.resolve(n[o].test(r))},before:function(t,e){var r=t.value;void 0===e&&(e=!1);var n=Date.parse(e||new Date),o=Date.parse(r);return Promise.resolve(!isNaN(o)&&oe&&oe&&o.length()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},endsWith:function(t){for(var e=arguments,r=t.value,n=[],o=arguments.length-1;o-- >0;)n[o]=e[o+1];return Promise.resolve("string"==typeof r&&n.length?void 0!==n.find((function(t){return r.endsWith(t)})):"string"==typeof r&&0===n.length)},in:function(t){for(var e=arguments,r=t.value,n=[],o=arguments.length-1;o-- >0;)n[o]=e[o+1];return Promise.resolve(void 0!==n.find((function(t){return"object"==typeof t?v(t,r):t===r})))},matches:function(t){for(var e=arguments,r=t.value,n=[],o=arguments.length-1;o-- >0;)n[o]=e[o+1];return Promise.resolve(!!n.find((function(t){return"string"==typeof t&&"/"===t.substr(0,1)&&"/"===t.substr(-1)&&(t=new RegExp(t.substr(1,t.length-2))),t instanceof RegExp?t.test(r):t===r})))},mime:function(t){for(var e=arguments,r=t.value,n=[],o=arguments.length-1;o-- >0;)n[o]=e[o+1];return Promise.resolve(function(){if(r instanceof C)for(var t=r.getFiles(),e=0;e=e):!isNaN(n)&&"length"!==r||"value"===r?(n=isNaN(n)?n:Number(n))>=e:("string"==typeof n||"length"===r)&&(n=isNaN(n)?n:n.toString()).length>=e)},max:function(t,e,r){var n=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(n)?(e=isNaN(e)?e:Number(e),n.length<=e):!isNaN(n)&&"length"!==r||"value"===r?(n=isNaN(n)?n:Number(n))<=e:("string"==typeof n||"length"===r)&&(n=isNaN(n)?n:n.toString()).length<=e)},not:function(t){for(var e=arguments,r=t.value,n=[],o=arguments.length-1;o-- >0;)n[o]=e[o+1];return Promise.resolve(void 0===n.find((function(t){return"object"==typeof t?v(t,r):t===r})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var r=t.value;return void 0===e&&(e="pre"),Promise.resolve(Array.isArray(r)?!!r.length:r instanceof C?r.getFiles().length>0:"string"==typeof r?"trim"===e?!!r.trim():!!r:"object"!=typeof r||!!r&&!!Object.keys(r).length)},startsWith:function(t){for(var e=arguments,r=t.value,n=[],o=arguments.length-1;o-- >0;)n[o]=e[o+1];return Promise.resolve("string"==typeof r&&n.length?void 0!==n.find((function(t){return r.startsWith(t)})):"string"==typeof r&&0===n.length)},url:function(t){var r=t.value;return Promise.resolve(e(r))},bail:function(){return Promise.resolve(!0)},optional:function(t){var e=t.value;return Promise.resolve(!A(e))}},O="image/",V={csv:"text/csv",gif:O+"gif",jpg:O+"jpeg",jpeg:O+"jpeg",png:O+"png",pdf:"application/pdf",svg:O+"svg+xml"},j=["outer","wrapper","label","element","input","help","errors","error","decorator","rangeValue","uploadArea","uploadAreaMask","files","file","fileName","fileAdd","fileAddInput","fileRemove","fileProgress","fileUploadError","fileImagePreview","fileImagePreviewImage","fileProgressInner","grouping","groupRepeatable","groupRepeatableRemove","groupAddMore","form","formErrors","formError"],D={hasErrors:function(t){return t.hasErrors},hasValue:function(t){return t.hasValue},isValid:function(t){return t.isValid}},$=(P=[""].concat(Object.keys(D).map((function(t){return g(t)}))),j.reduce((function(t,e){return t.concat(P.reduce((function(t,r){return t.push(""+e+r+"Class"),t}),[]))}),[]));function B(t,e,r){switch(typeof e){case"string":return e;case"function":return e(r,x(t));case"object":if(Array.isArray(e))return x(t).concat(e);default:return t}}function I(t){return j.reduce((function(e,r){var n;return Object.assign(e,((n={})[r]=function(t,e){var r=t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()})),n="formulate"+(["form","file"].includes(r.substr(0,4))?"":"-input")+(["decorator","range-value"].includes(r)?"-element":"")+("outer"!==r?"-"+r:"");return"input"===r?[]:[n].concat(function(t,e,r){var n=[];switch(e){case"label":n.push(t+"--"+r.labelPosition);break;case"element":var o="group"===r.classification?"group":r.type;n.push(t+"--"+o),"group"===o&&n.push("formulate-input-group");break;case"help":n.push(t+"--"+r.helpPosition);break;case"form":r.name&&n.push(t+"--"+r.name)}return n}(n,t,e))}(r,t),n))}),{})}function R(t,e,r,n){return new Promise((function(r,o){var i=(n.fauxUploaderDuration||1500)*(.5+Math.random()),s=performance.now(),a=function(){return setTimeout((function(){var n=performance.now()-s,o=Math.min(100,Math.round(n/i*100));if(e(o),o>=100)return r({url:"http://via.placeholder.com/350x150.png",name:t.name});a()}),20)};a()}))}function M(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}var L={inheritAttrs:!1,functional:!0,render:function(t,e){for(var r=e.props,n=e.data,o=e.parent,i=e.children,s=o,a=(r.name,r.forceWrap),u=r.context,l=M(r,["name","forceWrap","context"]);s&&"FormulateInput"!==s.$options.name;)s=s.$parent;if(!s)return null;if(s.$scopedSlots&&s.$scopedSlots[r.name])return s.$scopedSlots[r.name](Object.assign({},u,l));if(Array.isArray(i)&&(i.length>1||a&&i.length>0)){var c=n.attrs,h=(c.name,c.context,M(c,["name","context"]));return t("div",Object.assign({},n,{attrs:h}),i)}return Array.isArray(i)&&1===i.length?i[0]:null}};var N={functional:!0,render:function(t,e){var r=e.props,n=e.listeners;return function t(e,r,n){return Array.isArray(r)?r.map((function(r,o){var i=function(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r={}),t&&"object"==typeof t&&!Array.isArray(t)){var n=t.children;void 0===n&&(n=null);var o=t.component;void 0===o&&(o="FormulateInput");var i=t.depth;void 0===i&&(i=1);var s=t.key;void 0===s&&(s=null);var a=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(t,["children","component","depth","key"]),u=a.class||{};delete a.class;var l={},c=Object.keys(a).reduce((function(t,e){var r;return/^@/.test(e)?Object.assign(t,((r={})[e.substr(1)]=a[e],r)):t}),{});Object.keys(c).forEach((function(t){delete a["@"+t],l[t]=function(t,e,r){return function(){for(var n,o,i=arguments,s=[],a=arguments.length;a--;)s[a]=i[a];return"function"==typeof e?e.call.apply(e,[this].concat(s)):"string"==typeof e&&E(r,e)?(n=r[e]).call.apply(n,[this].concat(s)):E(r,t)?(o=r[t]).call.apply(o,[this].concat(s)):void 0}}(t,c[t],r)}));var h="FormulateInput"===o?a.type||"text":o,p=a.name||h||"el";s||(s=a.id?a.id:"FormulateInput"!==o&&"string"==typeof n?h+"-"+function(t,e){void 0===e&&(e=0);for(var r=3735928559^e,n=1103547991^e,o=0,i=void 0;o>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&(n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)}(n):h+"-"+p+"-"+i+(a.name?"":"-"+e));var d=Array.isArray(n)?n.map((function(t){return Object.assign(t,{depth:i+1})})):n;return Object.assign({key:s,depth:i,attrs:a,component:o,class:u,on:l},d?{children:d}:{})}return null}(r,o,n);return e(i.component,{attrs:i.attrs,class:i.class,key:i.key,on:i.on},i.children?t(e,i.children,n):null)})):r}(t,r.schema,n)}};function T(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}var U=function(t){this.registry=new Map,this.errors={},this.ctx=t};function G(t){return new U(t).dataProps()}function H(t){return{hasInitialValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue||this.values&&"object"==typeof this.values||this.isGrouping&&"object"==typeof this.context.model[this.index]},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},initialValues:function(){return E(this.$options.propsData,"formulateValue")&&"object"==typeof this.formulateValue?Object.assign({},this.formulateValue):E(this.$options.propsData,"values")&&"object"==typeof this.values?Object.assign({},this.values):this.isGrouping&&"object"==typeof this.context.model[this.index]?this.context.model[this.index]:{}},mergedGroupErrors:function(){var t=this,e=/^([^.\d+].*?)\.(\d+\..+)$/;return Object.keys(this.mergedFieldErrors).filter((function(t){return e.test(t)})).reduce((function(r,n){var o,i=n.match(e),s=i[1],a=i[2];return r[s]||(r[s]={}),Object.assign(r[s],((o={})[a]=t.mergedFieldErrors[n],o)),r}),{})}}}function q(t){void 0===t&&(t=[]);var e={applyInitialValues:function(){this.hasInitialValue&&(this.proxy=Object.assign({},this.initialValues))},setFieldValue:function(t,e){var r;if(void 0===e){var n=this.proxy,o=(n[t],T(n,[String(t)]));this.proxy=o}else Object.assign(this.proxy,((r={})[t]=e,r));this.$emit("input",Object.assign({},this.proxy))},valueDeps:function(t){var e=this;return Object.keys(this.proxy).reduce((function(r,n){return Object.defineProperty(r,n,{enumerable:!0,get:function(){var r=e.registry.get(n);return e.deps.set(t,e.deps.get(t)||new Set),r&&(e.deps.set(r,e.deps.get(r)||new Set),e.deps.get(r).add(t.name)),e.deps.get(t).add(n),e.proxy[n]}})}),Object.create(null))},validateDeps:function(t){var e=this;this.deps.has(t)&&this.deps.get(t).forEach((function(t){return e.registry.has(t)&&e.registry.get(t).performValidation()}))},hasValidationErrors:function(){return Promise.all(this.registry.reduce((function(t,e,r){return t.push(e.performValidation()&&e.getValidationErrors()),t}),[])).then((function(t){return t.some((function(t){return t.hasErrors}))}))},showErrors:function(){this.childrenShouldShowErrors=!0,this.registry.map((function(t){t.formShouldShowErrors=!0}))},hideErrors:function(){this.childrenShouldShowErrors=!1,this.registry.map((function(t){t.formShouldShowErrors=!1,t.behavioralErrorVisibility=!1}))},setValues:function(t){var e=this;Array.from(new Set(Object.keys(t||{}).concat(Object.keys(this.proxy)))).forEach((function(r){var n=e.registry.has(r)&&e.registry.get(r),o=t?t[r]:void 0;n&&!v(n.proxy,o,!0)&&(n.context.model=o),v(o,e.proxy[r],!0)||e.setFieldValue(r,o)}))},updateValidation:function(t){E(this.registry.errors,t.name)&&(this.registry.errors[t.name]=t.hasErrors),this.$emit("validation",t)},addErrorObserver:function(t){this.errorObservers.find((function(e){return t.callback===e.callback}))||(this.errorObservers.push(t),"form"===t.type?t.callback(this.mergedFormErrors):"group"===t.type&&E(this.mergedGroupErrors,t.field)?t.callback(this.mergedGroupErrors[t.field]):E(this.mergedFieldErrors,t.field)&&t.callback(this.mergedFieldErrors[t.field]))},removeErrorObserver:function(t){this.errorObservers=this.errorObservers.filter((function(e){return e.callback!==t}))}};return Object.keys(e).reduce((function(r,n){var o;return t.includes(n)?r:Object.assign({},r,((o={})[n]=e[n],o))}),{})}function W(t,e){void 0===e&&(e=[]);var r={formulateSetter:t.setFieldValue,formulateRegister:t.register,formulateDeregister:t.deregister,formulateFieldValidation:t.updateValidation,getFormValues:t.valueDeps,getGroupValues:t.valueDeps,validateDependents:t.validateDeps,observeErrors:t.addErrorObserver,removeErrorObserver:t.removeErrorObserver};return Object.keys(r).filter((function(t){return!e.includes(t)})).reduce((function(t,e){var n;return Object.assign(t,((n={})[e]=r[e],n))}),{})}U.prototype.add=function(t,e){var r;return this.registry.set(t,e),this.errors=Object.assign({},this.errors,((r={})[t]=e.getErrorObject().hasErrors,r)),this},U.prototype.remove=function(t){this.ctx.deps.delete(this.registry.get(t)),this.ctx.deps.forEach((function(e){return e.delete(t)}));var e=this.ctx.keepModelData;!e&&this.registry.has(t)&&"inherit"!==this.registry.get(t).keepModelData&&(e=this.registry.get(t).keepModelData),this.ctx.preventCleanup&&(e=!0),this.registry.delete(t);var r=this.errors,n=(r[t],T(r,[String(t)]));if(this.errors=n,!e){var o=this.ctx.proxy,i=(o[t],T(o,[String(t)]));this.ctx.uuid&&F(i,this.ctx.uuid),this.ctx.proxy=i,this.ctx.$emit("input",this.ctx.proxy)}return this},U.prototype.has=function(t){return this.registry.has(t)},U.prototype.get=function(t){return this.registry.get(t)},U.prototype.map=function(t){var e={};return this.registry.forEach((function(r,n){var o;return Object.assign(e,((o={})[n]=t(r,n),o))})),e},U.prototype.keys=function(){return Array.from(this.registry.keys())},U.prototype.register=function(t,e){var r=this;if(E(e.$options.propsData,"ignored"))return!1;if(this.registry.has(t))return this.ctx.$nextTick((function(){return!r.registry.has(t)&&r.register(t,e)})),!1;this.add(t,e);var n=E(e.$options.propsData,"formulateValue"),o=E(e.$options.propsData,"value"),i=this.ctx.debounce||this.ctx.debounceDelay||this.ctx.context&&this.ctx.context.debounceDelay;i&&!E(e.$options.propsData,"debounce")&&(e.debounceDelay=i),n||!this.ctx.hasInitialValue||A(this.ctx.initialValues[t])?!n&&!o||v(e.proxy,this.ctx.initialValues[t],!0)||this.ctx.setFieldValue(t,e.proxy):e.context.model=this.ctx.initialValues[t],this.childrenShouldShowErrors&&(e.formShouldShowErrors=!0)},U.prototype.reduce=function(t,e){return this.registry.forEach((function(r,n){e=t(e,r,n)})),e},U.prototype.dataProps=function(){var t=this;return{proxy:{},registry:this,register:this.register.bind(this),deregister:function(e){return t.remove(e)},childrenShouldShowErrors:!1,errorObservers:[],deps:new Map,preventCleanup:!1}};var z=function(t){this.form=t};function Y(t,e,r,n,o,i,s,a,u,l){"boolean"!=typeof s&&(u=a,a=s,s=!1);var c,h="function"==typeof r?r.options:r;if(t&&t.render&&(h.render=t.render,h.staticRenderFns=t.staticRenderFns,h._compiled=!0,o&&(h.functional=!0)),n&&(h._scopeId=n),i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,u(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},h._ssrRegister=c):e&&(c=s?function(t){e.call(this,l(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),c)if(h.functional){var p=h.render;h.render=function(t,e){return c.call(e),p(t,e)}}else{var d=h.beforeCreate;h.beforeCreate=d?[].concat(d,c):[c]}return r}z.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},z.prototype.values=function(){var t=this;return new Promise((function(e,r){var n=[],o=function t(e){if("object"!=typeof e)return e;var r=Array.isArray(e)?[]:{};for(var n in e)e[n]instanceof C||k(e[n])?r[n]=e[n]:r[n]=t(e[n]);return r}(t.form.proxy),i=function(e){"object"==typeof t.form.proxy[e]&&t.form.proxy[e]instanceof C&&n.push(t.form.proxy[e].upload().then((function(t){var r;return Object.assign(o,((r={})[e]=t,r))})))};for(var s in o)i(s);Promise.all(n).then((function(){return e(o)})).catch((function(t){return r(t)}))}))};var Z={name:"FormulateForm",inheritAttrs:!1,provide:function(){return Object.assign({},W(this,["getGroupValues"]),{observeContext:this.addContextObserver,removeContextObserver:this.removeContextObserver})},model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}},values:{type:[Object,Boolean],default:!1},errors:{type:[Object,Boolean],default:!1},formErrors:{type:Array,default:function(){return[]}},schema:{type:[Array,Boolean],default:!1},keepModelData:{type:[Boolean,String],default:!1},invalidMessage:{type:[Boolean,Function,String],default:!1},debounce:{type:[Boolean,Number],default:!1}},data:function(){return Object.assign({},G(this),{formShouldShowErrors:!1,contextObservers:[],namedErrors:[],namedFieldErrors:{},isLoading:!1,hasFailedSubmit:!1})},computed:Object.assign({},H(),{schemaListeners:function(){var t=this.$listeners;return t.submit,function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(t,["submit"])},pseudoProps:function(){return w(this.$attrs,$.filter((function(t){return/^form/.test(t)})))},attributes:function(){var t=this,e=Object.keys(this.$attrs).filter((function(e){return!E(t.pseudoProps,y(e))})).reduce((function(e,r){var n;return Object.assign({},e,((n={})[r]=t.$attrs[r],n))}),{});return"string"==typeof this.name&&Object.assign(e,{name:this.name}),e},hasErrors:function(){return Object.values(this.registry.errors).some((function(t){return t}))},isValid:function(){return!this.hasErrors},formContext:function(){return{errors:this.mergedFormErrors,pseudoProps:this.pseudoProps,hasErrors:this.hasErrors,value:this.proxy,hasValue:!A(this.proxy),isValid:this.isValid,isLoading:this.isLoading,classes:this.classes}},classes:function(){return this.$formulate.classes(Object.assign({},this.$props,this.pseudoProps,{value:this.proxy,errors:this.mergedFormErrors,hasErrors:this.hasErrors,hasValue:!A(this.proxy),isValid:this.isValid,isLoading:this.isLoading,type:"form",classification:"form",attrs:this.$attrs}))},invalidErrors:function(){if(this.hasFailedSubmit&&this.hasErrors)switch(typeof this.invalidMessage){case"string":return[this.invalidMessage];case"object":return Array.isArray(this.invalidMessage)?this.invalidMessage:[];case"function":var t=this.invalidMessage(this.failingFields);return Array.isArray(t)?t:[t]}return[]},mergedFormErrors:function(){return this.formErrors.concat(this.namedErrors).concat(this.invalidErrors)},mergedFieldErrors:function(){var t={};if(this.errors)for(var e in this.errors)t[e]=x(this.errors[e]);for(var r in this.namedFieldErrors)t[r]=x(this.namedFieldErrors[r]);return t},hasFormErrorObservers:function(){return!!this.errorObservers.filter((function(t){return"form"===t.type})).length},failingFields:function(){var t=this;return Object.keys(this.registry.errors).reduce((function(e,r){var n;return Object.assign({},e,t.registry.errors[r]?((n={})[r]=t.registry.get(r),n):{})}),{})}}),watch:Object.assign({},{mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type})).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0},mergedGroupErrors:{handler:function(t){this.errorObservers.filter((function(t){return"group"===t.type})).forEach((function(e){return e.callback(t[e.field]||{})}))},immediate:!0}},{formulateValue:{handler:function(t){this.isVmodeled&&t&&"object"==typeof t&&this.setValues(t)},deep:!0},mergedFormErrors:function(t){this.errorObservers.filter((function(t){return"form"===t.type})).forEach((function(e){return e.callback(t)}))}}),created:function(){this.$formulate.register(this),this.applyInitialValues(),this.$emit("created",this)},destroyed:function(){this.$formulate.deregister(this)},methods:Object.assign({},q(),{applyErrors:function(t){var e=t.formErrors,r=t.inputErrors;this.namedErrors=e,this.namedFieldErrors=r},addContextObserver:function(t){this.contextObservers.find((function(e){return e===t}))||(this.contextObservers.push(t),t(this.formContext))},removeContextObserver:function(t){this.contextObservers.filter((function(e){return e!==t}))},registerErrorComponent:function(t){this.errorComponents.includes(t)||this.errorComponents.push(t)},formSubmitted:function(){var t=this;if(!this.isLoading){this.isLoading=!0,this.showErrors();var e=new z(this),r=this.$listeners["submit-raw"]||this.$listeners.submitRaw,n="function"==typeof r?r(e):Promise.resolve(e);return(n instanceof Promise?n:Promise.resolve(n)).then((function(t){var r=t instanceof z?t:e;return r.hasValidationErrors().then((function(t){return[r,t]}))})).then((function(e){var r=e[0];return e[1]||"function"!=typeof t.$listeners.submit?t.onFailedValidation():r.values().then((function(e){t.hasFailedSubmit=!1;var r=t.$listeners.submit(e);return(r instanceof Promise?r:Promise.resolve()).then((function(){return e}))}))})).finally((function(){t.isLoading=!1}))}},onFailedValidation:function(){return this.hasFailedSubmit=!0,this.$emit("failed-validation",Object.assign({},this.failingFields)),this.$formulate.failedValidation(this)}})},K=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form",t._b({class:t.classes.form,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},"form",t.attributes,!1),[t.schema?r("FormulateSchema",t._g({attrs:{schema:t.schema}},t.schemaListeners)):t._e(),t._v(" "),t.hasFormErrorObservers?t._e():r("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default",null,null,t.formContext)],2)};K._withStripped=!0;var J=Y({render:K,staticRenderFns:[]},void 0,Z,void 0,!1,void 0,!1,void 0,void 0,void 0),X={context:function(){return rt.call(this,Object.assign({},{addLabel:this.logicalAddLabel,removeLabel:this.logicalRemoveLabel,attributes:this.elementAttributes,blurHandler:et.bind(this),classification:this.classification,component:this.component,debounceDelay:this.debounceDelay,disableErrors:this.disableErrors,errors:this.explicitErrors,formShouldShowErrors:this.formShouldShowErrors,getValidationErrors:this.getValidationErrors.bind(this),groupErrors:this.mergedGroupErrors,hasGivenName:this.hasGivenName,hasValue:this.hasValue,hasLabel:this.label&&"button"!==this.classification,hasValidationErrors:this.hasValidationErrors.bind(this),help:this.help,helpPosition:this.logicalHelpPosition,id:this.id||this.defaultId,ignored:E(this.$options.propsData,"ignored"),isValid:this.isValid,imageBehavior:this.imageBehavior,label:this.label,labelPosition:this.logicalLabelPosition,limit:this.limit===1/0?this.limit:parseInt(this.limit,10),name:this.nameOrFallback,minimum:parseInt(this.minimum,10),performValidation:this.performValidation.bind(this),pseudoProps:this.pseudoProps,preventWindowDrops:this.preventWindowDrops,removePosition:this.mergedRemovePosition,repeatable:this.repeatable,rootEmit:this.$emit.bind(this),rules:this.ruleDetails,setErrors:this.setErrors.bind(this),showValidationErrors:this.showValidationErrors,slotComponents:this.slotComponents,slotProps:this.slotProps,type:this.type,uploadBehavior:this.uploadBehavior,uploadUrl:this.mergedUploadUrl,uploader:this.uploader||this.$formulate.getUploader(),validationErrors:this.validationErrors,value:this.value,visibleValidationErrors:this.visibleValidationErrors,isSubField:this.isSubField,classes:this.classes},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification){var t=this.id||this.elementAttributes.id.replace(/[^0-9]/g,"");return this.type+"_"+t}return!1!==this.name&&("button"!==this.classification||!0!==this.name)&&this.name},hasGivenName:function(){return"boolean"!=typeof this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:Q.call(this,this.options),optionGroups:!!this.optionGroups&&m(this.optionGroups,(function(e,r){return Q.call(t,r)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:Q.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.filteredAttributes);return this.id?t.id=this.id:t.id=this.defaultId,this.hasGivenName&&(t.name=this.name),this.help&&!E(t,"aria-describedby")&&(t["aria-describedby"]=t.id+"-help"),!this.classes.input||Array.isArray(this.classes.input)&&!this.classes.input.length||(t.class=this.classes.input),t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},logicalHelpPosition:function(){if(this.helpPosition)return this.helpPosition;switch(this.classification){case"group":return"before";default:return"after"}},mergedRemovePosition:function(){return"group"===this.type&&(this.removePosition||"before")},mergedUploadUrl:function(){return this.uploadUrl||this.$formulate.getUploadUrl()},mergedGroupErrors:function(){var t=this,e=Object.keys(this.groupErrors).concat(Object.keys(this.localGroupErrors)),r=/^(\d+)\.(.*)$/;return Array.from(new Set(e)).filter((function(t){return r.test(t)})).reduce((function(e,n){var o,i=n.match(r),s=i[1],a=i[2];E(e,s)||(e[s]={});var u=Array.from(new Set(x(t.groupErrors[n]).concat(x(t.localGroupErrors[n]))));return e[s]=Object.assign(e[s],((o={})[a]=u,o)),e}),{})},hasValue:function(){var t=this,e=this.proxy;return"box"===this.classification&&this.isGrouped||"select"===this.classification&&E(this.filteredAttributes,"multiple")?Array.isArray(e)?e.some((function(e){return e===t.value})):this.value===e:!A(e)},visibleValidationErrors:function(){return this.showValidationErrors&&this.validationErrors.length?this.validationErrors:[]},slotComponents:function(){var t=this.$formulate.slotComponent.bind(this.$formulate);return{addMore:t(this.type,"addMore"),buttonContent:t(this.type,"buttonContent"),errors:t(this.type,"errors"),file:t(this.type,"file"),help:t(this.type,"help"),label:t(this.type,"label"),prefix:t(this.type,"prefix"),remove:t(this.type,"remove"),repeatable:t(this.type,"repeatable"),suffix:t(this.type,"suffix"),uploadAreaMask:t(this.type,"uploadAreaMask")}},logicalAddLabel:function(){if("file"===this.classification)return!0===this.addLabel?"+ Add "+g(this.type):this.addLabel;if("boolean"==typeof this.addLabel){var t=this.label||this.name;return"+ "+("string"==typeof t?t+" ":"")+" Add"}return this.addLabel},logicalRemoveLabel:function(){return"boolean"==typeof this.removeLabel?"Remove":this.removeLabel},classes:function(){return this.$formulate.classes(Object.assign({},this.$props,this.pseudoProps,{attrs:this.filteredAttributes,classification:this.classification,hasErrors:this.hasVisibleErrors,hasValue:this.hasValue,helpPosition:this.logicalHelpPosition,isValid:this.isValid,labelPosition:this.logicalLabelPosition,type:this.type,value:this.proxy}))},showValidationErrors:function(){return!(!this.showErrors&&!this.formShouldShowErrors)||(!("file"!==this.classification||"live"!==this.uploadBehavior||!nt.call(this))||this.behavioralErrorVisibility)},slotProps:function(){var t=this.$formulate.slotProps.bind(this.$formulate);return{label:t(this.type,"label",this.typeProps),help:t(this.type,"help",this.typeProps),errors:t(this.type,"errors",this.typeProps),repeatable:t(this.type,"repeatable",this.typeProps),addMore:t(this.type,"addMore",this.typeProps),remove:t(this.type,"remove",this.typeProps),component:t(this.type,"component",this.typeProps)}},pseudoProps:function(){return w(this.localAttributes,$)},isValid:function(){return!this.hasErrors},ruleDetails:function(){return this.parsedValidation.map((function(t){var e=t[1];return{ruleName:t[2],args:e}}))},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedValidationName:function(){var t=this,e=this.$formulate.options.validationNameStrategy||["validationName","name","label","type"];return Array.isArray(e)?this[e.find((function(e){return"string"==typeof t[e]}))]:"function"==typeof e?e.call(this,this):this.type},explicitErrors:function(){return x(this.errors).concat(this.localErrors).concat(x(this.error))},allErrors:function(){return this.explicitErrors.concat(x(this.validationErrors))},hasVisibleErrors:function(){return Array.isArray(this.validationErrors)&&this.validationErrors.length&&this.showValidationErrors||!!this.explicitErrors.length},hasErrors:function(){return!!this.allErrors.length},filteredAttributes:function(){var t=this,e=Object.keys(this.pseudoProps).concat(Object.keys(this.typeProps));return Object.keys(this.localAttributes).reduce((function(r,n){return e.includes(y(n))||(r[n]=t.localAttributes[n]),r}),{})},typeProps:function(){return w(this.localAttributes,this.$formulate.typeProps(this.type))},listeners:function(){var t=this.$listeners;return t.input,function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(t,["input"])}};function Q(t){return t?(Array.isArray(t)?t:Object.keys(t).map((function(e){return{label:t[e],value:e}}))).map(tt.bind(this)):[]}function tt(t){return"number"==typeof t&&(t=String(t)),"string"==typeof t?{label:t,value:t,id:this.elementAttributes.id+"_"+t}:("number"==typeof t.value&&(t.value=String(t.value)),Object.assign({value:"",label:"",id:this.elementAttributes.id+"_"+(t.value||t.label)},t))}function et(){var t=this;"blur"!==this.errorBehavior&&"value"!==this.errorBehavior||(this.behavioralErrorVisibility=!0),this.$nextTick((function(){return t.$emit("blur-context",t.context)}))}function rt(t){var e=this;return Object.defineProperty(t,"model",{get:nt.bind(this),set:function(t){if(!e.mntd||!e.debounceDelay)return ot.call(e,t);e.dSet(ot,[t],e.debounceDelay)},enumerable:!0})}function nt(){var t=this.isVmodeled?"formulateValue":"proxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]||0===this[t]?this[t]:""}function ot(t){var e=!1;v(t,this.proxy,"group"===this.type)||(this.proxy=t,e=!0),!this.context.ignored&&this.context.name&&"function"==typeof this.formulateSetter&&this.formulateSetter(this.context.name,t),e&&this.$emit("input",t)}var it={name:"FormulateInput",inheritAttrs:!1,provide:function(){return{formulateRegisterRule:this.registerRule,formulateRemoveRule:this.removeRule}},inject:{formulateSetter:{default:void 0},formulateFieldValidation:{default:function(){return function(){return{}}}},formulateRegister:{default:void 0},formulateDeregister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}},getGroupValues:{default:void 0},validateDependents:{default:function(){return function(){}}},observeErrors:{default:void 0},removeErrorObserver:{default:void 0},isSubField:{default:function(){return function(){return!1}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},limit:{type:[String,Number],default:1/0,validator:function(t){return 1/0}},minimum:{type:[String,Number],default:0,validator:function(t){return parseInt(t,10)==t}},help:{type:[String,Boolean],default:!1},helpPosition:{type:[String,Boolean],default:!1},isGrouped:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},removePosition:{type:[String,Boolean],default:!1},repeatable:{type:Boolean,default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live","submit","value"].includes(t)}},showErrors:{type:Boolean,default:!1},groupErrors:{type:Object,default:function(){return{}},validator:function(t){var e=/^\d+\./;return!Object.keys(t).some((function(t){return!e.test(t)}))}},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}},checked:{type:[String,Boolean],default:!1},disableErrors:{type:Boolean,default:!1},addLabel:{type:[Boolean,String],default:!0},removeLabel:{type:[Boolean,String],default:!1},keepModelData:{type:[Boolean,String],default:"inherit"},ignored:{type:[Boolean,String],default:!1},debounce:{type:[Boolean,Number],default:!1},preventDeregister:{type:Boolean,default:!1}},data:function(){return{defaultId:this.$formulate.nextId(this),localAttributes:{},localErrors:[],localGroupErrors:{},proxy:this.getInitialValue(),behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve(),ruleRegistry:[],messageRegistry:{},touched:!1,debounceDelay:this.debounce,dSet:function(e,r,n){var o=this;t&&clearTimeout(t),t=setTimeout((function(){return e.call.apply(e,[o].concat(r))}),n)},mntd:!1};var t},computed:Object.assign({},X,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)},parsedValidationRules:function(){var t=this,e={};return Object.keys(this.validationRules).forEach((function(r){e[y(r)]=t.validationRules[r]})),e},parsedValidation:function(){return b(this.validation,this.$formulate.rules(this.parsedValidationRules))},messages:function(){var t=this,e={};return Object.keys(this.validationMessages).forEach((function(r){e[y(r)]=t.validationMessages[r]})),Object.keys(this.messageRegistry).forEach((function(r){e[y(r)]=t.messageRegistry[r]})),e}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},proxy:{handler:function(t,e){this.performValidation(),this.isVmodeled||v(t,e,"group"===this.type)||(this.context.model=t),this.validateDependents(this),!this.touched&&t&&(this.touched=!0)},deep:!0},formulateValue:{handler:function(t,e){this.isVmodeled&&!v(t,e,"group"===this.type)&&(this.context.model=t)},deep:!0},showValidationErrors:{handler:function(t){this.$emit("error-visibility",t)},immediate:!0},validation:{handler:function(){this.performValidation()},deep:!0},touched:function(t){"value"===this.errorBehavior&&t&&(this.behavioralErrorVisibility=t)},debounce:function(t){this.debounceDelay=t}},created:function(){this.applyInitialValue(),this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.applyDefaultValue(),this.disableErrors||"function"!=typeof this.observeErrors||(this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),"group"===this.type&&this.observeErrors({callback:this.setGroupErrors,type:"group",field:this.nameOrFallback})),this.updateLocalAttributes(this.$attrs),this.performValidation(),this.hasValue&&(this.touched=!0)},mounted:function(){this.mntd=!0},beforeDestroy:function(){this.disableErrors||"function"!=typeof this.removeErrorObserver||(this.removeErrorObserver(this.setErrors),"group"===this.type&&this.removeErrorObserver(this.setGroupErrors)),"function"!=typeof this.formulateDeregister||this.preventDeregister||this.formulateDeregister(this.nameOrFallback)},methods:{getInitialValue:function(){var t=this.$formulate.classify(this.type);return"box"===(t="box"===t&&this.options?"group":t)&&this.checked?this.value||!0:E(this.$options.propsData,"value")&&"box"!==t?this.value:E(this.$options.propsData,"formulateValue")?this.formulateValue:"group"===t?Object.defineProperty("group"===this.type?[{}]:[],"__init",{value:!0}):""},applyInitialValue:function(){v(this.context.model,this.proxy)||"box"===this.classification&&!E(this.$options.propsData,"options")||(this.context.model=this.proxy,this.$emit("input",this.proxy))},applyDefaultValue:function(){"select"===this.type&&!this.context.placeholder&&A(this.proxy)&&!this.isVmodeled&&!1===this.value&&this.context.options.length&&(E(this.$attrs,"multiple")?this.context.model=[]:this.context.model=this.context.options[0].value)},updateLocalAttributes:function(t){v(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=b(this.validation,this.$formulate.rules(this.parsedValidationRules));return e=this.ruleRegistry.length?this.ruleRegistry.concat(e):e,this.pendingValidation=this.runRules(e).then((function(e){return t.didValidate(e)})),this.pendingValidation},runRules:function(t){var e=this,r=function(t){var r=t[0],n=t[1],o=t[2],i=(t[3],r.apply(void 0,[{value:e.context.model,getFormValues:function(){for(var t,r=arguments,n=[],o=arguments.length;o--;)n[o]=r[o];return(t=e).getFormValues.apply(t,[e].concat(n))},getGroupValues:function(){for(var t,r=arguments,n=[],o=arguments.length;o--;)n[o]=r[o];return(t=e)["get"+(e.getGroupValues?"Group":"Form")+"Values"].apply(t,[e].concat(n))},name:e.context.name}].concat(n)));return(i=i instanceof Promise?i:Promise.resolve(i)).then((function(t){return!t&&e.getMessage(o,n)}))};return new Promise((function(e){var n=function(t,o){void 0===o&&(o=[]);var i=t.shift();Array.isArray(i)&&i.length?Promise.all(i.map(r)).then((function(t){return t.filter((function(t){return!!t}))})).then((function(r){return(r=Array.isArray(r)?r:[]).length&&i.bail||!t.length?e(o.concat(r).filter((function(t){return!A(t)}))):n(t,o.concat(r))})):e([])};n(function(t){var e=[],r=t.findIndex((function(t){return"bail"===t[2].toLowerCase()})),n=t.findIndex((function(t){return"optional"===t[2].toLowerCase()}));if(n>=0){var o=t.splice(n,1);e.push(Object.defineProperty(o,"bail",{value:!0}))}if(r>=0){var i=t.splice(0,r+1).slice(0,-1);i.length&&e.push(i),t.map((function(t){return e.push(Object.defineProperty([t],"bail",{value:!0}))}))}else e.push(t);return e.reduce((function(t,e){var r=function(t,e){if(void 0===e&&(e=!1),t.length<2)return Object.defineProperty([t],"bail",{value:e});var n=[],o=t.findIndex((function(t){return"^"===t[3]}));if(o>=0){var i=t.splice(0,o);i.length&&n.push.apply(n,r(i,e)),n.push(Object.defineProperty([t.shift()],"bail",{value:!0})),t.length&&n.push.apply(n,r(t,e))}else n.push(t);return n};return t.concat(r(e))}),[])}(t))}))},didValidate:function(t){var e=!v(t,this.validationErrors);if(this.validationErrors=t,e){var r=this.getErrorObject();this.$emit("validation",r),this.formulateFieldValidation&&"function"==typeof this.formulateFieldValidation&&this.formulateFieldValidation(r)}},getMessage:function(t,e){var r=this;return this.getMessageFunc(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues(this),getFormValues:function(){for(var t,e=arguments,n=[],o=arguments.length;o--;)n[o]=e[o];return(t=r).getFormValues.apply(t,[r].concat(n))},getGroupValues:function(){for(var t,e=arguments,n=[],o=arguments.length;o--;)n[o]=e[o];return(t=r)["get"+(r.getGroupValues?"Group":"Form")+"Values"].apply(t,[r].concat(n))}})},getMessageFunc:function(t){var e=this;if("optional"===(t=y(t)))return function(){return[]};if(this.messages&&void 0!==this.messages[t])switch(typeof this.messages[t]){case"function":return this.messages[t];case"string":case"boolean":return function(){return e.messages[t]}}return function(r){return e.$formulate.validationMessage(t,r,e)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))},getValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){return t.pendingValidation.then((function(){return e(t.getErrorObject())}))}))}))},getErrorObject:function(){return{name:this.context.nameOrFallback||this.context.name,errors:this.validationErrors.filter((function(t){return"string"==typeof t})),hasErrors:!!this.validationErrors.length}},setErrors:function(t){this.localErrors=x(t)},setGroupErrors:function(t){this.localGroupErrors=t},registerRule:function(t,e,r,n){void 0===n&&(n=null),this.ruleRegistry.some((function(t){return t[2]===r}))||(this.ruleRegistry.push([t,e,r]),null!==n&&(this.messageRegistry[r]=n))},removeRule:function(t){var e=this.ruleRegistry.findIndex((function(e){return e[2]===t}));e>=0&&(this.ruleRegistry.splice(e,1),delete this.messageRegistry[t])}}},st=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.outer,attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-has-value":t.hasValue,"data-type":t.type}},[r("div",{class:t.context.classes.wrapper},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,t._g(t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.component,!1),t.listeners),[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():r(t.context.slotComponents.errors,t._b({tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}},"component",t.context.slotProps.errors,!1))],null,t.context)],2)};st._withStripped=!0;var at=Y({render:st,staticRenderFns:[]},void 0,it,void 0,!1,void 0,!1,void 0,void 0,void 0),ut={inject:{observeErrors:{default:!1},removeErrorObserver:{default:!1},observeContext:{default:!1},removeContextObserver:{default:!1}},props:{context:{type:Object,default:function(){return{}}},type:{type:String,default:"form"}},data:function(){return{boundSetErrors:this.setErrors.bind(this),boundSetFormContext:this.setFormContext.bind(this),localErrors:[],formContext:{classes:{formErrors:"formulate-form-errors",formError:"formulate-form-error"}}}},computed:{visibleValidationErrors:function(){return Array.isArray(this.context.visibleValidationErrors)?this.context.visibleValidationErrors:[]},errors:function(){return Array.isArray(this.context.errors)?this.context.errors:[]},mergedErrors:function(){return this.errors.concat(this.localErrors)},visibleErrors:function(){return Array.from(new Set(this.mergedErrors.concat(this.visibleValidationErrors))).filter((function(t){return"string"==typeof t}))},outerClass:function(){return"input"===this.type&&this.context.classes?this.context.classes.errors:this.formContext.classes.formErrors},itemClass:function(){return"input"===this.type&&this.context.classes?this.context.classes.error:this.formContext.classes.formError},role:function(){return"form"===this.type?"alert":"status"},ariaLive:function(){return"form"===this.type?"assertive":"polite"},slotComponent:function(){return this.$formulate.slotComponent(null,"errorList")}},created:function(){"form"===this.type&&"function"==typeof this.observeErrors&&(Array.isArray(this.context.errors)||this.observeErrors({callback:this.boundSetErrors,type:"form"}),this.observeContext(this.boundSetFormContext))},destroyed:function(){"form"===this.type&&"function"==typeof this.removeErrorObserver&&(Array.isArray(this.context.errors)||this.removeErrorObserver(this.boundSetErrors),this.removeContextObserver(this.boundSetFormContext))},methods:{setErrors:function(t){this.localErrors=x(t)},setFormContext:function(t){this.formContext=t}}},lt=function(){var t=this.$createElement;return(this._self._c||t)(this.slotComponent,{tag:"component",attrs:{"visible-errors":this.visibleErrors,"item-class":this.itemClass,"outer-class":this.outerClass,role:this.role,"aria-live":this.ariaLive,type:this.type}})};lt._withStripped=!0;var ct=Y({render:lt,staticRenderFns:[]},void 0,ut,void 0,!1,void 0,!1,void 0,void 0,void 0),ht={props:{context:{type:Object,required:!0}}},pt=function(){var t=this.$createElement,e=this._self._c||t;return this.context.help?e("div",{class:this.context.classes.help,attrs:{id:this.context.id+"-help"},domProps:{textContent:this._s(this.context.help)}}):this._e()};pt._withStripped=!0;var dt=Y({render:pt,staticRenderFns:[]},void 0,ht,void 0,!1,void 0,!1,void 0,void 0,void 0),ft={props:{file:{type:Object,required:!0},imagePreview:{type:Boolean,default:!1},context:{type:Object,required:!0}}},mt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.file},[t.imagePreview&&t.file.previewData?r("div",{class:t.context.classes.fileImagePreview},[r("img",{class:t.context.classes.fileImagePreviewImage,attrs:{src:t.file.previewData}})]):t._e(),t._v(" "),r("div",{class:t.context.classes.fileName,attrs:{title:t.file.name},domProps:{textContent:t._s(t.file.name)}}),t._v(" "),!1!==t.file.progress?r("div",{class:t.context.classes.fileProgress,attrs:{"data-just-finished":t.file.justFinished,"data-is-finished":!t.file.justFinished&&t.file.complete}},[r("div",{class:t.context.classes.fileProgressInner,style:{width:t.file.progress+"%"}})]):t._e(),t._v(" "),t.file.complete&&!t.file.justFinished||!1===t.file.progress?r("div",{class:t.context.classes.fileRemove,on:{click:t.file.removeFile}}):t._e()])};mt._withStripped=!0;var vt=Y({render:mt,staticRenderFns:[]},void 0,ft,void 0,!1,void 0,!1,void 0,void 0,void 0),yt={name:"FormulateGrouping",props:{context:{type:Object,required:!0}},provide:function(){return{isSubField:function(){return!0},registerProvider:this.registerProvider,deregisterProvider:this.deregisterProvider}},data:function(){return{providers:[],keys:[]}},inject:["formulateRegisterRule","formulateRemoveRule"],computed:{items:function(){var t=this;return Array.isArray(this.context.model)?this.context.repeatable||0!==this.context.model.length?this.context.model.length=this.context.minimum&&!this.context.model.__init?this.context.model.splice(t,1,this.setId(e,t)):this.context.model=this.items.map((function(n,o){return o===t?r.setId(e,t):n}))},removeItem:function(t){var e=this;Array.isArray(this.context.model)&&this.context.model.length>this.context.minimum?(this.context.model=this.context.model.filter((function(e,r){return r!==t&&e})),this.context.rootEmit("repeatableRemoved",this.context.model)):!Array.isArray(this.context.model)&&this.items.length>this.context.minimum&&(this.context.model=new Array(this.items.length-1).fill("").map((function(t,r){return e.setId({},r)})),this.context.rootEmit("repeatableRemoved",this.context.model))},registerProvider:function(t){this.providers.some((function(e){return e===t}))||this.providers.push(t)},deregisterProvider:function(t){this.providers=this.providers.filter((function(e){return e!==t}))},setId:function(t,e){return t.__id?t:F(t,this.keys[e])}}},gt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{class:t.context.classes.grouping,attrs:{name:"grouping",context:t.context,"force-wrap":t.context.repeatable}},t._l(t.items,(function(e,n){return r("FormulateRepeatableProvider",{key:e.__id,attrs:{index:n,context:t.context,uuid:e.__id,errors:t.groupErrors[n]},on:{remove:t.removeItem,input:function(e){return t.setItem(n,e)}}},[t._t("default")],2)})),1)};gt._withStripped=!0;var xt=Y({render:gt,staticRenderFns:[]},void 0,yt,void 0,!1,void 0,!1,void 0,void 0,void 0),bt={props:{context:{type:Object,required:!0}}},_t=function(){var t=this.$createElement;return(this._self._c||t)("label",{class:this.context.classes.label,attrs:{id:this.context.id+"_label",for:this.context.id},domProps:{textContent:this._s(this.context.label)}})};_t._withStripped=!0;var kt=Y({render:_t,staticRenderFns:[]},void 0,bt,void 0,!1,void 0,!1,void 0,void 0,void 0),Et={props:{context:{type:Object,required:!0},addMore:{type:Function,required:!0}}},Ft=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{class:this.context.classes.groupAddMore},[e("FormulateInput",{attrs:{type:"button",label:this.context.addLabel,"data-minor":"","data-ghost":""},on:{click:this.addMore}})],1)};Ft._withStripped=!0;var At=Y({render:Ft,staticRenderFns:[]},void 0,Et,void 0,!1,void 0,!1,void 0,void 0,void 0),wt={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},attributes:function(){return this.context.attributes||{}},hasValue:function(){return this.context.hasValue}}},Ct={name:"FormulateInputBox",mixins:[wt],computed:{usesDecorator:function(){return this.$formulate.options.useInputDecorators}}},Pt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type}},[r("FormulateSlot",{attrs:{name:"prefix",context:t.context}},[t.context.slotComponents.prefix?r(t.context.slotComponents.prefix,{tag:"component",attrs:{context:t.context}}):t._e()],1),t._v(" "),"radio"===t.type?r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1),t.$listeners)):r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,o=!!n.checked;if(Array.isArray(r)){var i=t.context.value,s=t._i(r,i);n.checked?s<0&&t.$set(t.context,"model",r.concat([i])):s>-1&&t.$set(t.context,"model",r.slice(0,s).concat(r.slice(s+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1),t.$listeners)),t._v(" "),t.usesDecorator?r("label",{tag:"component",class:t.context.classes.decorator,attrs:{for:t.attributes.id}}):t._e(),t._v(" "),r("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?r(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};Pt._withStripped=!0;var St=Y({render:Pt,staticRenderFns:[]},void 0,Ct,void 0,!1,void 0,!1,void 0,void 0,void 0),Ot={props:{visibleErrors:{type:Array,required:!0},itemClass:{type:[String,Array,Object,Boolean],default:!1},outerClass:{type:[String,Array,Object,Boolean],default:!1},role:{type:[String],default:"status"},ariaLive:{type:[String,Boolean],default:"polite"},type:{type:String,required:!0}}},Vt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.visibleErrors.length?r("ul",{class:t.outerClass},t._l(t.visibleErrors,(function(e){return r("li",{key:e,class:t.itemClass,attrs:{role:t.role,"aria-live":t.ariaLive},domProps:{textContent:t._s(e)}})})),0):t._e()};Vt._withStripped=!0;var jt=Y({render:Vt,staticRenderFns:[]},void 0,Ot,void 0,!1,void 0,!1,void 0,void 0,void 0),Dt={name:"FormulateInputText",mixins:[wt]},$t=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type}},[r("FormulateSlot",{attrs:{name:"prefix",context:t.context}},[t.context.slotComponents.prefix?r(t.context.slotComponents.prefix,{tag:"component",attrs:{context:t.context}}):t._e()],1),t._v(" "),"checkbox"===t.type?r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,o=!!n.checked;if(Array.isArray(r)){var i=t._i(r,null);n.checked?i<0&&t.$set(t.context,"model",r.concat([null])):i>-1&&t.$set(t.context,"model",r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1),t.$listeners)):"radio"===t.type?r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1),t.$listeners)):r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1),t.$listeners)),t._v(" "),r("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?r(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};$t._withStripped=!0;var Bt=Y({render:$t,staticRenderFns:[]},void 0,Dt,void 0,!1,void 0,!1,void 0,void 0,void 0),It={name:"FormulateFiles",props:{files:{type:C,required:!0},imagePreview:{type:Boolean,default:!1},context:{type:Object,required:!0}},computed:{fileUploads:function(){return this.files.files||[]},isMultiple:function(){return E(this.context.attributes,"multiple")}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()},methods:{appendFiles:function(){var t=this.$refs.addFiles;t.files.length&&this.files.mergeFileList(t)}}},Rt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.fileUploads.length?r("ul",{class:t.context.classes.files},[t._l(t.fileUploads,(function(e){return r("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":!(!t.imagePreview||!e.previewData)}},[r("FormulateSlot",{attrs:{name:"file",context:t.context,file:e,"image-preview":t.imagePreview}},[r(t.context.slotComponents.file,{tag:"component",attrs:{context:t.context,file:e,"image-preview":t.imagePreview}})],1),t._v(" "),e.error?r("div",{class:t.context.classes.fileUploadError,domProps:{textContent:t._s(e.error)}}):t._e()],1)})),t._v(" "),t.isMultiple&&t.context.addLabel?r("div",{class:t.context.classes.fileAdd,attrs:{role:"button"}},[t._v("\n "+t._s(t.context.addLabel)+"\n "),r("input",{ref:"addFiles",class:t.context.classes.fileAddInput,attrs:{type:"file",multiple:""},on:{change:t.appendFiles}})]):t._e()],2):t._e()};Rt._withStripped=!0;var Mt={name:"FormulateInputFile",components:{FormulateFiles:Y({render:Rt,staticRenderFns:[]},void 0,It,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[wt],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof C&&this.context.model.files.length)}},created:function(){Array.isArray(this.context.model)&&"string"==typeof this.context.model[0][this.$formulate.getFileUrlKey()]&&(this.context.model=this.$formulate.createUpload({files:this.context.model},this.context))},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){var t=this;this.isOver=!1;var e=this.$refs.file;e.files.length&&(this.context.model=this.$formulate.createUpload(e,this.context),this.$nextTick((function(){return t.attemptImmediateUpload()})))},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof C&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},Lt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[r("FormulateSlot",{attrs:{name:"prefix",context:t.context}},[t.context.slotComponents.prefix?r(t.context.slotComponents.prefix,{tag:"component",attrs:{context:t.context}}):t._e()],1),t._v(" "),r("div",{class:t.context.classes.uploadArea,attrs:{"data-has-files":t.hasFiles}},[r("input",t._g(t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1),t.$listeners)),t._v(" "),r("FormulateSlot",{attrs:{name:"uploadAreaMask",context:t.context,"has-files":t.hasFiles}},[r(t.context.slotComponents.uploadAreaMask,{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],tag:"component",class:t.context.classes.uploadAreaMask,attrs:{"has-files":"div"!==t.context.slotComponents.uploadAreaMask&&t.hasFiles,"data-has-files":"div"===t.context.slotComponents.uploadAreaMask&&t.hasFiles}})],1),t._v(" "),t.hasFiles?r("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior,context:t.context}}):t._e()],1),t._v(" "),r("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?r(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};Lt._withStripped=!0;var Nt=Y({render:Lt,staticRenderFns:[]},void 0,Mt,void 0,!1,void 0,!1,void 0,void 0,void 0),Tt={props:{context:{type:Object,required:!0},removeItem:{type:Function,required:!0},index:{type:Number,required:!0}}},Ut=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.groupRepeatable},["after"===t.context.removePosition?t._t("default"):t._e(),t._v(" "),r("FormulateSlot",{attrs:{name:"remove",context:t.context,index:t.index,"remove-item":t.removeItem}},[r(t.context.slotComponents.remove,t._b({tag:"component",attrs:{context:t.context,index:t.index,"remove-item":t.removeItem}},"component",t.context.slotProps.remove,!1))],1),t._v(" "),"before"===t.context.removePosition?t._t("default"):t._e()],2)};Ut._withStripped=!0;var Gt=Y({render:Ut,staticRenderFns:[]},void 0,Tt,void 0,!1,void 0,!1,void 0,void 0,void 0);function Ht(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}var qt={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},subType:function(){return"group"===this.context.type?"grouping":"inputs"},optionsWithContext:function(){var t=this,e=this.context,r=e.attributes,n=(r.id,Ht(r,["id"])),o=(e.blurHandler,e.classification,e.component,e.getValidationErrors,e.hasLabel,e.hasValidationErrors,e.isSubField,e.isValid,e.labelPosition,e.options,e.performValidation,e.setErrors,e.slotComponents,e.slotProps,e.validationErrors,e.visibleValidationErrors,e.classes,e.showValidationErrors,e.rootEmit,e.help,e.pseudoProps,e.rules,e.model,Ht(e,["attributes","blurHandler","classification","component","getValidationErrors","hasLabel","hasValidationErrors","isSubField","isValid","labelPosition","options","performValidation","setErrors","slotComponents","slotProps","validationErrors","visibleValidationErrors","classes","showValidationErrors","rootEmit","help","pseudoProps","rules","model"]));return this.options.map((function(e){return t.groupItemContext(o,e,n)}))},totalItems:function(){return Array.isArray(this.context.model)&&this.context.model.length>this.context.minimum?this.context.model.length:this.context.minimum||1},canAddMore:function(){return this.context.repeatable&&this.totalItems-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,o=!!n.checked;if(Array.isArray(r)){var i=t._i(r,null);n.checked?i<0&&t.$set(t.context,"model",r.concat([null])):i>-1&&t.$set(t.context,"model",r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1),t.$listeners)):"radio"===t.type?r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1),t.$listeners)):r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1),t.$listeners)),t._v(" "),t.context.showValue?r("div",{class:t.context.classes.rangeValue,domProps:{textContent:t._s(t.context.model)}}):t._e(),t._v(" "),r("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?r(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};ee._withStripped=!0;var re=Y({render:ee,staticRenderFns:[]},void 0,te,void 0,!1,void 0,!1,void 0,void 0,void 0),ne={props:{context:{type:Object,required:!0}}},oe=function(){var t=this.$createElement;return(this._self._c||t)("span",{class:"formulate-input-element--"+this.context.type+"--label",domProps:{textContent:this._s(this.context.value||this.context.label||this.context.name||"Submit")}})};oe._withStripped=!0;var ie=Y({render:oe,staticRenderFns:[]},void 0,ne,void 0,!1,void 0,!1,void 0,void 0,void 0),se={name:"FormulateInputTextArea",mixins:[wt]},ae=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.element,attrs:{"data-type":"textarea"}},[r("FormulateSlot",{attrs:{name:"prefix",context:t.context}},[t.context.slotComponents.prefix?r(t.context.slotComponents.prefix,{tag:"component",attrs:{context:t.context}}):t._e()],1),t._v(" "),r("textarea",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1),t.$listeners)),t._v(" "),r("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?r(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};ae._withStripped=!0;var ue=Y({render:ae,staticRenderFns:[]},void 0,se,void 0,!1,void 0,!1,void 0,void 0,void 0),le={provide:function(){var t=this;return Object.assign({},W(this,["getFormValues"]),{formulateSetter:function(e,r){return t.setGroupValue(e,r)}})},inject:{registerProvider:"registerProvider",deregisterProvider:"deregisterProvider"},props:{index:{type:Number,required:!0},context:{type:Object,required:!0},uuid:{type:String,required:!0},errors:{type:Object,required:!0}},data:function(){return Object.assign({},G(this),{isGrouping:!0})},computed:Object.assign({},H(),{mergedFieldErrors:function(){return this.errors}}),watch:Object.assign({},{mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type})).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0},mergedGroupErrors:{handler:function(t){this.errorObservers.filter((function(t){return"group"===t.type})).forEach((function(e){return e.callback(t[e.field]||{})}))},immediate:!0}},{"context.model":{handler:function(t){v(t[this.index],this.proxy,!0)||this.setValues(t[this.index])},deep:!0}}),created:function(){this.applyInitialValues(),this.registerProvider(this)},beforeDestroy:function(){this.preventCleanup=!0,this.deregisterProvider(this)},methods:Object.assign({},q(),{setGroupValue:function(t,e){v(this.proxy[t],e,!0)||this.setFieldValue(t,e)},removeItem:function(){this.$emit("remove",this.index)}})},ce=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{attrs:{name:"repeatable",context:t.context,index:t.index,"remove-item":t.removeItem}},[r(t.context.slotComponents.repeatable,t._b({tag:"component",attrs:{context:t.context,index:t.index,"remove-item":t.removeItem}},"component",t.context.slotProps.repeatable,!1),[r("FormulateSlot",{attrs:{context:t.context,index:t.index,name:"default"}})],1)],1)};ce._withStripped=!0;var he=Y({render:ce,staticRenderFns:[]},void 0,le,void 0,!1,void 0,!1,void 0,void 0,void 0),pe={props:{index:{type:Number,default:null},context:{type:Object,required:!0},removeItem:{type:Function,required:!0}}},de=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.context.repeatable?r("a",{class:t.context.classes.groupRepeatableRemove,attrs:{"data-disabled":t.context.model.length<=t.context.minimum,role:"button"},domProps:{textContent:t._s(t.context.removeLabel)},on:{click:function(e){return e.preventDefault(),t.removeItem(e)},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.removeItem(e)}}}):t._e()};de._withStripped=!0;var fe=Y({render:de,staticRenderFns:[]},void 0,pe,void 0,!1,void 0,!1,void 0,void 0,void 0),me=function(){this.options={},this.defaults={components:{FormulateSlot:L,FormulateForm:J,FormulateFile:vt,FormulateHelp:dt,FormulateLabel:kt,FormulateInput:at,FormulateErrors:ct,FormulateSchema:N,FormulateAddMore:At,FormulateGrouping:xt,FormulateInputBox:St,FormulateInputText:Bt,FormulateInputFile:Nt,FormulateErrorList:jt,FormulateRepeatable:Gt,FormulateInputGroup:zt,FormulateInputButton:Kt,FormulateInputSelect:Qt,FormulateInputSlider:re,FormulateButtonContent:ie,FormulateInputTextArea:ue,FormulateRepeatableRemove:fe,FormulateRepeatableProvider:he},slotComponents:{addMore:"FormulateAddMore",buttonContent:"FormulateButtonContent",errorList:"FormulateErrorList",errors:"FormulateErrors",file:"FormulateFile",help:"FormulateHelp",label:"FormulateLabel",prefix:!1,remove:"FormulateRepeatableRemove",repeatable:"FormulateRepeatable",suffix:!1,uploadAreaMask:"div"},slotProps:{},library:f,rules:S,mimes:V,locale:!1,uploader:R,uploadUrl:!1,fileUrlKey:"url",uploadJustCompleteDuration:1e3,errorHandler:function(t){return t},plugins:[p],locales:{},failedValidation:function(){return!1},idPrefix:"formulate-",baseClasses:function(t){return t},coreClasses:I,classes:{},useInputDecorators:!0,validationNameStrategy:!1},this.registry=new Map,this.idRegistry={}};me.prototype.install=function(t,e){var r=this;t.prototype.$formulate=this,this.options=this.defaults;var n=this.defaults.plugins;for(var o in e&&Array.isArray(e.plugins)&&e.plugins.length&&(n=n.concat(e.plugins)),n.forEach((function(t){return"function"==typeof t?t(r):null})),this.extend(e||{}),this.options.components)t.component(o,this.options.components[o])},me.prototype.nextId=function(t){var e=t.$route&&t.$route.path&&t.$route.path?t.$route.path.replace(/[/\\.\s]/g,"-"):"global";return Object.prototype.hasOwnProperty.call(this.idRegistry,e)||(this.idRegistry[e]=0),""+this.options.idPrefix+e+"-"+ ++this.idRegistry[e]},me.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge(this.options,t),this;throw new Error("Formulate.extend expects an object, was "+typeof t)},me.prototype.merge=function(t,e,r){void 0===r&&(r=!0);var n={};for(var o in t)e.hasOwnProperty(o)?l(e[o])&&l(t[o])?n[o]=this.merge(t[o],e[o],r):r&&Array.isArray(t[o])&&Array.isArray(e[o])?n[o]=t[o].concat(e[o]):n[o]=e[o]:n[o]=t[o];for(var i in e)n.hasOwnProperty(i)||(n[i]=e[i]);return n},me.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},me.prototype.classes=function(t){var e=this,r=this.options.coreClasses(t),n=this.options.baseClasses(r,t);return Object.keys(n).reduce((function(r,o){var i,s=B(n[o],e.options.classes[o],t);return s=function(t,e,r,n){return Object.keys(D).reduce((function(e,o){if(D[o](n)){var i=""+t+g(o),s=i+"Class";r[i]&&(e=B(e,"string"==typeof r[i]?x(r[i]):r[i],n)),n[s]&&(e=B(e,"string"==typeof n[s]?x(n[s]):n[i+"Class"],n))}return e}),e)}(o,s=B(s,t[o+"Class"],t),e.options.classes,t),Object.assign(r,((i={})[o]=s,i))}),{})},me.prototype.typeProps=function(t){var e=function(t){return Object.keys(t).reduce((function(e,r){return Array.isArray(t[r])?e.concat(t[r]):e}),[])},r=e(this.options.slotProps);return this.options.library[t]?r.concat(e(this.options.library[t].slotProps||{})):r},me.prototype.slotProps=function(t,e,r){var n=Array.isArray(this.options.slotProps[e])?this.options.slotProps[e]:[],o=this.options.library[t];return o&&o.slotProps&&Array.isArray(o.slotProps[e])&&(n=n.concat(o.slotProps[e])),n.reduce((function(t,e){var n;return Object.assign(t,((n={})[e]=r[e],n))}),{})},me.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},me.prototype.slotComponent=function(t,e){var r=this.options.library[t];return r&&r.slotComponents&&r.slotComponents[e]?r.slotComponents[e]:this.options.slotComponents[e]},me.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},me.prototype.i18n=function(t){if(t.$i18n)switch(typeof t.$i18n.locale){case"string":return t.$i18n.locale;case"function":return t.$i18n.locale()}return!1},me.prototype.getLocale=function(t){var e=this;return this.selectedLocale||(this.selectedLocale=[this.options.locale,this.i18n(t),"en"].reduce((function(t,r){if(t)return t;if(r){var n=function(t){return t.split("-").reduce((function(t,e){return t.length&&t.unshift(t[0]+"-"+e),t.length?t:[e]}),[])}(r).find((function(t){return E(e.options.locales,t)}));n&&(t=n)}return t}),!1)),this.selectedLocale},me.prototype.setLocale=function(t){E(this.options.locales,t)&&(this.options.locale=t,this.selectedLocale=t,this.registry.forEach((function(t,e){t.hasValidationErrors()})))},me.prototype.validationMessage=function(t,e,r){var n=this.options.locales[this.getLocale(r)];return n.hasOwnProperty(t)?n[t](e):n.hasOwnProperty("default")?n.default(e):"Invalid field value"},me.prototype.register=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.set(t.name,t)},me.prototype.deregister=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.has(t.name)&&this.registry.delete(t.name)},me.prototype.handle=function(t,e,r){void 0===r&&(r=!1);var n=r?t:this.options.errorHandler(t,e);return e&&this.registry.has(e)&&this.registry.get(e).applyErrors({formErrors:x(n.formErrors),inputErrors:n.inputErrors||{}}),n},me.prototype.reset=function(t,e){void 0===e&&(e={}),this.resetValidation(t),this.setValues(t,e)},me.prototype.submit=function(t){this.registry.get(t).formSubmitted()},me.prototype.resetValidation=function(t){var e=this.registry.get(t);e.hideErrors(t),e.namedErrors=[],e.namedFieldErrors={}},me.prototype.setValues=function(t,e){e&&!Array.isArray(e)&&"object"==typeof e&&this.registry.get(t).setValues(Object.assign({},e))},me.prototype.getUploader=function(){return this.options.uploader||!1},me.prototype.getUploadUrl=function(){return this.options.uploadUrl||!1},me.prototype.getFileUrlKey=function(){return this.options.fileUrlKey||"url"},me.prototype.createUpload=function(t,e){return new C(t,e,this.options)},me.prototype.failedValidation=function(t){return this.options.failedValidation(this)};var ve=new me,ye=function(t){return void 0===t&&(t=[]),this.defaultHook=function(t){return t},this.setHooks(t)};ye.prototype.parse=function(t){void 0===t&&(t=[]);var e=Array.isArray(t)?t:[];for(var r of e)this.isProperHook(r)&&this.hooks.push(r);return this},ye.prototype.addHook=function(t){return this.isProperHook(t)&&this.isNewHook(t)&&this.hooks.push(t),this},ye.prototype.setHooks=function(t){return void 0===t&&(t=[]),this.hooks=t.filter(this.isProperHook),this},ye.prototype.setDefault=function(t){return this.defaultHook=t,this},ye.prototype.isProperHook=function(t){return t&&"object"==typeof t&&"function"==typeof t.handler},ye.prototype.isNewHook=function(t){return this.hooks.findIndex((function(e){return e===t}))<0},ye.prototype.getHooks=function(){return this.hooks},ye.prototype.empty=function(){return 0===this.hooks.length},ye.prototype.apply=function(t,e){return this.empty()?this.defaultHook(t,e):this.hooks.reduce((function(t,r){return r.handler(t,e)}),t)},ye.prototype.asSingleHook=function(){var t=this;return{handler:function(e,r){return t.apply(e,r)}}};var ge={type:Object,default:function(){return{model:[],schema:[],schemaOptions:[],schemaNode:[],schemaComponent:[]}}};var xe=ve.defaults.components.FormulateInput,be=xe.props,_e=(xe.created,xe.watch),ke=xe.computed,Ee=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(xe,["props","created","watch","computed"]);function Fe(t,e,r,n,o,i,s,a,u,l){"boolean"!=typeof s&&(u=a,a=s,s=!1);var c,h="function"==typeof r?r.options:r;if(t&&t.render&&(h.render=t.render,h.staticRenderFns=t.staticRenderFns,h._compiled=!0,o&&(h.functional=!0)),n&&(h._scopeId=n),i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,u(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},h._ssrRegister=c):e&&(c=s?function(t){e.call(this,l(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),c)if(h.functional){var p=h.render;h.render=function(t,e){return c.call(e),p(t,e)}}else{var d=h.beforeCreate;h.beforeCreate=d?[].concat(d,c):[c]}return r}var Ae=Object.assign({},Ee,{props:Object.assign({},be,{modelHook:{type:[Function,Object,Array],default:null},standalone:{type:Boolean,default:function(){return!1}}}),created:function(){this.applyInitialValue(),!this.standalone&&this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.applyDefaultValue(),this.disableErrors||"function"!=typeof this.observeErrors||this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),this.updateLocalAttributes(this.$attrs),this.performValidation()},computed:Object.assign({},ke,{slotProps:function(){var t=this.$formulate.slotProps.bind(this.$formulate);return{label:t(this.type,"label",this.typeProps),help:t(this.type,"help",this.typeProps),errors:t(this.type,"errors",this.typeProps),repeatable:t(this.type,"repeatable",this.typeProps),addMore:t(this.type,"addMore",this.typeProps),remove:t(this.type,"remove",this.typeProps),component:t(this.type,"component",this.typeProps)}}}),watch:Object.assign({},_e,{"context.model":{handler:function(t,e){var r=new ye;Array.isArray(this.modelHook)?this.modelHook.map((function(t){return r.addHook(t)})):"function"==typeof this.modelHook?r.addHook({handler:this.modelHook}):r.addHook(this.modelHook),(this.$formulate.options.hooks&&this.$formulate.options.hooks.model?this.$formulate.options.hooks.model:[]).map((function(t){return r.addHook(t)}));var n=t;"box"===this.context.classification&&"string"==typeof t&&0===t.length&&(n=!1),t!==e&&r.hooks.length>0&&(this.context.model=r.apply(n,{oldModel:e,context:this.context}))}}})}),we=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.outer,attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-has-value":t.hasValue,"data-type":t.type},on:{click:function(e){return t.$emit("outer-click")}}},[r("div",{class:t.context.classes.wrapper,on:{click:function(e){return t.$emit("wrapper-click")}}},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,t._g(t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.component,!1),t.listeners),[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():r(t.context.slotComponents.errors,t._b({tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}},"component",t.context.slotProps.errors,!1))],null,t.context)],2)};we._withStripped=!0;var Ce=Fe({render:we,staticRenderFns:[]},void 0,Ae,void 0,!1,void 0,!1,void 0,void 0,void 0);function Pe(t,e,r){void 0===r&&(r={});var n=r.hooks,o=r.h,i=r.state;if(t&&"object"==typeof t&&!Array.isArray(t)){var s=t.children;void 0===s&&(s=null);var a=t.component;void 0===a&&(a=Ce);var u=t.depth;void 0===u&&(u=1);var l=t.modelHook,c=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(t,["children","component","depth","modelHook"]),h=a===Ce?c.type||"text":"",p=c.name||h||"el",d=c.id||p+"-"+u+"-"+e,f=Array.isArray(s)?s.map((function(t){return Object.assign(t,{depth:u+1})})):s,m=(new ye).setHooks(n.model).addHook(l).asSingleHook(),v=Object.assign({name:p,type:h,key:d,depth:u,component:a,definition:{attrs:Object.assign({},c,{modelHook:m})},children:Se(f,{hooks:n,h:o,state:i})});return(new ye).setHooks(n.schemaNode).setDefault((function(){return v})).apply(v,{state:i})}return null}function Se(t,e){void 0===e&&(e={});var r=e.hooks,n=e.h,o=e.state;return Array.isArray(t)?t.map((function(t,e){var i=Pe(t,e,{hooks:r,h:n,state:o});return(new ye).setHooks(r.schemaComponent).setDefault((function(){return n(i.component,i.definition,i.children)})).apply(i)})):t}var Oe={functional:!1,name:"FormulateSchema",props:{schema:ve.defaults.components.FormulateForm.props.schema,hooks:ge,formClass:{type:String,default:null}},data:function(){return{schemaHooks:null,schemaOptionsHooks:null}},methods:{emit:function(t,e){this.$emit(t,e)}},beforeMount:function(){this.schemaHooks=(new ye).setHooks(this.hooks.schema),this.schemaOptionsHooks=(new ye).setHooks(this.hooks.schemaOptions).setDefault((function(t){return t}))},render:function(t){return this.schemaHooks.apply(t("div",{class:this.$props.formClass},Se(this.schema,this.schemaOptionsHooks.apply({hooks:this.hooks,h:t,state:{}},{emit:this.emit,props:this.$props}))),{emit:this.emit,props:this.$props})}},Ve=function(t,e,r){void 0===r&&(r={}),this.input=t,this.fileList=t.files,this.files=[],this.options=Object.assign({},{mimes:{}},r),this.results=!1,this.context=e,this.dataTransferCheck(),e&&e.uploadUrl&&(this.options.uploadUrl=e.uploadUrl),this.uploadPromise=null,Array.isArray(this.fileList)?this.rehydrateFileList(this.fileList):this.addFileList(this.fileList)};function je(t,e){var r={};for(var n in t)r[n]=e(n,t[n]);return r}function De(t,e,r){if(void 0===r&&(r=!1),t===e)return!0;if(!t||!e)return!1;if("object"!=typeof t&&"object"!=typeof e)return t===e;var n=Object.keys(t),o=Object.keys(e),i=n.length;if(o.length!==i)return!1;for(var s=0;s=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0,t.context.rootEmit("file-upload-complete",e))}),(function(n){e.progress=0,e.error=n,e.complete=!0,t.context.rootEmit("file-upload-error",n),r(n)}),t.options)}))).then((function(r){t.results=t.mapUUID(r),e(r)})).catch((function(t){throw new Error(t)}))}))},Ve.prototype.removeFile=function(t){var e=this.files.length;if(this.files=this.files.filter((function(e){return e&&e.uuid!==t})),Array.isArray(this.results)&&(this.results=this.results.filter((function(e){return e&&e.__id!==t}))),this.context.performValidation(),window&&this.fileList instanceof FileList&&this.supportsDataTransfers){var r=new DataTransfer;this.files.forEach((function(t){return r.items.add(t.file)})),this.fileList=r.files,this.input.files=this.fileList}else this.fileList=this.fileList.filter((function(e){return e&&e.__id!==t}));e>this.files.length&&this.context.rootEmit("file-removed",this.files)},Ve.prototype.mergeFileList=function(t){if(this.addFileList(t.files),this.supportsDataTransfers){var e=new DataTransfer;this.files.forEach((function(t){t.file instanceof File&&e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList,t.files=(new DataTransfer).files}this.context.performValidation(),this.loadPreviews(),"delayed"!==this.context.uploadBehavior&&this.upload()},Ve.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},Ve.prototype.dataTransferCheck=function(){try{new DataTransfer,this.supportsDataTransfers=!0}catch(t){this.supportsDataTransfers=!1}},Ve.prototype.getFiles=function(){return this.files},Ve.prototype.mapUUID=function(t){var e=this;return t.map((function(t,r){return e.files[r].path=void 0!==t&&t,t&&Te(t,e.files[r].uuid)}))},Ve.prototype.toString=function(){var t=this.files.length?this.files.length+" files":"empty";return this.results?JSON.stringify(this.results,null," "):"FileUpload("+t+")"};var He={extends:ve.defaults.components.FormulateForm,components:{FormulateSchema:Oe},props:{hooks:ge,formClass:{type:String,default:null}},computed:{cleanedHooks:function(){var t=this,e=ge.default();return Object.keys(e).forEach((function(r){e[r]=(new ye).parse(t.hooks[r]).getHooks()})),ve.merge(this.$formulate.options.hooks||{},e)}},watch:{formulateValue:{handler:function(t){var e=this;this.isVmodeled&&t&&"object"==typeof t&&Array.from(new Set(Object.keys(t).concat(Object.keys(this.proxy)))).forEach((function(r){De(t[r],e.proxy[r])||(e.setFieldValue(r,t[r]),e.registry.has(r)&&!De(t[r],e.registry.get(r).proxy)&&(e.registry.get(r).context.model=t[r]))}))},deep:!0}}},qe=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.schema?r("FormulateSchema",{attrs:{schema:t.schema,hooks:t.cleanedHooks,formClass:t.formClass},on:{events:function(e){return t.$emit("events",e)}}}):t._e(),t._v(" "),t.hasFormErrorObservers?t._e():r("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default")],2)};qe._withStripped=!0;var We=Fe({render:qe,staticRenderFns:[]},void 0,He,void 0,!1,void 0,!1,void 0,void 0,void 0),ze=function(){this.store=new Map};ze.prototype.on=function(t,e){var r=this.store.get(t);r&&r.push(e)||this.store.set(t,[e])},ze.prototype.off=function(t,e){var r=this.store.get(t),n=r.indexOf(e);r&&n>-1&&r.splice(n,1)},ze.prototype.emit=function(t,e){this.store.get(t).slice().map((function(t){return t(e)}))};var Ye={hooks:{schemaOptions:[{handler:function(t,e){void 0===e&&(e={});var r=e.emit;return t.state=t.state||{},t.state.eventBus=new ze,t.state.eventBus.on("events",(function(t){return r("events",t)})),t}}],schemaNode:[{handler:function(t,e){void 0===e&&(e={});var r=e.state,n=t.definition.attrs,o=n.events;void 0===o&&(o=[]);var i=n.on;void 0===i&&(i={});var s=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(n,["events","on"]);return t.definition.attrs=s,t.definition.on=Object.assign({},i,o.reduce((function(e,n){return e[n]=function(e){i[n]&&i[n](e),r.eventBus.emit("events",{eventName:n,name:t.name,type:t.type,key:t.key,payload:e})},e}),{})),t}}]}};function Ze(t){return(Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ke(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Je(t,e){for(var r=0;r=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function nr(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function or(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=tr(t);if(e){var o=tr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return nr(this,r)}}function ir(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=tr(t)););return t}function sr(t,e,r){return(sr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=ir(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function ar(t,e,r,n){return(ar="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,r,n){var o,i=ir(t,e);if(i){if((o=Object.getOwnPropertyDescriptor(i,e)).set)return o.set.call(n,r),!0;if(!o.writable)return!1}if(o=Object.getOwnPropertyDescriptor(n,e)){if(!o.writable)return!1;o.value=r,Object.defineProperty(n,e,o)}else!function(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(n,e,r);return!0})(t,e,r,n)}function ur(t,e,r,n,o){if(!ar(t,e,r,n||t)&&o)throw new Error("failed to set property");return r}function lr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return cr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cr(t,e)}(t,e)||function(){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 cr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;Ke(this,t),this.value=e,this.from=r,this.stop=n}return Xe(t,[{key:"toString",value:function(){return this.value}},{key:"extend",value:function(t){this.value+=String(t)}},{key:"appendTo",value:function(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}},{key:"state",get:function(){return{value:this.value,from:this.from,stop:this.stop}},set:function(t){Object.assign(this,t)}},{key:"shiftBefore",value:function(t){if(this.from>=t||!this.value.length)return"";var e=this.value[0];return this.value=this.value.slice(1),e}}]),t}();function kr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new kr.InputMask(t,e)}var Er=function(){function t(e){Ke(this,t),this._value="",this._update(Object.assign({},t.DEFAULTS,e)),this.isInitialized=!0}return Xe(t,[{key:"updateOptions",value:function(t){Object.keys(t).length&&this.withValueRefresh(this._update.bind(this,t))}},{key:"_update",value:function(t){Object.assign(this,t)}},{key:"state",get:function(){return{_value:this.value}},set:function(t){this._value=t._value}},{key:"reset",value:function(){this._value=""}},{key:"value",get:function(){return this._value},set:function(t){this.resolve(t)}},{key:"resolve",value:function(t){return this.reset(),this.append(t,{input:!0},""),this.doCommit(),this.value}},{key:"unmaskedValue",get:function(){return this.value},set:function(t){this.reset(),this.append(t,{},""),this.doCommit()}},{key:"typedValue",get:function(){return this.doParse(this.value)},set:function(t){this.value=this.doFormat(t)}},{key:"rawInputValue",get:function(){return this.extractInput(0,this.value.length,{raw:!0})},set:function(t){this.reset(),this.append(t,{raw:!0},""),this.doCommit()}},{key:"isComplete",get:function(){return!0}},{key:"nearestInputPos",value:function(t,e){return t}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.value.slice(t,e)}},{key:"extractTail",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return new _r(this.extractInput(t,e),t)}},{key:"appendTail",value:function(t){return hr(t)&&(t=new _r(String(t))),t.appendTo(this)}},{key:"_appendCharRaw",value:function(t){return t?(this._value+=t,new br({inserted:t,rawInserted:t})):new br}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=this.state,o=this._appendCharRaw(this.doPrepare(t,e),e);if(o.inserted){var i,s=!1!==this.doValidate(e);if(s&&null!=r){var a=this.state;this.overwrite&&(i=r.state,r.shiftBefore(this.value.length));var u=this.appendTail(r);(s=u.rawInserted===r.toString())&&u.inserted&&(this.state=a)}s||(o=new br,this.state=n,r&&i&&(r.state=i))}return o}},{key:"_appendPlaceholder",value:function(){return new br}},{key:"append",value:function(t,e,r){if(!hr(t))throw new Error("value should be string");var n=new br,o=hr(r)?new _r(String(r)):r;e&&e.tail&&(e._beforeTailState=this.state);for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this._value=this.value.slice(0,t)+this.value.slice(e),new br}},{key:"withValueRefresh",value:function(t){if(this._refreshing||!this.isInitialized)return t();this._refreshing=!0;var e=this.rawInputValue,r=this.value,n=t();return this.rawInputValue=e,this.value&&this.value!==r&&0===r.indexOf(this.value)&&this.append(r.slice(this.value.length),{},""),delete this._refreshing,n}},{key:"runIsolated",value:function(t){if(this._isolated||!this.isInitialized)return t(this);this._isolated=!0;var e=this.state,r=t(this);return this.state=e,delete this._isolated,r}},{key:"doPrepare",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.prepare?this.prepare(t,this,e):t}},{key:"doValidate",value:function(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}},{key:"doCommit",value:function(){this.commit&&this.commit(this.value,this)}},{key:"doFormat",value:function(t){return this.format?this.format(t,this):t}},{key:"doParse",value:function(t){return this.parse?this.parse(t,this):t}},{key:"splice",value:function(t,e,r,n){var o=t+e,i=this.extractTail(o),s=this.nearestInputPos(t,n);return new br({tailShift:s-t}).aggregate(this.remove(s)).aggregate(this.append(r,{input:!0},i))}}]),t}();function Fr(t){if(null==t)throw new Error("mask property should be defined");return t instanceof RegExp?kr.MaskedRegExp:hr(t)?kr.MaskedPattern:t instanceof Date||t===Date?kr.MaskedDate:t instanceof Number||"number"==typeof t||t===Number?kr.MaskedNumber:Array.isArray(t)||t===Array?kr.MaskedDynamic:kr.Masked&&t.prototype instanceof kr.Masked?t:t instanceof Function?kr.MaskedFunction:t instanceof kr.Masked?t.constructor:(console.warn("Mask not found for mask",t),kr.Masked)}function Ar(t){if(kr.Masked&&t instanceof kr.Masked)return t;var e=(t=Object.assign({},t)).mask;if(kr.Masked&&e instanceof kr.Masked)return e;var r=Fr(e);if(!r)throw new Error("Masked class is not found for provided mask, appropriate module needs to be import manually before creating mask.");return new r(t)}Er.DEFAULTS={format:function(t){return t},parse:function(t){return t}},kr.Masked=Er,kr.createMask=Ar;var wr={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./},Cr=function(){function t(e){Ke(this,t);var r=e.mask,n=rr(e,["mask"]);this.masked=Ar({mask:r}),Object.assign(this,n)}return Xe(t,[{key:"reset",value:function(){this._isFilled=!1,this.masked.reset()}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return 0===t&&e>=1?(this._isFilled=!1,this.masked.remove(t,e)):new br}},{key:"value",get:function(){return this.masked.value||(this._isFilled&&!this.isOptional?this.placeholderChar:"")}},{key:"unmaskedValue",get:function(){return this.masked.unmaskedValue}},{key:"isComplete",get:function(){return Boolean(this.masked.value)||this.isOptional}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._isFilled)return new br;var r=this.masked.state,n=this.masked._appendChar(t,e);return n.inserted&&!1===this.doValidate(e)&&(n.inserted=n.rawInserted="",this.masked.state=r),n.inserted||this.isOptional||this.lazy||e.input||(n.inserted=this.placeholderChar),n.skip=!n.inserted&&!this.isOptional,this._isFilled=Boolean(n.inserted),n}},{key:"append",value:function(){var t;return(t=this.masked).append.apply(t,arguments)}},{key:"_appendPlaceholder",value:function(){var t=new br;return this._isFilled||this.isOptional||(this._isFilled=!0,t.inserted=this.placeholderChar),t}},{key:"extractTail",value:function(){var t;return(t=this.masked).extractTail.apply(t,arguments)}},{key:"appendTail",value:function(){var t;return(t=this.masked).appendTail.apply(t,arguments)}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,r=arguments.length>2?arguments[2]:void 0;return this.masked.extractInput(t,e,r)}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pr,r=0,n=this.value.length,o=Math.min(Math.max(t,r),n);switch(e){case dr:case fr:return this.isComplete?o:r;case mr:case vr:return this.isComplete?o:n;case pr:default:return o}}},{key:"doValidate",value:function(){var t,e;return(t=this.masked).doValidate.apply(t,arguments)&&(!this.parent||(e=this.parent).doValidate.apply(e,arguments))}},{key:"doCommit",value:function(){this.masked.doCommit()}},{key:"state",get:function(){return{masked:this.masked.state,_isFilled:this._isFilled}},set:function(t){this.masked.state=t.masked,this._isFilled=t._isFilled}}]),t}(),Pr=function(){function t(e){Ke(this,t),Object.assign(this,e),this._value=""}return Xe(t,[{key:"value",get:function(){return this._value}},{key:"unmaskedValue",get:function(){return this.isUnmasking?this.value:""}},{key:"reset",value:function(){this._isRawInput=!1,this._value=""}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._value.length;return this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new br}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pr,r=0,n=this._value.length;switch(e){case dr:case fr:return r;case pr:case mr:case vr:default:return n}}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._value.length,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.raw&&this._isRawInput&&this._value.slice(t,e)||""}},{key:"isComplete",get:function(){return!0}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new br;if(this._value)return r;var n=this.char===t[0],o=n&&(this.isUnmasking||e.input||e.raw)&&!e.tail;return o&&(r.rawInserted=this.char),this._value=r.inserted=this.char,this._isRawInput=o&&(e.raw||e.input),r}},{key:"_appendPlaceholder",value:function(){var t=new br;return this._value||(this._value=t.inserted=this.char),t}},{key:"extractTail",value:function(){return arguments.length>1&&void 0!==arguments[1]||this.value.length,new _r("")}},{key:"appendTail",value:function(t){return hr(t)&&(t=new _r(String(t))),t.appendTo(this)}},{key:"append",value:function(t,e,r){var n=this._appendChar(t,e);return null!=r&&(n.tailShift+=this.appendTail(r).tailShift),n}},{key:"doCommit",value:function(){}},{key:"state",get:function(){return{_value:this._value,_isRawInput:this._isRawInput}},set:function(t){Object.assign(this,t)}}]),t}(),Sr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ke(this,t),this.chunks=e,this.from=r}return Xe(t,[{key:"toString",value:function(){return this.chunks.map(String).join("")}},{key:"extend",value:function(e){if(String(e)){hr(e)&&(e=new _r(String(e)));var r=this.chunks[this.chunks.length-1],n=r&&(r.stop===e.stop||null==e.stop)&&e.from===r.from+r.toString().length;if(e instanceof _r)n?r.extend(e.toString()):this.chunks.push(e);else if(e instanceof t){if(null==e.stop)for(var o;e.chunks.length&&null==e.chunks[0].stop;)(o=e.chunks.shift()).from+=e.from,this.extend(o);e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}}},{key:"appendTo",value:function(e){if(!(e instanceof kr.MaskedPattern))return new _r(this.toString()).appendTo(e);for(var r=new br,n=0;n=0)&&r.aggregate(e._appendPlaceholder(s)),a=o instanceof t&&e._blocks[s]),a){var u=a.appendTail(o);u.skip=!1,r.aggregate(u),e._value+=u.inserted;var l=o.toString().slice(u.rawInserted.length);l&&r.aggregate(e.append(l,{tail:!0}))}else r.aggregate(e.append(o.toString(),{tail:!0}))}return r}},{key:"state",get:function(){return{chunks:this.chunks.map((function(t){return t.state})),from:this.from,stop:this.stop,blockIndex:this.blockIndex}},set:function(e){var r=e.chunks,n=rr(e,["chunks"]);Object.assign(this,n),this.chunks=r.map((function(e){var r="chunks"in e?new t:new _r;return r.state=e,r}))}},{key:"shiftBefore",value:function(t){if(this.from>=t||!this.chunks.length)return"";for(var e=t-this.from,r=0;r=0}),sr(tr(r.prototype),"_update",this).call(this,t)}}]),r}(Er);kr.MaskedRegExp=Or;var Vr=function(t){Qe(r,t);var e=or(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ke(this,r),t.definitions=Object.assign({},wr,t.definitions),e.call(this,Object.assign({},r.DEFAULTS,t))}return Xe(r,[{key:"_update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.definitions=Object.assign({},this.definitions,t.definitions),sr(tr(r.prototype),"_update",this).call(this,t),this._rebuildMask()}},{key:"_rebuildMask",value:function(){var t=this,e=this.definitions;this._blocks=[],this._stops=[],this._maskedBlocks={};var n=this.mask;if(n&&e)for(var o=!1,i=!1,s=0;s1&&void 0!==arguments[1]?arguments[1]:{},r=this._mapPosToBlock(this.value.length),n=new br;if(!r)return n;for(var o=r.index;;++o){var i=this._blocks[o];if(!i)break;var s=i._appendChar(t,e),a=s.skip;if(n.aggregate(s),a||s.rawInserted)break}return n}},{key:"extractTail",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=new Sr;return e===r||this._forEachBlocksInRange(e,r,(function(e,r,o,i){var s=e.extractTail(o,i);s.stop=t._findStopBefore(r),s.from=t._blockStartPos(r),s instanceof Sr&&(s.blockIndex=r),n.extend(s)})),n}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t===e)return"";var n="";return this._forEachBlocksInRange(t,e,(function(t,e,o,i){n+=t.extractInput(o,i,r)})),n}},{key:"_findStopBefore",value:function(t){for(var e,r=0;r1&&void 0!==arguments[1]?arguments[1]:this.value.length,r=arguments.length>2?arguments[2]:void 0,n=this._mapPosToBlock(t);if(n){var o=this._mapPosToBlock(e),i=o&&n.index===o.index,s=n.offset,a=o&&i?o.offset:this._blocks[n.index].value.length;if(r(this._blocks[n.index],n.index,s,a),o&&!i){for(var u=n.index+1;u0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=sr(tr(r.prototype),"remove",this).call(this,t,e);return this._forEachBlocksInRange(t,e,(function(t,e,r,o){n.aggregate(t.remove(r,o))})),n}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pr,r=this._mapPosToBlock(t)||{index:0,offset:0},n=r.offset,o=r.index,i=this._blocks[o];if(!i)return t;var s=n;0!==s&&s0){var c=l-1,h=this._blocks[c],p=h.nearestInputPos(0,pr);if(!h.value.length||p!==h.value.length)return this._blockStartPos(l)}for(var d=l,f=d;f=0;--y){var g=this._blocks[y],x=g.nearestInputPos(0,pr);if(!g.value.length||x!==g.value.length)return this._blockStartPos(y)+g.value.length}return t}if(e===dr||e===fr){for(var b,_=l;_=0;--w){var C=this._blocks[w],P=C.nearestInputPos(C.value.length,fr);if(C.value&&0===P||(F=w),0!==P){if(P!==C.value.length)return this._blockStartPos(w)+P;A=w;break}}if(e===dr)for(var S=A+1;S<=Math.min(l,this._blocks.length-1);++S){var O=this._blocks[S],V=O.nearestInputPos(0,pr),j=this._blockStartPos(S)+V;if(j>t)break;if(V!==O.value.length)return j}if(A>=0)return this._blockStartPos(A)+this._blocks[A].value.length;if(e===fr||this.lazy&&!this.extractInput()&&!jr(this._blocks[l]))return 0;if(null!=F)return this._blockStartPos(F);for(var D=l;D=0;--H){var q=this._blocks[H],W=q.nearestInputPos(q.value.length,dr);if(0!==W){var z=this._blockStartPos(H)+W;if(z>=t)return z;break}}}return t}},{key:"maskedBlock",value:function(t){return this.maskedBlocks(t)[0]}},{key:"maskedBlocks",value:function(t){var e=this,r=this._maskedBlocks[t];return r?r.map((function(t){return e._blocks[t]})):[]}}]),r}(Er);function jr(t){if(!t)return!1;var e=t.value;return!e||t.nearestInputPos(0,pr)!==e.length}Vr.DEFAULTS={lazy:!0,placeholderChar:"_"},Vr.STOP_CHAR="`",Vr.ESCAPE_CHAR="\\",Vr.InputDefinition=Cr,Vr.FixedDefinition=Pr,kr.MaskedPattern=Vr;var Dr=function(t){Qe(r,t);var e=or(r);function r(){return Ke(this,r),e.apply(this,arguments)}return Xe(r,[{key:"_matchFrom",get:function(){return this.maxLength-String(this.from).length}},{key:"_update",value:function(t){t=Object.assign({to:this.to||0,from:this.from||0},t);var e=String(t.to).length;null!=t.maxLength&&(e=Math.max(e,t.maxLength)),t.maxLength=e;for(var n=String(t.from).padStart(e,"0"),o=String(t.to).padStart(e,"0"),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};if(t=sr(tr(r.prototype),"doPrepare",this).call(this,t,e).replace(/\D/g,""),!this.autofix)return t;for(var n=String(this.from).padStart(this.maxLength,"0"),o=String(this.to).padStart(this.maxLength,"0"),i=this.value,s="",a=0;athis.to?s+=o[u.length-1]:s+=t[a]}return s}},{key:"doValidate",value:function(){var t,e=arguments,n=this.value,o=n.search(/[^0]/);if(-1===o&&n.length<=this._matchFrom)return!0;for(var i=this.boundaries(n),s=lr(i,2),a=s[0],u=s[1],l=arguments.length,c=new Array(l),h=0;h=0}},{key:"date",get:function(){return this.typedValue},set:function(t){this.typedValue=t}},{key:"typedValue",get:function(){return this.isComplete?sr(tr(r.prototype),"typedValue",this):null},set:function(t){ur(tr(r.prototype),"typedValue",t,this,!0)}}]),r}(Vr);$r.DEFAULTS={pattern:"d{.}`m{.}`Y",format:function(t){return[String(t.getDate()).padStart(2,"0"),String(t.getMonth()+1).padStart(2,"0"),t.getFullYear()].join(".")},parse:function(t){var e=lr(t.split("."),3),r=e[0],n=e[1],o=e[2];return new Date(o,n-1,r)}},$r.GET_DEFAULT_BLOCKS=function(){return{d:{mask:Dr,from:1,to:31,maxLength:2},m:{mask:Dr,from:1,to:12,maxLength:2},Y:{mask:Dr,from:1900,to:9999}}},kr.MaskedDate=$r;var Br=function(){function t(){Ke(this,t)}return Xe(t,[{key:"selectionStart",get:function(){var t;try{t=this._unsafeSelectionStart}catch(t){}return null!=t?t:this.value.length}},{key:"selectionEnd",get:function(){var t;try{t=this._unsafeSelectionEnd}catch(t){}return null!=t?t:this.value.length}},{key:"select",value:function(t,e){if(null!=t&&null!=e&&(t!==this.selectionStart||e!==this.selectionEnd))try{this._unsafeSelect(t,e)}catch(t){}}},{key:"_unsafeSelect",value:function(t,e){}},{key:"isActive",get:function(){return!1}},{key:"bindEvents",value:function(t){}},{key:"unbindEvents",value:function(){}}]),t}();kr.MaskElement=Br;var Ir=function(t){Qe(r,t);var e=or(r);function r(t){var n;return Ke(this,r),(n=e.call(this)).input=t,n._handlers={},n}return Xe(r,[{key:"rootElement",get:function(){return this.input.getRootNode?this.input.getRootNode():document}},{key:"isActive",get:function(){return this.input===this.rootElement.activeElement}},{key:"_unsafeSelectionStart",get:function(){return this.input.selectionStart}},{key:"_unsafeSelectionEnd",get:function(){return this.input.selectionEnd}},{key:"_unsafeSelect",value:function(t,e){this.input.setSelectionRange(t,e)}},{key:"value",get:function(){return this.input.value},set:function(t){this.input.value=t}},{key:"bindEvents",value:function(t){var e=this;Object.keys(t).forEach((function(n){return e._toggleEventHandler(r.EVENTS_MAP[n],t[n])}))}},{key:"unbindEvents",value:function(){var t=this;Object.keys(this._handlers).forEach((function(e){return t._toggleEventHandler(e)}))}},{key:"_toggleEventHandler",value:function(t,e){this._handlers[t]&&(this.input.removeEventListener(t,this._handlers[t]),delete this._handlers[t]),e&&(this.input.addEventListener(t,e),this._handlers[t]=e)}}]),r}(Br);Ir.EVENTS_MAP={selectionChange:"keydown",input:"input",drop:"drop",click:"click",focus:"focus",commit:"blur"},kr.HTMLMaskElement=Ir;var Rr=function(t){Qe(r,t);var e=or(r);function r(){return Ke(this,r),e.apply(this,arguments)}return Xe(r,[{key:"_unsafeSelectionStart",get:function(){var t=this.rootElement,e=t.getSelection&&t.getSelection();return e&&e.anchorOffset}},{key:"_unsafeSelectionEnd",get:function(){var t=this.rootElement,e=t.getSelection&&t.getSelection();return e&&this._unsafeSelectionStart+String(e).length}},{key:"_unsafeSelect",value:function(t,e){if(this.rootElement.createRange){var r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,t),r.setEnd(this.input.lastChild||this.input,e);var n=this.rootElement,o=n.getSelection&&n.getSelection();o&&(o.removeAllRanges(),o.addRange(r))}}},{key:"value",get:function(){return this.input.textContent},set:function(t){this.input.textContent=t}}]),r}(Ir);kr.HTMLContenteditableMaskElement=Rr;var Mr=function(){function t(e,r){Ke(this,t),this.el=e instanceof Br?e:e.isContentEditable&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName?new Rr(e):new Ir(e),this.masked=Ar(r),this._listeners={},this._value="",this._unmaskedValue="",this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}return Xe(t,[{key:"mask",get:function(){return this.masked.mask},set:function(t){if(!this.maskEquals(t))if(t instanceof kr.Masked||this.masked.constructor!==Fr(t)){var e=Ar({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}else this.masked.updateOptions({mask:t})}},{key:"maskEquals",value:function(t){return null==t||t===this.masked.mask||t===Date&&this.masked instanceof $r}},{key:"value",get:function(){return this._value},set:function(t){this.masked.value=t,this.updateControl(),this.alignCursor()}},{key:"unmaskedValue",get:function(){return this._unmaskedValue},set:function(t){this.masked.unmaskedValue=t,this.updateControl(),this.alignCursor()}},{key:"typedValue",get:function(){return this.masked.typedValue},set:function(t){this.masked.typedValue=t,this.updateControl(),this.alignCursor()}},{key:"_bindEvents",value:function(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange})}},{key:"_unbindEvents",value:function(){this.el&&this.el.unbindEvents()}},{key:"_fireEvent",value:function(t){for(var e=arguments,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o=0&&this._listeners[t].splice(r,1),this}},{key:"_onInput",value:function(t){if(this._inputEvent=t,this._abortUpdateCursor(),!this._selection)return this.updateValue();var e=new xr(this.el.value,this.cursorPos,this.value,this._selection),r=this.masked.rawInputValue,n=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection).offset,o=r===this.masked.rawInputValue?e.removeDirection:pr,i=this.masked.nearestInputPos(e.startChangePos+n,o);this.updateControl(),this.updateCursor(i),delete this._inputEvent}},{key:"_onChange",value:function(){this.value!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}},{key:"_onDrop",value:function(t){t.preventDefault(),t.stopPropagation()}},{key:"_onFocus",value:function(t){this.alignCursorFriendly()}},{key:"_onClick",value:function(t){this.alignCursorFriendly()}},{key:"destroy",value:function(){this._unbindEvents(),this._listeners.length=0,delete this.el}}]),t}();kr.InputMask=Mr;var Lr=function(t){Qe(r,t);var e=or(r);function r(){return Ke(this,r),e.apply(this,arguments)}return Xe(r,[{key:"_update",value:function(t){t.enum&&(t.mask="*".repeat(t.enum[0].length)),sr(tr(r.prototype),"_update",this).call(this,t)}},{key:"doValidate",value:function(){for(var t,e=arguments,n=this,o=arguments.length,i=new Array(o),s=0;s=0}))&&(t=sr(tr(r.prototype),"doValidate",this)).call.apply(t,[this].concat(i))}}]),r}(Vr);kr.MaskedEnum=Lr;var Nr=function(t){Qe(r,t);var e=or(r);function r(t){return Ke(this,r),e.call(this,Object.assign({},r.DEFAULTS,t))}return Xe(r,[{key:"_update",value:function(t){sr(tr(r.prototype),"_update",this).call(this,t),this._updateRegExps()}},{key:"_updateRegExps",value:function(){var t="^"+(this.allowNegative?"[+|\\-]?":""),e=(this.scale?"("+gr(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExpInput=new RegExp(t+"(0|([1-9]+\\d*))?"+e),this._numberRegExp=new RegExp(t+"\\d*"+e),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(gr).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(gr(this.thousandsSeparator),"g")}},{key:"_removeThousandsSeparators",value:function(t){return t.replace(this._thousandsSeparatorRegExp,"")}},{key:"_insertThousandsSeparators",value:function(t){var e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}},{key:"doPrepare",value:function(t){for(var e,n=arguments,o=arguments.length,i=new Array(o>1?o-1:0),s=1;s1&&void 0!==arguments[1]&&arguments[1],r=0,n=0;n0&&void 0!==arguments[0]?arguments[0]:this._value;return this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2?arguments[2]:void 0,o=this._adjustRangeWithSeparators(t,e),i=lr(o,2);return t=i[0],e=i[1],this._removeThousandsSeparators(sr(tr(r.prototype),"extractInput",this).call(this,t,e,n))}},{key:"_appendCharRaw",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.thousandsSeparator)return sr(tr(r.prototype),"_appendCharRaw",this).call(this,t,e);var n=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,o=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);var i=sr(tr(r.prototype),"_appendCharRaw",this).call(this,t,e);this._value=this._insertThousandsSeparators(this._value);var s=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(s);return i.tailShift+=(a-o)*this.thousandsSeparator.length,i.skip=!i.rawInserted&&t===this.thousandsSeparator,i}},{key:"_findSeparatorAround",value:function(t){if(this.thousandsSeparator){var e=t-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,e);if(r<=t)return r}return-1}},{key:"_adjustRangeWithSeparators",value:function(t,e){var r=this._findSeparatorAround(t);r>=0&&(t=r);var n=this._findSeparatorAround(e);return n>=0&&(e=n+this.thousandsSeparator.length),[t,e]}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,r=this._adjustRangeWithSeparators(t,e),n=lr(r,2);t=n[0],e=n[1];var o=this.value.slice(0,t),i=this.value.slice(e),s=this._separatorsCount(o.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(o+i));var a=this._separatorsCountFromSlice(o);return new br({tailShift:(a-s)*this.thousandsSeparator.length})}},{key:"nearestInputPos",value:function(t,e){if(!this.thousandsSeparator)return t;switch(e){case pr:case dr:case fr:var r=this._findSeparatorAround(t-1);if(r>=0){var n=r+this.thousandsSeparator.length;if(t=0)return o+this.thousandsSeparator.length}return t}},{key:"doValidate",value:function(t){var e=(t.input?this._numberRegExpInput:this._numberRegExp).test(this._removeThousandsSeparators(this.value));if(e){var n=this.number;e=e&&!isNaN(n)&&(null==this.min||this.min>=0||this.min<=this.number)&&(null==this.max||this.max<=0||this.number<=this.max)}return e&&sr(tr(r.prototype),"doValidate",this).call(this,t)}},{key:"doCommit",value:function(){if(this.value){var t=this.number,e=t;null!=this.min&&(e=Math.max(e,this.min)),null!=this.max&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=String(e));var n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&(n=this._padFractionalZeros(n)),this._value=n}sr(tr(r.prototype),"doCommit",this).call(this)}},{key:"_normalizeZeros",value:function(t){var e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,(function(t,e,r,n){return e+n})),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}},{key:"_padFractionalZeros",value:function(t){if(!t)return t;var e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}},{key:"unmaskedValue",get:function(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,".")},set:function(t){ur(tr(r.prototype),"unmaskedValue",t.replace(".",this.radix),this,!0)}},{key:"typedValue",get:function(){return Number(this.unmaskedValue)},set:function(t){ur(tr(r.prototype),"unmaskedValue",String(t),this,!0)}},{key:"number",get:function(){return this.typedValue},set:function(t){this.typedValue=t}},{key:"allowNegative",get:function(){return this.signed||null!=this.min&&this.min<0||null!=this.max&&this.max<0}}]),r}(Er);Nr.DEFAULTS={radix:",",thousandsSeparator:"",mapToRadix:["."],scale:2,signed:!1,normalizeZeros:!0,padFractionalZeros:!1},kr.MaskedNumber=Nr;var Tr=function(t){Qe(r,t);var e=or(r);function r(){return Ke(this,r),e.apply(this,arguments)}return Xe(r,[{key:"_update",value:function(t){t.mask&&(t.validate=t.mask),sr(tr(r.prototype),"_update",this).call(this,t)}}]),r}(Er);kr.MaskedFunction=Tr;var Ur=function(t){Qe(r,t);var e=or(r);function r(t){var n;return Ke(this,r),(n=e.call(this,Object.assign({},r.DEFAULTS,t))).currentMask=null,n}return Xe(r,[{key:"_update",value:function(t){sr(tr(r.prototype),"_update",this).call(this,t),"mask"in t&&(this.compiledMasks=Array.isArray(t.mask)?t.mask.map((function(t){return Ar(t)})):[])}},{key:"_appendCharRaw",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this._applyDispatch(t,e);return this.currentMask&&r.aggregate(this.currentMask._appendChar(t,e)),r}},{key:"_applyDispatch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.tail&&null!=e._beforeTailState?e._beforeTailState._value:this.value,n=this.rawInputValue,o=e.tail&&null!=e._beforeTailState?e._beforeTailState._rawInputValue:n,i=n.slice(o.length),s=this.currentMask,a=new br,u=s&&s.state;if(this.currentMask=this.doDispatch(t,Object.assign({},e)),this.currentMask)if(this.currentMask!==s){if(this.currentMask.reset(),o){var l=this.currentMask.append(o,{raw:!0});a.tailShift=l.inserted.length-r.length}i&&(a.tailShift+=this.currentMask.append(i,{raw:!0,tail:!0}).tailShift)}else this.currentMask.state=u;return a}},{key:"_appendPlaceholder",value:function(){var t=this._applyDispatch.apply(this,arguments);return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}},{key:"doDispatch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.dispatch(t,this,e)}},{key:"doValidate",value:function(){for(var t,e,n=arguments,o=arguments.length,i=new Array(o),s=0;s1&&void 0!==arguments[1]?arguments[1]:Gr.MASKED,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Gr.MASKED,n=Ar(t);return function(t){return n.runIsolated((function(n){return n[e]=t,n[r]}))}}kr.PIPE_TYPE=Gr,kr.createPipe=Hr,kr.pipe=function(t){for(var e=arguments,r=arguments.length,n=new Array(r>1?r-1:0),o=1;on)},alpha:function(t,e){var r=t.value;void 0===e&&(e="default");var n={default:/^[a-zA-ZÀ-ÖØ-öø-ÿĄąĆćĘꣳŃńŚśŹźŻż]+$/,latin:/^[a-zA-Z]+$/},o=n.hasOwnProperty(e)?e:"default";return Promise.resolve(n[o].test(r))},alphanumeric:function(t,e){var r=t.value;void 0===e&&(e="default");var n={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿĄąĆćĘꣳŃńŚśŹźŻż]+$/,latin:/^[a-zA-Z0-9]+$/},o=n.hasOwnProperty(e)?e:"default";return Promise.resolve(n[o].test(r))},before:function(t,e){var r=t.value;void 0===e&&(e=!1);var n=Date.parse(e||new Date),o=Date.parse(r);return Promise.resolve(!isNaN(o)&&oe&&oe&&o.length()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},endsWith:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.endsWith(t)})):"string"==typeof e&&0===r.length)},in:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve(void 0!==r.find((function(t){return"object"==typeof t?De(t,e):t===e})))},matches:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve(!!r.find((function(t){return"string"==typeof t&&"/"===t.substr(0,1)&&"/"===t.substr(-1)&&(t=new RegExp(t.substr(1,t.length-2))),t instanceof RegExp?t.test(e):t===e})))},mime:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve(function(){if(e instanceof Ve)for(var t=e.getFiles(),n=0;n=e):!isNaN(n)&&"length"!==r||"value"===r?(n=isNaN(n)?n:Number(n))>=e:("string"==typeof n||"length"===r)&&(n=isNaN(n)?n:n.toString()).length>=e)},max:function(t,e,r){var n=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(n)?(e=isNaN(e)?e:Number(e),n.length<=e):!isNaN(n)&&"length"!==r||"value"===r?(n=isNaN(n)?n:Number(n))<=e:("string"==typeof n||"length"===r)&&(n=isNaN(n)?n:n.toString()).length<=e)},not:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve(void 0===r.find((function(t){return"object"==typeof t?De(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var r=t.value;return void 0===e&&(e="pre"),Promise.resolve(Array.isArray(r)?!!r.length:r instanceof Ve?r.getFiles().length>0:"string"==typeof r?"trim"===e?!!r.trim():!!r:"object"!=typeof r||!!r&&!!Object.keys(r).length)},startsWith:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.startsWith(t)})):"string"==typeof e&&0===r.length)},url:function(t){var r=t.value;return Promise.resolve(e(r))},bail:function(){return Promise.resolve(!0)},optional:function(t){var e=t.value;return Promise.resolve(!Ue(e))}},Jr="image/",Xr={csv:"text/csv",gif:Jr+"gif",jpg:Jr+"jpeg",jpeg:Jr+"jpeg",png:Jr+"png",pdf:"application/pdf",svg:Jr+"svg+xml"},Qr=["outer","wrapper","label","element","input","help","errors","error","decorator","rangeValue","uploadArea","uploadAreaMask","files","file","fileName","fileAdd","fileAddInput","fileRemove","fileProgress","fileUploadError","fileImagePreview","fileImagePreviewImage","fileProgressInner","grouping","groupRepeatable","groupRepeatableRemove","groupAddMore","form","formErrors","formError"],tn={hasErrors:function(t){return t.hasErrors},hasValue:function(t){return t.hasValue},isValid:function(t){return t.isValid}},en=function(t,e,r){var n=[];switch(e){case"label":n.push(t+"--"+r.labelPosition);break;case"element":var o="group"===r.classification?"group":r.type;n.push(t+"--"+o),"group"===o&&n.push("formulate-input-group");break;case"help":n.push(t+"--"+r.helpPosition);break;case"form":r.name&&n.push(t+"--"+r.name)}return n},rn=(qr=[""].concat(Object.keys(tn).map((function(t){return Be(t)}))),Qr.reduce((function(t,e){return t.concat(qr.reduce((function(t,r){return t.push(""+e+r+"Class"),t}),[]))}),[]));function nn(t,e,r){switch(typeof e){case"string":return e;case"function":return e(r,Ie(t));case"object":if(Array.isArray(e))return Ie(t).concat(e);default:return t}}function on(t){return Qr.reduce((function(e,r){var n;return Object.assign(e,((n={})[r]=function(t,e){var r=t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()})),n="formulate"+(["form","file"].includes(r.substr(0,4))?"":"-input")+(["decorator","range-value"].includes(r)?"-element":"")+("outer"!==r?"-"+r:"");return"input"===r?[]:[n].concat(en(n,t,e))}(r,t),n))}),{})}function sn(t,e,r,n){return new Promise((function(r,o){var i=(n.fauxUploaderDuration||1500)*(.5+Math.random()),s=performance.now(),a=function(){return setTimeout((function(){var n=performance.now()-s,o=Math.min(100,Math.round(n/i*100));if(e(o),o>=100)return r({url:"http://via.placeholder.com/350x150.png",name:t.name});a()}),20)};a()}))}function an(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}var un={inheritAttrs:!1,functional:!0,render:function(t,e){for(var r=e.props,n=e.data,o=e.parent,i=e.children,s=o,a=(r.name,r.forceWrap),u=r.context,l=an(r,["name","forceWrap","context"]);s&&"FormulateInput"!==s.$options.name;)s=s.$parent;if(!s)return null;if(s.$scopedSlots&&s.$scopedSlots[r.name])return s.$scopedSlots[r.name](Object.assign({},u,l));if(Array.isArray(i)&&(i.length>1||a&&i.length>0)){var c=n.attrs,h=(c.name,c.context,an(c,["name","context"]));return t("div",Object.assign({},n,{attrs:h}),i)}return Array.isArray(i)&&1===i.length?i[0]:null}};function ln(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r={}),t&&"object"==typeof t&&!Array.isArray(t)){var n=t.children;void 0===n&&(n=null);var o=t.component;void 0===o&&(o="FormulateInput");var i=t.depth;void 0===i&&(i=1);var s=t.key;void 0===s&&(s=null);var a=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(t,["children","component","depth","key"]),u=a.class||{};delete a.class;var l={},c=Object.keys(a).reduce((function(t,e){var r;return/^@/.test(e)?Object.assign(t,((r={})[e.substr(1)]=a[e],r)):t}),{});Object.keys(c).forEach((function(t){delete a["@"+t],l[t]=function(t,e,r){return function(){for(var n,o,i=[],s=arguments.length;s--;)i[s]=arguments[s];return"function"==typeof e?e.call.apply(e,[this].concat(i)):"string"==typeof e&&Ne(r,e)?(n=r[e]).call.apply(n,[this].concat(i)):Ne(r,t)?(o=r[t]).call.apply(o,[this].concat(i)):void 0}}(t,c[t],r)}));var h="FormulateInput"===o?a.type||"text":o,p=a.name||h||"el";s||(s=a.id?a.id:"FormulateInput"!==o&&"string"==typeof n?h+"-"+function(t,e){void 0===e&&(e=0);for(var r=3735928559^e,n=1103547991^e,o=0,i=void 0;o>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&(n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)}(n):h+"-"+p+"-"+i+(a.name?"":"-"+e));var d=Array.isArray(n)?n.map((function(t){return Object.assign(t,{depth:i+1})})):n;return Object.assign({key:s,depth:i,attrs:a,component:o,class:u,on:l},d?{children:d}:{})}return null}var cn={functional:!0,render:function(t,e){var r=e.props,n=e.listeners;return function t(e,r,n){return Array.isArray(r)?r.map((function(r,o){var i=ln(r,o,n);return e(i.component,{attrs:i.attrs,class:i.class,key:i.key,on:i.on},i.children?t(e,i.children,n):null)})):r}(t,r.schema,n)}};function hn(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}var pn=function(t){this.registry=new Map,this.errors={},this.ctx=t};function dn(t){return new pn(t).dataProps()}function fn(t){return{hasInitialValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue||this.values&&"object"==typeof this.values||this.isGrouping&&"object"==typeof this.context.model[this.index]},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},initialValues:function(){return Ne(this.$options.propsData,"formulateValue")&&"object"==typeof this.formulateValue?Object.assign({},this.formulateValue):Ne(this.$options.propsData,"values")&&"object"==typeof this.values?Object.assign({},this.values):this.isGrouping&&"object"==typeof this.context.model[this.index]?this.context.model[this.index]:{}},mergedGroupErrors:function(){var t=this,e=/^([^.\d+].*?)\.(\d+\..+)$/;return Object.keys(this.mergedFieldErrors).filter((function(t){return e.test(t)})).reduce((function(r,n){var o,i=n.match(e),s=i[1],a=i[2];return r[s]||(r[s]={}),Object.assign(r[s],((o={})[a]=t.mergedFieldErrors[n],o)),r}),{})}}}function mn(t){void 0===t&&(t=[]);var e={applyInitialValues:function(){this.hasInitialValue&&(this.proxy=Object.assign({},this.initialValues))},setFieldValue:function(t,e){var r;if(void 0===e){var n=this.proxy,o=(n[t],hn(n,[String(t)]));this.proxy=o}else Object.assign(this.proxy,((r={})[t]=e,r));this.$emit("input",Object.assign({},this.proxy))},valueDeps:function(t){var e=this;return Object.keys(this.proxy).reduce((function(r,n){return Object.defineProperty(r,n,{enumerable:!0,get:function(){var r=e.registry.get(n);return e.deps.set(t,e.deps.get(t)||new Set),r&&(e.deps.set(r,e.deps.get(r)||new Set),e.deps.get(r).add(t.name)),e.deps.get(t).add(n),e.proxy[n]}})}),Object.create(null))},validateDeps:function(t){var e=this;this.deps.has(t)&&this.deps.get(t).forEach((function(t){return e.registry.has(t)&&e.registry.get(t).performValidation()}))},hasValidationErrors:function(){return Promise.all(this.registry.reduce((function(t,e,r){return t.push(e.performValidation()&&e.getValidationErrors()),t}),[])).then((function(t){return t.some((function(t){return t.hasErrors}))}))},showErrors:function(){this.childrenShouldShowErrors=!0,this.registry.map((function(t){t.formShouldShowErrors=!0}))},hideErrors:function(){this.childrenShouldShowErrors=!1,this.registry.map((function(t){t.formShouldShowErrors=!1,t.behavioralErrorVisibility=!1}))},setValues:function(t){var e=this;Array.from(new Set(Object.keys(t||{}).concat(Object.keys(this.proxy)))).forEach((function(r){var n=e.registry.has(r)&&e.registry.get(r),o=t?t[r]:void 0;n&&!De(n.proxy,o,!0)&&(n.context.model=o),De(o,e.proxy[r],!0)||e.setFieldValue(r,o)}))},updateValidation:function(t){Ne(this.registry.errors,t.name)&&(this.registry.errors[t.name]=t.hasErrors),this.$emit("validation",t)},addErrorObserver:function(t){this.errorObservers.find((function(e){return t.callback===e.callback}))||(this.errorObservers.push(t),"form"===t.type?t.callback(this.mergedFormErrors):"group"===t.type&&Ne(this.mergedGroupErrors,t.field)?t.callback(this.mergedGroupErrors[t.field]):Ne(this.mergedFieldErrors,t.field)&&t.callback(this.mergedFieldErrors[t.field]))},removeErrorObserver:function(t){this.errorObservers=this.errorObservers.filter((function(e){return e.callback!==t}))}};return Object.keys(e).reduce((function(r,n){var o;return t.includes(n)?r:Object.assign({},r,((o={})[n]=e[n],o))}),{})}function vn(t,e){void 0===e&&(e=[]);var r={formulateSetter:t.setFieldValue,formulateRegister:t.register,formulateDeregister:t.deregister,formulateFieldValidation:t.updateValidation,getFormValues:t.valueDeps,getGroupValues:t.valueDeps,validateDependents:t.validateDeps,observeErrors:t.addErrorObserver,removeErrorObserver:t.removeErrorObserver};return Object.keys(r).filter((function(t){return!e.includes(t)})).reduce((function(t,e){var n;return Object.assign(t,((n={})[e]=r[e],n))}),{})}pn.prototype.add=function(t,e){var r;return this.registry.set(t,e),this.errors=Object.assign({},this.errors,((r={})[t]=e.getErrorObject().hasErrors,r)),this},pn.prototype.remove=function(t){this.ctx.deps.delete(this.registry.get(t)),this.ctx.deps.forEach((function(e){return e.delete(t)}));var e=this.ctx.keepModelData;!e&&this.registry.has(t)&&"inherit"!==this.registry.get(t).keepModelData&&(e=this.registry.get(t).keepModelData),this.ctx.preventCleanup&&(e=!0),this.registry.delete(t);var r=this.errors,n=(r[t],hn(r,[String(t)]));if(this.errors=n,!e){var o=this.ctx.proxy,i=(o[t],hn(o,[String(t)]));this.ctx.uuid&&Te(i,this.ctx.uuid),this.ctx.proxy=i,this.ctx.$emit("input",this.ctx.proxy)}return this},pn.prototype.has=function(t){return this.registry.has(t)},pn.prototype.get=function(t){return this.registry.get(t)},pn.prototype.map=function(t){var e={};return this.registry.forEach((function(r,n){var o;return Object.assign(e,((o={})[n]=t(r,n),o))})),e},pn.prototype.keys=function(){return Array.from(this.registry.keys())},pn.prototype.register=function(t,e){var r=this;if(Ne(e.$options.propsData,"ignored"))return!1;if(this.registry.has(t))return this.ctx.$nextTick((function(){return!r.registry.has(t)&&r.register(t,e)})),!1;this.add(t,e);var n=Ne(e.$options.propsData,"formulateValue"),o=Ne(e.$options.propsData,"value"),i=this.ctx.debounce||this.ctx.debounceDelay||this.ctx.context&&this.ctx.context.debounceDelay;i&&!Ne(e.$options.propsData,"debounce")&&(e.debounceDelay=i),n||!this.ctx.hasInitialValue||Ue(this.ctx.initialValues[t])?!n&&!o||De(e.proxy,this.ctx.initialValues[t],!0)||this.ctx.setFieldValue(t,e.proxy):e.context.model=this.ctx.initialValues[t],this.childrenShouldShowErrors&&(e.formShouldShowErrors=!0)},pn.prototype.reduce=function(t,e){return this.registry.forEach((function(r,n){e=t(e,r,n)})),e},pn.prototype.dataProps=function(){var t=this;return{proxy:{},registry:this,register:this.register.bind(this),deregister:function(e){return t.remove(e)},childrenShouldShowErrors:!1,errorObservers:[],deps:new Map,preventCleanup:!1}};var yn=function(t){this.form=t};yn.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},yn.prototype.values=function(){var t=this;return new Promise((function(e,r){var n=[],o=function t(e){if("object"!=typeof e)return e;var r=Array.isArray(e)?[]:{};for(var n in e)e[n]instanceof Ve||Le(e[n])?r[n]=e[n]:r[n]=t(e[n]);return r}(t.form.proxy),i=function(e){"object"==typeof t.form.proxy[e]&&t.form.proxy[e]instanceof Ve&&n.push(t.form.proxy[e].upload().then((function(t){var r;return Object.assign(o,((r={})[e]=t,r))})))};for(var s in o)i(s);Promise.all(n).then((function(){return e(o)})).catch((function(t){return r(t)}))}))};var gn={name:"FormulateForm",inheritAttrs:!1,provide:function(){return Object.assign({},vn(this,["getGroupValues"]),{observeContext:this.addContextObserver,removeContextObserver:this.removeContextObserver})},model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}},values:{type:[Object,Boolean],default:!1},errors:{type:[Object,Boolean],default:!1},formErrors:{type:Array,default:function(){return[]}},schema:{type:[Array,Boolean],default:!1},keepModelData:{type:[Boolean,String],default:!1},invalidMessage:{type:[Boolean,Function,String],default:!1},debounce:{type:[Boolean,Number],default:!1}},data:function(){return Object.assign({},dn(this),{formShouldShowErrors:!1,contextObservers:[],namedErrors:[],namedFieldErrors:{},isLoading:!1,hasFailedSubmit:!1})},computed:Object.assign({},fn(),{schemaListeners:function(){var t=this.$listeners;t.submit;return function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(t,["submit"])},pseudoProps:function(){return Ge(this.$attrs,rn.filter((function(t){return/^form/.test(t)})))},attributes:function(){var t=this,e=Object.keys(this.$attrs).filter((function(e){return!Ne(t.pseudoProps,$e(e))})).reduce((function(e,r){var n;return Object.assign({},e,((n={})[r]=t.$attrs[r],n))}),{});return"string"==typeof this.name&&Object.assign(e,{name:this.name}),e},hasErrors:function(){return Object.values(this.registry.errors).some((function(t){return t}))},isValid:function(){return!this.hasErrors},formContext:function(){return{errors:this.mergedFormErrors,pseudoProps:this.pseudoProps,hasErrors:this.hasErrors,value:this.proxy,hasValue:!Ue(this.proxy),isValid:this.isValid,isLoading:this.isLoading,classes:this.classes}},classes:function(){return this.$formulate.classes(Object.assign({},this.$props,this.pseudoProps,{value:this.proxy,errors:this.mergedFormErrors,hasErrors:this.hasErrors,hasValue:!Ue(this.proxy),isValid:this.isValid,isLoading:this.isLoading,type:"form",classification:"form",attrs:this.$attrs}))},invalidErrors:function(){if(this.hasFailedSubmit&&this.hasErrors)switch(typeof this.invalidMessage){case"string":return[this.invalidMessage];case"object":return Array.isArray(this.invalidMessage)?this.invalidMessage:[];case"function":var t=this.invalidMessage(this.failingFields);return Array.isArray(t)?t:[t]}return[]},mergedFormErrors:function(){return this.formErrors.concat(this.namedErrors).concat(this.invalidErrors)},mergedFieldErrors:function(){var t={};if(this.errors)for(var e in this.errors)t[e]=Ie(this.errors[e]);for(var r in this.namedFieldErrors)t[r]=Ie(this.namedFieldErrors[r]);return t},hasFormErrorObservers:function(){return!!this.errorObservers.filter((function(t){return"form"===t.type})).length},failingFields:function(){var t=this;return Object.keys(this.registry.errors).reduce((function(e,r){var n;return Object.assign({},e,t.registry.errors[r]?((n={})[r]=t.registry.get(r),n):{})}),{})}}),watch:Object.assign({},{mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type})).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0},mergedGroupErrors:{handler:function(t){this.errorObservers.filter((function(t){return"group"===t.type})).forEach((function(e){return e.callback(t[e.field]||{})}))},immediate:!0}},{formulateValue:{handler:function(t){this.isVmodeled&&t&&"object"==typeof t&&this.setValues(t)},deep:!0},mergedFormErrors:function(t){this.errorObservers.filter((function(t){return"form"===t.type})).forEach((function(e){return e.callback(t)}))}}),created:function(){this.$formulate.register(this),this.applyInitialValues(),this.$emit("created",this)},destroyed:function(){this.$formulate.deregister(this)},methods:Object.assign({},mn(),{applyErrors:function(t){var e=t.formErrors,r=t.inputErrors;this.namedErrors=e,this.namedFieldErrors=r},addContextObserver:function(t){this.contextObservers.find((function(e){return e===t}))||(this.contextObservers.push(t),t(this.formContext))},removeContextObserver:function(t){this.contextObservers.filter((function(e){return e!==t}))},registerErrorComponent:function(t){this.errorComponents.includes(t)||this.errorComponents.push(t)},formSubmitted:function(){var t=this;if(!this.isLoading){this.isLoading=!0,this.showErrors();var e=new yn(this),r=this.$listeners["submit-raw"]||this.$listeners.submitRaw,n="function"==typeof r?r(e):Promise.resolve(e);return(n instanceof Promise?n:Promise.resolve(n)).then((function(t){var r=t instanceof yn?t:e;return r.hasValidationErrors().then((function(t){return[r,t]}))})).then((function(e){var r=e[0];return e[1]||"function"!=typeof t.$listeners.submit?t.onFailedValidation():r.values().then((function(e){t.hasFailedSubmit=!1;var r=t.$listeners.submit(e);return(r instanceof Promise?r:Promise.resolve()).then((function(){return e}))}))})).finally((function(){t.isLoading=!1}))}},onFailedValidation:function(){return this.hasFailedSubmit=!0,this.$emit("failed-validation",Object.assign({},this.failingFields)),this.$formulate.failedValidation(this)}})},xn=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form",t._b({class:t.classes.form,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},"form",t.attributes,!1),[t.schema?r("FormulateSchema",t._g({attrs:{schema:t.schema}},t.schemaListeners)):t._e(),t._v(" "),t.hasFormErrorObservers?t._e():r("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default",null,null,t.formContext)],2)};xn._withStripped=!0;var bn=Fe({render:xn,staticRenderFns:[]},void 0,gn,void 0,!1,void 0,!1,void 0,void 0,void 0);var _n={context:function(){return An.call(this,Object.assign({},{addLabel:this.logicalAddLabel,removeLabel:this.logicalRemoveLabel,attributes:this.elementAttributes,blurHandler:Fn.bind(this),classification:this.classification,component:this.component,debounceDelay:this.debounceDelay,disableErrors:this.disableErrors,errors:this.explicitErrors,formShouldShowErrors:this.formShouldShowErrors,getValidationErrors:this.getValidationErrors.bind(this),groupErrors:this.mergedGroupErrors,hasGivenName:this.hasGivenName,hasValue:this.hasValue,hasLabel:this.label&&"button"!==this.classification,hasValidationErrors:this.hasValidationErrors.bind(this),help:this.help,helpPosition:this.logicalHelpPosition,id:this.id||this.defaultId,ignored:Ne(this.$options.propsData,"ignored"),isValid:this.isValid,imageBehavior:this.imageBehavior,label:this.label,labelPosition:this.logicalLabelPosition,limit:this.limit===1/0?this.limit:parseInt(this.limit,10),name:this.nameOrFallback,minimum:parseInt(this.minimum,10),performValidation:this.performValidation.bind(this),pseudoProps:this.pseudoProps,preventWindowDrops:this.preventWindowDrops,removePosition:this.mergedRemovePosition,repeatable:this.repeatable,rootEmit:this.$emit.bind(this),rules:this.ruleDetails,setErrors:this.setErrors.bind(this),showValidationErrors:this.showValidationErrors,slotComponents:this.slotComponents,slotProps:this.slotProps,type:this.type,uploadBehavior:this.uploadBehavior,uploadUrl:this.mergedUploadUrl,uploader:this.uploader||this.$formulate.getUploader(),validationErrors:this.validationErrors,value:this.value,visibleValidationErrors:this.visibleValidationErrors,isSubField:this.isSubField,classes:this.classes},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification){var t=this.id||this.elementAttributes.id.replace(/[^0-9]/g,"");return this.type+"_"+t}if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},hasGivenName:function(){return"boolean"!=typeof this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:kn.call(this,this.options),optionGroups:!!this.optionGroups&&je(this.optionGroups,(function(e,r){return kn.call(t,r)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:kn.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.filteredAttributes);this.id?t.id=this.id:t.id=this.defaultId;this.hasGivenName&&(t.name=this.name);this.help&&!Ne(t,"aria-describedby")&&(t["aria-describedby"]=t.id+"-help");!this.classes.input||Array.isArray(this.classes.input)&&!this.classes.input.length||(t.class=this.classes.input);return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},logicalHelpPosition:function(){if(this.helpPosition)return this.helpPosition;switch(this.classification){case"group":return"before";default:return"after"}},mergedRemovePosition:function(){return"group"===this.type&&(this.removePosition||"before")},mergedUploadUrl:function(){return this.uploadUrl||this.$formulate.getUploadUrl()},mergedGroupErrors:function(){var t=this,e=Object.keys(this.groupErrors).concat(Object.keys(this.localGroupErrors)),r=/^(\d+)\.(.*)$/;return Array.from(new Set(e)).filter((function(t){return r.test(t)})).reduce((function(e,n){var o,i=n.match(r),s=i[1],a=i[2];Ne(e,s)||(e[s]={});var u=Array.from(new Set(Ie(t.groupErrors[n]).concat(Ie(t.localGroupErrors[n]))));return e[s]=Object.assign(e[s],((o={})[a]=u,o)),e}),{})},hasValue:function(){var t=this,e=this.proxy;if("box"===this.classification&&this.isGrouped||"select"===this.classification&&Ne(this.filteredAttributes,"multiple"))return Array.isArray(e)?e.some((function(e){return e===t.value})):this.value===e;return!Ue(e)},visibleValidationErrors:function(){return this.showValidationErrors&&this.validationErrors.length?this.validationErrors:[]},slotComponents:function(){var t=this.$formulate.slotComponent.bind(this.$formulate);return{addMore:t(this.type,"addMore"),buttonContent:t(this.type,"buttonContent"),errors:t(this.type,"errors"),file:t(this.type,"file"),help:t(this.type,"help"),label:t(this.type,"label"),prefix:t(this.type,"prefix"),remove:t(this.type,"remove"),repeatable:t(this.type,"repeatable"),suffix:t(this.type,"suffix"),uploadAreaMask:t(this.type,"uploadAreaMask")}},logicalAddLabel:function(){if("file"===this.classification)return!0===this.addLabel?"+ Add "+Be(this.type):this.addLabel;if("boolean"==typeof this.addLabel){var t=this.label||this.name;return"+ "+("string"==typeof t?t+" ":"")+" Add"}return this.addLabel},logicalRemoveLabel:function(){if("boolean"==typeof this.removeLabel)return"Remove";return this.removeLabel},classes:function(){return this.$formulate.classes(Object.assign({},this.$props,this.pseudoProps,{attrs:this.filteredAttributes,classification:this.classification,hasErrors:this.hasVisibleErrors,hasValue:this.hasValue,helpPosition:this.logicalHelpPosition,isValid:this.isValid,labelPosition:this.logicalLabelPosition,type:this.type,value:this.proxy}))},showValidationErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;if("file"===this.classification&&"live"===this.uploadBehavior&&wn.call(this))return!0;return this.behavioralErrorVisibility},slotProps:function(){var t=this.$formulate.slotProps.bind(this.$formulate);return{label:t(this.type,"label",this.typeProps),help:t(this.type,"help",this.typeProps),errors:t(this.type,"errors",this.typeProps),repeatable:t(this.type,"repeatable",this.typeProps),addMore:t(this.type,"addMore",this.typeProps),remove:t(this.type,"remove",this.typeProps),component:t(this.type,"component",this.typeProps)}},pseudoProps:function(){return Ge(this.localAttributes,rn)},isValid:function(){return!this.hasErrors},ruleDetails:function(){return this.parsedValidation.map((function(t){var e=t[1];return{ruleName:t[2],args:e}}))},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedValidationName:function(){var t=this,e=this.$formulate.options.validationNameStrategy||["validationName","name","label","type"];if(Array.isArray(e)){return this[e.find((function(e){return"string"==typeof t[e]}))]}if("function"==typeof e)return e.call(this,this);return this.type},explicitErrors:function(){return Ie(this.errors).concat(this.localErrors).concat(Ie(this.error))},allErrors:function(){return this.explicitErrors.concat(Ie(this.validationErrors))},hasVisibleErrors:function(){return Array.isArray(this.validationErrors)&&this.validationErrors.length&&this.showValidationErrors||!!this.explicitErrors.length},hasErrors:function(){return!!this.allErrors.length},filteredAttributes:function(){var t=this,e=Object.keys(this.pseudoProps).concat(Object.keys(this.typeProps));return Object.keys(this.localAttributes).reduce((function(r,n){return e.includes($e(n))||(r[n]=t.localAttributes[n]),r}),{})},typeProps:function(){return Ge(this.localAttributes,this.$formulate.typeProps(this.type))},listeners:function(){var t=this.$listeners;t.input;return function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(t,["input"])}};function kn(t){return t?(Array.isArray(t)?t:Object.keys(t).map((function(e){return{label:t[e],value:e}}))).map(En.bind(this)):[]}function En(t){return"number"==typeof t&&(t=String(t)),"string"==typeof t?{label:t,value:t,id:this.elementAttributes.id+"_"+t}:("number"==typeof t.value&&(t.value=String(t.value)),Object.assign({value:"",label:"",id:this.elementAttributes.id+"_"+(t.value||t.label)},t))}function Fn(){var t=this;"blur"!==this.errorBehavior&&"value"!==this.errorBehavior||(this.behavioralErrorVisibility=!0),this.$nextTick((function(){return t.$emit("blur-context",t.context)}))}function An(t){var e=this;return Object.defineProperty(t,"model",{get:wn.bind(this),set:function(t){if(!e.mntd||!e.debounceDelay)return Cn.call(e,t);e.dSet(Cn,[t],e.debounceDelay)},enumerable:!0})}function wn(){var t=this.isVmodeled?"formulateValue":"proxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]||0===this[t]?this[t]:""}function Cn(t){var e=!1;De(t,this.proxy,"group"===this.type)||(this.proxy=t,e=!0),!this.context.ignored&&this.context.name&&"function"==typeof this.formulateSetter&&this.formulateSetter(this.context.name,t),e&&this.$emit("input",t)}var Pn={name:"FormulateInput",inheritAttrs:!1,provide:function(){return{formulateRegisterRule:this.registerRule,formulateRemoveRule:this.removeRule}},inject:{formulateSetter:{default:void 0},formulateFieldValidation:{default:function(){return function(){return{}}}},formulateRegister:{default:void 0},formulateDeregister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}},getGroupValues:{default:void 0},validateDependents:{default:function(){return function(){}}},observeErrors:{default:void 0},removeErrorObserver:{default:void 0},isSubField:{default:function(){return function(){return!1}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},limit:{type:[String,Number],default:1/0,validator:function(t){return 1/0}},minimum:{type:[String,Number],default:0,validator:function(t){return parseInt(t,10)==t}},help:{type:[String,Boolean],default:!1},helpPosition:{type:[String,Boolean],default:!1},isGrouped:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},removePosition:{type:[String,Boolean],default:!1},repeatable:{type:Boolean,default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live","submit","value"].includes(t)}},showErrors:{type:Boolean,default:!1},groupErrors:{type:Object,default:function(){return{}},validator:function(t){var e=/^\d+\./;return!Object.keys(t).some((function(t){return!e.test(t)}))}},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}},checked:{type:[String,Boolean],default:!1},disableErrors:{type:Boolean,default:!1},addLabel:{type:[Boolean,String],default:!0},removeLabel:{type:[Boolean,String],default:!1},keepModelData:{type:[Boolean,String],default:"inherit"},ignored:{type:[Boolean,String],default:!1},debounce:{type:[Boolean,Number],default:!1},preventDeregister:{type:Boolean,default:!1}},data:function(){return{defaultId:this.$formulate.nextId(this),localAttributes:{},localErrors:[],localGroupErrors:{},proxy:this.getInitialValue(),behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve(),ruleRegistry:[],messageRegistry:{},touched:!1,debounceDelay:this.debounce,dSet:function(e,r,n){var o=this;t&&clearTimeout(t),t=setTimeout((function(){return e.call.apply(e,[o].concat(r))}),n)},mntd:!1};var t},computed:Object.assign({},_n,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)},parsedValidationRules:function(){var t=this,e={};return Object.keys(this.validationRules).forEach((function(r){e[$e(r)]=t.validationRules[r]})),e},parsedValidation:function(){return Re(this.validation,this.$formulate.rules(this.parsedValidationRules))},messages:function(){var t=this,e={};return Object.keys(this.validationMessages).forEach((function(r){e[$e(r)]=t.validationMessages[r]})),Object.keys(this.messageRegistry).forEach((function(r){e[$e(r)]=t.messageRegistry[r]})),e}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},proxy:{handler:function(t,e){this.performValidation(),this.isVmodeled||De(t,e,"group"===this.type)||(this.context.model=t),this.validateDependents(this),!this.touched&&t&&(this.touched=!0)},deep:!0},formulateValue:{handler:function(t,e){this.isVmodeled&&!De(t,e,"group"===this.type)&&(this.context.model=t)},deep:!0},showValidationErrors:{handler:function(t){this.$emit("error-visibility",t)},immediate:!0},validation:{handler:function(){this.performValidation()},deep:!0},touched:function(t){"value"===this.errorBehavior&&t&&(this.behavioralErrorVisibility=t)},debounce:function(t){this.debounceDelay=t}},created:function(){this.applyInitialValue(),this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.applyDefaultValue(),this.disableErrors||"function"!=typeof this.observeErrors||(this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),"group"===this.type&&this.observeErrors({callback:this.setGroupErrors,type:"group",field:this.nameOrFallback})),this.updateLocalAttributes(this.$attrs),this.performValidation(),this.hasValue&&(this.touched=!0)},mounted:function(){this.mntd=!0},beforeDestroy:function(){this.disableErrors||"function"!=typeof this.removeErrorObserver||(this.removeErrorObserver(this.setErrors),"group"===this.type&&this.removeErrorObserver(this.setGroupErrors)),"function"!=typeof this.formulateDeregister||this.preventDeregister||this.formulateDeregister(this.nameOrFallback)},methods:{getInitialValue:function(){var t=this.$formulate.classify(this.type);return"box"===(t="box"===t&&this.options?"group":t)&&this.checked?this.value||!0:Ne(this.$options.propsData,"value")&&"box"!==t?this.value:Ne(this.$options.propsData,"formulateValue")?this.formulateValue:"group"===t?Object.defineProperty("group"===this.type?[{}]:[],"__init",{value:!0}):""},applyInitialValue:function(){De(this.context.model,this.proxy)||"box"===this.classification&&!Ne(this.$options.propsData,"options")||(this.context.model=this.proxy,this.$emit("input",this.proxy))},applyDefaultValue:function(){"select"===this.type&&!this.context.placeholder&&Ue(this.proxy)&&!this.isVmodeled&&!1===this.value&&this.context.options.length&&(Ne(this.$attrs,"multiple")?this.context.model=[]:this.context.model=this.context.options[0].value)},updateLocalAttributes:function(t){De(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=Re(this.validation,this.$formulate.rules(this.parsedValidationRules));return e=this.ruleRegistry.length?this.ruleRegistry.concat(e):e,this.pendingValidation=this.runRules(e).then((function(e){return t.didValidate(e)})),this.pendingValidation},runRules:function(t){var e=this,r=function(t){var r=t[0],n=t[1],o=t[2],i=(t[3],r.apply(void 0,[{value:e.context.model,getFormValues:function(){for(var t,r=[],n=arguments.length;n--;)r[n]=arguments[n];return(t=e).getFormValues.apply(t,[e].concat(r))},getGroupValues:function(){for(var t,r=[],n=arguments.length;n--;)r[n]=arguments[n];return(t=e)["get"+(e.getGroupValues?"Group":"Form")+"Values"].apply(t,[e].concat(r))},name:e.context.name}].concat(n)));return(i=i instanceof Promise?i:Promise.resolve(i)).then((function(t){return!t&&e.getMessage(o,n)}))};return new Promise((function(e){var n=function(t,o){void 0===o&&(o=[]);var i=t.shift();Array.isArray(i)&&i.length?Promise.all(i.map(r)).then((function(t){return t.filter((function(t){return!!t}))})).then((function(r){return(r=Array.isArray(r)?r:[]).length&&i.bail||!t.length?e(o.concat(r).filter((function(t){return!Ue(t)}))):n(t,o.concat(r))})):e([])};n(function(t){var e=[],r=t.findIndex((function(t){return"bail"===t[2].toLowerCase()})),n=t.findIndex((function(t){return"optional"===t[2].toLowerCase()}));if(n>=0){var o=t.splice(n,1);e.push(Object.defineProperty(o,"bail",{value:!0}))}if(r>=0){var i=t.splice(0,r+1).slice(0,-1);i.length&&e.push(i),t.map((function(t){return e.push(Object.defineProperty([t],"bail",{value:!0}))}))}else e.push(t);return e.reduce((function(t,e){var r=function(t,e){if(void 0===e&&(e=!1),t.length<2)return Object.defineProperty([t],"bail",{value:e});var n=[],o=t.findIndex((function(t){return"^"===t[3]}));if(o>=0){var i=t.splice(0,o);i.length&&n.push.apply(n,r(i,e)),n.push(Object.defineProperty([t.shift()],"bail",{value:!0})),t.length&&n.push.apply(n,r(t,e))}else n.push(t);return n};return t.concat(r(e))}),[])}(t))}))},didValidate:function(t){var e=!De(t,this.validationErrors);if(this.validationErrors=t,e){var r=this.getErrorObject();this.$emit("validation",r),this.formulateFieldValidation&&"function"==typeof this.formulateFieldValidation&&this.formulateFieldValidation(r)}},getMessage:function(t,e){var r=this;return this.getMessageFunc(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues(this),getFormValues:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];return(t=r).getFormValues.apply(t,[r].concat(e))},getGroupValues:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];return(t=r)["get"+(r.getGroupValues?"Group":"Form")+"Values"].apply(t,[r].concat(e))}})},getMessageFunc:function(t){var e=this;if("optional"===(t=$e(t)))return function(){return[]};if(this.messages&&void 0!==this.messages[t])switch(typeof this.messages[t]){case"function":return this.messages[t];case"string":case"boolean":return function(){return e.messages[t]}}return function(r){return e.$formulate.validationMessage(t,r,e)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))},getValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){return t.pendingValidation.then((function(){return e(t.getErrorObject())}))}))}))},getErrorObject:function(){return{name:this.context.nameOrFallback||this.context.name,errors:this.validationErrors.filter((function(t){return"string"==typeof t})),hasErrors:!!this.validationErrors.length}},setErrors:function(t){this.localErrors=Ie(t)},setGroupErrors:function(t){this.localGroupErrors=t},registerRule:function(t,e,r,n){void 0===n&&(n=null),this.ruleRegistry.some((function(t){return t[2]===r}))||(this.ruleRegistry.push([t,e,r]),null!==n&&(this.messageRegistry[r]=n))},removeRule:function(t){var e=this.ruleRegistry.findIndex((function(e){return e[2]===t}));e>=0&&(this.ruleRegistry.splice(e,1),delete this.messageRegistry[t])}}},Sn=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.outer,attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-has-value":t.hasValue,"data-type":t.type}},[r("div",{class:t.context.classes.wrapper},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,t._g(t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.component,!1),t.listeners),[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():r(t.context.slotComponents.errors,t._b({tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}},"component",t.context.slotProps.errors,!1))],null,t.context)],2)};Sn._withStripped=!0;var On=Fe({render:Sn,staticRenderFns:[]},void 0,Pn,void 0,!1,void 0,!1,void 0,void 0,void 0),Vn={inject:{observeErrors:{default:!1},removeErrorObserver:{default:!1},observeContext:{default:!1},removeContextObserver:{default:!1}},props:{context:{type:Object,default:function(){return{}}},type:{type:String,default:"form"}},data:function(){return{boundSetErrors:this.setErrors.bind(this),boundSetFormContext:this.setFormContext.bind(this),localErrors:[],formContext:{classes:{formErrors:"formulate-form-errors",formError:"formulate-form-error"}}}},computed:{visibleValidationErrors:function(){return Array.isArray(this.context.visibleValidationErrors)?this.context.visibleValidationErrors:[]},errors:function(){return Array.isArray(this.context.errors)?this.context.errors:[]},mergedErrors:function(){return this.errors.concat(this.localErrors)},visibleErrors:function(){return Array.from(new Set(this.mergedErrors.concat(this.visibleValidationErrors))).filter((function(t){return"string"==typeof t}))},outerClass:function(){return"input"===this.type&&this.context.classes?this.context.classes.errors:this.formContext.classes.formErrors},itemClass:function(){return"input"===this.type&&this.context.classes?this.context.classes.error:this.formContext.classes.formError},role:function(){return"form"===this.type?"alert":"status"},ariaLive:function(){return"form"===this.type?"assertive":"polite"},slotComponent:function(){return this.$formulate.slotComponent(null,"errorList")}},created:function(){"form"===this.type&&"function"==typeof this.observeErrors&&(Array.isArray(this.context.errors)||this.observeErrors({callback:this.boundSetErrors,type:"form"}),this.observeContext(this.boundSetFormContext))},destroyed:function(){"form"===this.type&&"function"==typeof this.removeErrorObserver&&(Array.isArray(this.context.errors)||this.removeErrorObserver(this.boundSetErrors),this.removeContextObserver(this.boundSetFormContext))},methods:{setErrors:function(t){this.localErrors=Ie(t)},setFormContext:function(t){this.formContext=t}}},jn=function(){var t=this.$createElement;return(this._self._c||t)(this.slotComponent,{tag:"component",attrs:{"visible-errors":this.visibleErrors,"item-class":this.itemClass,"outer-class":this.outerClass,role:this.role,"aria-live":this.ariaLive,type:this.type}})};jn._withStripped=!0;var Dn=Fe({render:jn,staticRenderFns:[]},void 0,Vn,void 0,!1,void 0,!1,void 0,void 0,void 0),$n={props:{context:{type:Object,required:!0}}},Bn=function(){var t=this.$createElement,e=this._self._c||t;return this.context.help?e("div",{class:this.context.classes.help,attrs:{id:this.context.id+"-help"},domProps:{textContent:this._s(this.context.help)}}):this._e()};Bn._withStripped=!0;var In=Fe({render:Bn,staticRenderFns:[]},void 0,$n,void 0,!1,void 0,!1,void 0,void 0,void 0),Rn={props:{file:{type:Object,required:!0},imagePreview:{type:Boolean,default:!1},context:{type:Object,required:!0}}},Mn=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.file},[t.imagePreview&&t.file.previewData?r("div",{class:t.context.classes.fileImagePreview},[r("img",{class:t.context.classes.fileImagePreviewImage,attrs:{src:t.file.previewData}})]):t._e(),t._v(" "),r("div",{class:t.context.classes.fileName,attrs:{title:t.file.name},domProps:{textContent:t._s(t.file.name)}}),t._v(" "),!1!==t.file.progress?r("div",{class:t.context.classes.fileProgress,attrs:{"data-just-finished":t.file.justFinished,"data-is-finished":!t.file.justFinished&&t.file.complete}},[r("div",{class:t.context.classes.fileProgressInner,style:{width:t.file.progress+"%"}})]):t._e(),t._v(" "),t.file.complete&&!t.file.justFinished||!1===t.file.progress?r("div",{class:t.context.classes.fileRemove,on:{click:t.file.removeFile}}):t._e()])};Mn._withStripped=!0;var Ln=Fe({render:Mn,staticRenderFns:[]},void 0,Rn,void 0,!1,void 0,!1,void 0,void 0,void 0),Nn={name:"FormulateGrouping",props:{context:{type:Object,required:!0}},provide:function(){return{isSubField:function(){return!0},registerProvider:this.registerProvider,deregisterProvider:this.deregisterProvider}},data:function(){return{providers:[],keys:[]}},inject:["formulateRegisterRule","formulateRemoveRule"],computed:{items:function(){var t=this;return Array.isArray(this.context.model)?this.context.repeatable||0!==this.context.model.length?this.context.model.length=this.context.minimum&&!this.context.model.__init?this.context.model.splice(t,1,this.setId(e,t)):this.context.model=this.items.map((function(n,o){return o===t?r.setId(e,t):n}))},removeItem:function(t){var e=this;Array.isArray(this.context.model)&&this.context.model.length>this.context.minimum?(this.context.model=this.context.model.filter((function(e,r){return r!==t&&e})),this.context.rootEmit("repeatableRemoved",this.context.model)):!Array.isArray(this.context.model)&&this.items.length>this.context.minimum&&(this.context.model=new Array(this.items.length-1).fill("").map((function(t,r){return e.setId({},r)})),this.context.rootEmit("repeatableRemoved",this.context.model))},registerProvider:function(t){this.providers.some((function(e){return e===t}))||this.providers.push(t)},deregisterProvider:function(t){this.providers=this.providers.filter((function(e){return e!==t}))},setId:function(t,e){return t.__id?t:Te(t,this.keys[e])}}},Tn=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{class:t.context.classes.grouping,attrs:{name:"grouping",context:t.context,"force-wrap":t.context.repeatable}},t._l(t.items,(function(e,n){return r("FormulateRepeatableProvider",{key:e.__id,attrs:{index:n,context:t.context,uuid:e.__id,errors:t.groupErrors[n]},on:{remove:t.removeItem,input:function(e){return t.setItem(n,e)}}},[t._t("default")],2)})),1)};Tn._withStripped=!0;var Un=Fe({render:Tn,staticRenderFns:[]},void 0,Nn,void 0,!1,void 0,!1,void 0,void 0,void 0),Gn={props:{context:{type:Object,required:!0}}},Hn=function(){var t=this.$createElement;return(this._self._c||t)("label",{class:this.context.classes.label,attrs:{id:this.context.id+"_label",for:this.context.id},domProps:{textContent:this._s(this.context.label)}})};Hn._withStripped=!0;var qn=Fe({render:Hn,staticRenderFns:[]},void 0,Gn,void 0,!1,void 0,!1,void 0,void 0,void 0),Wn={props:{context:{type:Object,required:!0},addMore:{type:Function,required:!0}}},zn=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{class:this.context.classes.groupAddMore},[e("FormulateInput",{attrs:{type:"button",label:this.context.addLabel,"data-minor":"","data-ghost":""},on:{click:this.addMore}})],1)};zn._withStripped=!0;var Yn=Fe({render:zn,staticRenderFns:[]},void 0,Wn,void 0,!1,void 0,!1,void 0,void 0,void 0),Zn={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},attributes:function(){return this.context.attributes||{}},hasValue:function(){return this.context.hasValue}}},Kn={name:"FormulateInputBox",mixins:[Zn],computed:{usesDecorator:function(){return this.$formulate.options.useInputDecorators}}},Jn=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type}},[r("FormulateSlot",{attrs:{name:"prefix",context:t.context}},[t.context.slotComponents.prefix?r(t.context.slotComponents.prefix,{tag:"component",attrs:{context:t.context}}):t._e()],1),t._v(" "),"radio"===t.type?r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1),t.$listeners)):r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,o=!!n.checked;if(Array.isArray(r)){var i=t.context.value,s=t._i(r,i);n.checked?s<0&&t.$set(t.context,"model",r.concat([i])):s>-1&&t.$set(t.context,"model",r.slice(0,s).concat(r.slice(s+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1),t.$listeners)),t._v(" "),t.usesDecorator?r("label",{tag:"component",class:t.context.classes.decorator,attrs:{for:t.attributes.id}}):t._e(),t._v(" "),r("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?r(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};Jn._withStripped=!0;var Xn=Fe({render:Jn,staticRenderFns:[]},void 0,Kn,void 0,!1,void 0,!1,void 0,void 0,void 0),Qn={props:{visibleErrors:{type:Array,required:!0},itemClass:{type:[String,Array,Object,Boolean],default:!1},outerClass:{type:[String,Array,Object,Boolean],default:!1},role:{type:[String],default:"status"},ariaLive:{type:[String,Boolean],default:"polite"},type:{type:String,required:!0}}},to=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.visibleErrors.length?r("ul",{class:t.outerClass},t._l(t.visibleErrors,(function(e){return r("li",{key:e,class:t.itemClass,attrs:{role:t.role,"aria-live":t.ariaLive},domProps:{textContent:t._s(e)}})})),0):t._e()};to._withStripped=!0;var eo=Fe({render:to,staticRenderFns:[]},void 0,Qn,void 0,!1,void 0,!1,void 0,void 0,void 0),ro={name:"FormulateInputText",mixins:[Zn]},no=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type}},[r("FormulateSlot",{attrs:{name:"prefix",context:t.context}},[t.context.slotComponents.prefix?r(t.context.slotComponents.prefix,{tag:"component",attrs:{context:t.context}}):t._e()],1),t._v(" "),"checkbox"===t.type?r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,o=!!n.checked;if(Array.isArray(r)){var i=t._i(r,null);n.checked?i<0&&t.$set(t.context,"model",r.concat([null])):i>-1&&t.$set(t.context,"model",r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1),t.$listeners)):"radio"===t.type?r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1),t.$listeners)):r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1),t.$listeners)),t._v(" "),r("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?r(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};no._withStripped=!0;var oo=Fe({render:no,staticRenderFns:[]},void 0,ro,void 0,!1,void 0,!1,void 0,void 0,void 0),io={name:"FormulateFiles",props:{files:{type:Ve,required:!0},imagePreview:{type:Boolean,default:!1},context:{type:Object,required:!0}},computed:{fileUploads:function(){return this.files.files||[]},isMultiple:function(){return Ne(this.context.attributes,"multiple")}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()},methods:{appendFiles:function(){var t=this.$refs.addFiles;t.files.length&&this.files.mergeFileList(t)}}},so=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.fileUploads.length?r("ul",{class:t.context.classes.files},[t._l(t.fileUploads,(function(e){return r("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":!(!t.imagePreview||!e.previewData)}},[r("FormulateSlot",{attrs:{name:"file",context:t.context,file:e,"image-preview":t.imagePreview}},[r(t.context.slotComponents.file,{tag:"component",attrs:{context:t.context,file:e,"image-preview":t.imagePreview}})],1),t._v(" "),e.error?r("div",{class:t.context.classes.fileUploadError,domProps:{textContent:t._s(e.error)}}):t._e()],1)})),t._v(" "),t.isMultiple&&t.context.addLabel?r("div",{class:t.context.classes.fileAdd,attrs:{role:"button"}},[t._v("\n "+t._s(t.context.addLabel)+"\n "),r("input",{ref:"addFiles",class:t.context.classes.fileAddInput,attrs:{type:"file",multiple:""},on:{change:t.appendFiles}})]):t._e()],2):t._e()};so._withStripped=!0;var ao={name:"FormulateInputFile",components:{FormulateFiles:Fe({render:so,staticRenderFns:[]},void 0,io,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[Zn],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof Ve&&this.context.model.files.length)}},created:function(){Array.isArray(this.context.model)&&"string"==typeof this.context.model[0][this.$formulate.getFileUrlKey()]&&(this.context.model=this.$formulate.createUpload({files:this.context.model},this.context))},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){var t=this;this.isOver=!1;var e=this.$refs.file;e.files.length&&(this.context.model=this.$formulate.createUpload(e,this.context),this.$nextTick((function(){return t.attemptImmediateUpload()})))},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof Ve&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},uo=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[r("FormulateSlot",{attrs:{name:"prefix",context:t.context}},[t.context.slotComponents.prefix?r(t.context.slotComponents.prefix,{tag:"component",attrs:{context:t.context}}):t._e()],1),t._v(" "),r("div",{class:t.context.classes.uploadArea,attrs:{"data-has-files":t.hasFiles}},[r("input",t._g(t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1),t.$listeners)),t._v(" "),r("FormulateSlot",{attrs:{name:"uploadAreaMask",context:t.context,"has-files":t.hasFiles}},[r(t.context.slotComponents.uploadAreaMask,{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],tag:"component",class:t.context.classes.uploadAreaMask,attrs:{"has-files":"div"!==t.context.slotComponents.uploadAreaMask&&t.hasFiles,"data-has-files":"div"===t.context.slotComponents.uploadAreaMask&&t.hasFiles}})],1),t._v(" "),t.hasFiles?r("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior,context:t.context}}):t._e()],1),t._v(" "),r("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?r(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};uo._withStripped=!0;var lo=Fe({render:uo,staticRenderFns:[]},void 0,ao,void 0,!1,void 0,!1,void 0,void 0,void 0),co={props:{context:{type:Object,required:!0},removeItem:{type:Function,required:!0},index:{type:Number,required:!0}}},ho=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.groupRepeatable},["after"===t.context.removePosition?t._t("default"):t._e(),t._v(" "),r("FormulateSlot",{attrs:{name:"remove",context:t.context,index:t.index,"remove-item":t.removeItem}},[r(t.context.slotComponents.remove,t._b({tag:"component",attrs:{context:t.context,index:t.index,"remove-item":t.removeItem}},"component",t.context.slotProps.remove,!1))],1),t._v(" "),"before"===t.context.removePosition?t._t("default"):t._e()],2)};ho._withStripped=!0;var po=Fe({render:ho,staticRenderFns:[]},void 0,co,void 0,!1,void 0,!1,void 0,void 0,void 0);function fo(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}var mo={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},subType:function(){return"group"===this.context.type?"grouping":"inputs"},optionsWithContext:function(){var t=this,e=this.context,r=e.attributes,n=(r.id,fo(r,["id"])),o=(e.blurHandler,e.classification,e.component,e.getValidationErrors,e.hasLabel,e.hasValidationErrors,e.isSubField,e.isValid,e.labelPosition,e.options,e.performValidation,e.setErrors,e.slotComponents,e.slotProps,e.validationErrors,e.visibleValidationErrors,e.classes,e.showValidationErrors,e.rootEmit,e.help,e.pseudoProps,e.rules,e.model,fo(e,["attributes","blurHandler","classification","component","getValidationErrors","hasLabel","hasValidationErrors","isSubField","isValid","labelPosition","options","performValidation","setErrors","slotComponents","slotProps","validationErrors","visibleValidationErrors","classes","showValidationErrors","rootEmit","help","pseudoProps","rules","model"]));return this.options.map((function(e){return t.groupItemContext(o,e,n)}))},totalItems:function(){return Array.isArray(this.context.model)&&this.context.model.length>this.context.minimum?this.context.model.length:this.context.minimum||1},canAddMore:function(){return this.context.repeatable&&this.totalItems-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,o=!!n.checked;if(Array.isArray(r)){var i=t._i(r,null);n.checked?i<0&&t.$set(t.context,"model",r.concat([null])):i>-1&&t.$set(t.context,"model",r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1),t.$listeners)):"radio"===t.type?r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1),t.$listeners)):r("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1),t.$listeners)),t._v(" "),t.context.showValue?r("div",{class:t.context.classes.rangeValue,domProps:{textContent:t._s(t.context.model)}}):t._e(),t._v(" "),r("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?r(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};Ao._withStripped=!0;var wo=Fe({render:Ao,staticRenderFns:[]},void 0,Fo,void 0,!1,void 0,!1,void 0,void 0,void 0),Co={props:{context:{type:Object,required:!0}}},Po=function(){var t=this.$createElement;return(this._self._c||t)("span",{class:"formulate-input-element--"+this.context.type+"--label",domProps:{textContent:this._s(this.context.value||this.context.label||this.context.name||"Submit")}})};Po._withStripped=!0;var So=Fe({render:Po,staticRenderFns:[]},void 0,Co,void 0,!1,void 0,!1,void 0,void 0,void 0),Oo={name:"FormulateInputTextArea",mixins:[Zn]},Vo=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.context.classes.element,attrs:{"data-type":"textarea"}},[r("FormulateSlot",{attrs:{name:"prefix",context:t.context}},[t.context.slotComponents.prefix?r(t.context.slotComponents.prefix,{tag:"component",attrs:{context:t.context}}):t._e()],1),t._v(" "),r("textarea",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1),t.$listeners)),t._v(" "),r("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?r(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};Vo._withStripped=!0;var jo=Fe({render:Vo,staticRenderFns:[]},void 0,Oo,void 0,!1,void 0,!1,void 0,void 0,void 0),Do={provide:function(){var t=this;return Object.assign({},vn(this,["getFormValues"]),{formulateSetter:function(e,r){return t.setGroupValue(e,r)}})},inject:{registerProvider:"registerProvider",deregisterProvider:"deregisterProvider"},props:{index:{type:Number,required:!0},context:{type:Object,required:!0},uuid:{type:String,required:!0},errors:{type:Object,required:!0}},data:function(){return Object.assign({},dn(this),{isGrouping:!0})},computed:Object.assign({},fn(),{mergedFieldErrors:function(){return this.errors}}),watch:Object.assign({},{mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type})).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0},mergedGroupErrors:{handler:function(t){this.errorObservers.filter((function(t){return"group"===t.type})).forEach((function(e){return e.callback(t[e.field]||{})}))},immediate:!0}},{"context.model":{handler:function(t){De(t[this.index],this.proxy,!0)||this.setValues(t[this.index])},deep:!0}}),created:function(){this.applyInitialValues(),this.registerProvider(this)},beforeDestroy:function(){this.preventCleanup=!0,this.deregisterProvider(this)},methods:Object.assign({},mn(),{setGroupValue:function(t,e){De(this.proxy[t],e,!0)||this.setFieldValue(t,e)},removeItem:function(){this.$emit("remove",this.index)}})},$o=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{attrs:{name:"repeatable",context:t.context,index:t.index,"remove-item":t.removeItem}},[r(t.context.slotComponents.repeatable,t._b({tag:"component",attrs:{context:t.context,index:t.index,"remove-item":t.removeItem}},"component",t.context.slotProps.repeatable,!1),[r("FormulateSlot",{attrs:{context:t.context,index:t.index,name:"default"}})],1)],1)};$o._withStripped=!0;var Bo=Fe({render:$o,staticRenderFns:[]},void 0,Do,void 0,!1,void 0,!1,void 0,void 0,void 0),Io={props:{index:{type:Number,default:null},context:{type:Object,required:!0},removeItem:{type:Function,required:!0}}},Ro=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.context.repeatable?r("a",{class:t.context.classes.groupRepeatableRemove,attrs:{"data-disabled":t.context.model.length<=t.context.minimum,role:"button"},domProps:{textContent:t._s(t.context.removeLabel)},on:{click:function(e){return e.preventDefault(),t.removeItem(e)},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.removeItem(e)}}}):t._e()};Ro._withStripped=!0;var Mo=Fe({render:Ro,staticRenderFns:[]},void 0,Io,void 0,!1,void 0,!1,void 0,void 0,void 0),Lo=function(){this.options={},this.defaults={components:{FormulateSlot:un,FormulateForm:bn,FormulateFile:Ln,FormulateHelp:In,FormulateLabel:qn,FormulateInput:On,FormulateErrors:Dn,FormulateSchema:cn,FormulateAddMore:Yn,FormulateGrouping:Un,FormulateInputBox:Xn,FormulateInputText:oo,FormulateInputFile:lo,FormulateErrorList:eo,FormulateRepeatable:po,FormulateInputGroup:yo,FormulateInputButton:bo,FormulateInputSelect:Eo,FormulateInputSlider:wo,FormulateButtonContent:So,FormulateInputTextArea:jo,FormulateRepeatableRemove:Mo,FormulateRepeatableProvider:Bo},slotComponents:{addMore:"FormulateAddMore",buttonContent:"FormulateButtonContent",errorList:"FormulateErrorList",errors:"FormulateErrors",file:"FormulateFile",help:"FormulateHelp",label:"FormulateLabel",prefix:!1,remove:"FormulateRepeatableRemove",repeatable:"FormulateRepeatable",suffix:!1,uploadAreaMask:"div"},slotProps:{},library:Zr,rules:Kr,mimes:Xr,locale:!1,uploader:sn,uploadUrl:!1,fileUrlKey:"url",uploadJustCompleteDuration:1e3,errorHandler:function(t){return t},plugins:[p],locales:{},failedValidation:function(){return!1},idPrefix:"formulate-",baseClasses:function(t){return t},coreClasses:on,classes:{},useInputDecorators:!0,validationNameStrategy:!1},this.registry=new Map,this.idRegistry={}};Lo.prototype.install=function(t,e){var r=this;t.prototype.$formulate=this,this.options=this.defaults;var n=this.defaults.plugins;for(var o in e&&Array.isArray(e.plugins)&&e.plugins.length&&(n=n.concat(e.plugins)),n.forEach((function(t){return"function"==typeof t?t(r):null})),this.extend(e||{}),this.options.components)t.component(o,this.options.components[o])},Lo.prototype.nextId=function(t){var e=!(!t.$route||!t.$route.path)&&t.$route.path?t.$route.path.replace(/[/\\.\s]/g,"-"):"global";return Object.prototype.hasOwnProperty.call(this.idRegistry,e)||(this.idRegistry[e]=0),""+this.options.idPrefix+e+"-"+ ++this.idRegistry[e]},Lo.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge(this.options,t),this;throw new Error("Formulate.extend expects an object, was "+typeof t)},Lo.prototype.merge=function(t,e,r){void 0===r&&(r=!0);var n={};for(var o in t)e.hasOwnProperty(o)?l(e[o])&&l(t[o])?n[o]=this.merge(t[o],e[o],r):r&&Array.isArray(t[o])&&Array.isArray(e[o])?n[o]=t[o].concat(e[o]):n[o]=e[o]:n[o]=t[o];for(var i in e)n.hasOwnProperty(i)||(n[i]=e[i]);return n},Lo.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},Lo.prototype.classes=function(t){var e=this,r=this.options.coreClasses(t),n=this.options.baseClasses(r,t);return Object.keys(n).reduce((function(r,o){var i,s=nn(n[o],e.options.classes[o],t);return s=function(t,e,r,n){return Object.keys(tn).reduce((function(e,o){if(tn[o](n)){var i=""+t+Be(o),s=i+"Class";if(r[i])e=nn(e,"string"==typeof r[i]?Ie(r[i]):r[i],n);if(n[s])e=nn(e,"string"==typeof n[s]?Ie(n[s]):n[i+"Class"],n)}return e}),e)}(o,s=nn(s,t[o+"Class"],t),e.options.classes,t),Object.assign(r,((i={})[o]=s,i))}),{})},Lo.prototype.typeProps=function(t){var e=function(t){return Object.keys(t).reduce((function(e,r){return Array.isArray(t[r])?e.concat(t[r]):e}),[])},r=e(this.options.slotProps);return this.options.library[t]?r.concat(e(this.options.library[t].slotProps||{})):r},Lo.prototype.slotProps=function(t,e,r){var n=Array.isArray(this.options.slotProps[e])?this.options.slotProps[e]:[],o=this.options.library[t];return o&&o.slotProps&&Array.isArray(o.slotProps[e])&&(n=n.concat(o.slotProps[e])),n.reduce((function(t,e){var n;return Object.assign(t,((n={})[e]=r[e],n))}),{})},Lo.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},Lo.prototype.slotComponent=function(t,e){var r=this.options.library[t];return r&&r.slotComponents&&r.slotComponents[e]?r.slotComponents[e]:this.options.slotComponents[e]},Lo.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},Lo.prototype.i18n=function(t){if(t.$i18n)switch(typeof t.$i18n.locale){case"string":return t.$i18n.locale;case"function":return t.$i18n.locale()}return!1},Lo.prototype.getLocale=function(t){var e=this;return this.selectedLocale||(this.selectedLocale=[this.options.locale,this.i18n(t),"en"].reduce((function(t,r){if(t)return t;if(r){var n=function(t){return t.split("-").reduce((function(t,e){return t.length&&t.unshift(t[0]+"-"+e),t.length?t:[e]}),[])}(r).find((function(t){return Ne(e.options.locales,t)}));n&&(t=n)}return t}),!1)),this.selectedLocale},Lo.prototype.setLocale=function(t){Ne(this.options.locales,t)&&(this.options.locale=t,this.selectedLocale=t,this.registry.forEach((function(t,e){t.hasValidationErrors()})))},Lo.prototype.validationMessage=function(t,e,r){var n=this.options.locales[this.getLocale(r)];return n.hasOwnProperty(t)?n[t](e):n.hasOwnProperty("default")?n.default(e):"Invalid field value"},Lo.prototype.register=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.set(t.name,t)},Lo.prototype.deregister=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.has(t.name)&&this.registry.delete(t.name)},Lo.prototype.handle=function(t,e,r){void 0===r&&(r=!1);var n=r?t:this.options.errorHandler(t,e);return e&&this.registry.has(e)&&this.registry.get(e).applyErrors({formErrors:Ie(n.formErrors),inputErrors:n.inputErrors||{}}),n},Lo.prototype.reset=function(t,e){void 0===e&&(e={}),this.resetValidation(t),this.setValues(t,e)},Lo.prototype.submit=function(t){this.registry.get(t).formSubmitted()},Lo.prototype.resetValidation=function(t){var e=this.registry.get(t);e.hideErrors(t),e.namedErrors=[],e.namedFieldErrors={}},Lo.prototype.setValues=function(t,e){e&&!Array.isArray(e)&&"object"==typeof e&&this.registry.get(t).setValues(Object.assign({},e))},Lo.prototype.getUploader=function(){return this.options.uploader||!1},Lo.prototype.getUploadUrl=function(){return this.options.uploadUrl||!1},Lo.prototype.getFileUrlKey=function(){return this.options.fileUrlKey||"url"},Lo.prototype.createUpload=function(t,e){return new Ve(t,e,this.options)},Lo.prototype.failedValidation=function(t){return this.options.failedValidation(this)};var No=new Lo,To={FormulateForm:We,FormulateSchema:Oe,FormulateInput:Ce},Uo={formEvents:Ye,enforceNumber:zr,textMask:Wr};return t.components=To,t.default=function(t){void 0===t&&(t={});var e=No.merge({features:{formEvents:!0,textMask:!1,enforceNumber:!1},override:{FormulateForm:!0,FormulateInput:!0,FormulateSchema:!0}},t);return function(t){e.override.FormulateForm&&t.extend({components:{FormulateForm:We}}),e.override.FormulateInput&&t.extend({components:{FormulateInput:Ce}}),e.override.FormulateSchema&&t.extend({components:{FormulateSchema:Oe}}),e.features.formEvents&&t.extend(Ye),e.features.textMask&&t.extend(Wr),e.features.enforceNumber&&t.extend(zr)}},t.features=Uo,t}({}); diff --git a/lib/vue-formulate-extended.umd.js b/lib/vue-formulate-extended.umd.js index 863cc2f..ab2a821 100644 --- a/lib/vue-formulate-extended.umd.js +++ b/lib/vue-formulate-extended.umd.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@braid/vue-formulate"),require("@braid/vue-formulate/src/libs/utils.js"),require("imask"),require("@braid/vue-formulate/src/Formulate")):"function"==typeof define&&define.amd?define(["exports","@braid/vue-formulate","@braid/vue-formulate/src/libs/utils.js","imask","@braid/vue-formulate/src/Formulate"],e):e((t=t||self).VueFormulateExtended={},t.VueFormulate,t.utils_js,t.IMask,t.Formulate$1)}(this,(function(t,e,o,n,r){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n,r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var s=function(t){return void 0===t&&(t=[]),this.defaultHook=function(t){return t},this.setHooks(t)};s.prototype.parse=function(t){void 0===t&&(t=[]);var e=Array.isArray(t)?t:[];for(var o of e)this.isProperHook(o)&&this.hooks.push(o);return this},s.prototype.addHook=function(t){return this.isProperHook(t)&&this.isNewHook(t)&&this.hooks.push(t),this},s.prototype.setHooks=function(t){return void 0===t&&(t=[]),this.hooks=t.filter(this.isProperHook),this},s.prototype.setDefault=function(t){return this.defaultHook=t,this},s.prototype.isProperHook=function(t){return t&&"object"==typeof t&&"function"==typeof t.handler},s.prototype.isNewHook=function(t){return this.hooks.findIndex((function(e){return e===t}))<0},s.prototype.getHooks=function(){return this.hooks},s.prototype.empty=function(){return 0===this.hooks.length},s.prototype.apply=function(t,e){return this.empty()?this.defaultHook(t,e):this.hooks.reduce((function(t,o){return o.handler(t,e)}),t)},s.prototype.asSingleHook=function(){var t=this;return{handler:function(e,o){return t.apply(e,o)}}};var a={type:Object,default:function(){return{model:[],schema:[],schemaOptions:[],schemaNode:[],schemaComponent:[]}}};var i=e.defaults.components.FormulateInput,c=i.props,l=(i.created,i.watch),u=i.computed,p=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(o[n]=t[n]);return o}(i,["props","created","watch","computed"]);function h(t,e,o,n,r,s,a,i,c,l){"boolean"!=typeof a&&(c=i,i=a,a=!1);var u,p="function"==typeof o?o.options:o;if(t&&t.render&&(p.render=t.render,p.staticRenderFns=t.staticRenderFns,p._compiled=!0,r&&(p.functional=!0)),n&&(p._scopeId=n),s?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,c(t)),t&&t._registeredComponents&&t._registeredComponents.add(s)},p._ssrRegister=u):e&&(u=a?function(t){e.call(this,l(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,i(t))}),u)if(p.functional){var h=p.render;p.render=function(t,e){return u.call(e),h(t,e)}}else{var f=p.beforeCreate;p.beforeCreate=f?[].concat(f,u):[u]}return o}var f=Object.assign({},p,{props:Object.assign({},c,{modelHook:{type:[Function,Object,Array],default:null},standalone:{type:Boolean,default:function(){return!1}}}),created:function(){this.applyInitialValue(),!this.standalone&&this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.applyDefaultValue(),this.disableErrors||"function"!=typeof this.observeErrors||this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),this.updateLocalAttributes(this.$attrs),this.performValidation()},computed:Object.assign({},u,{slotProps:function(){var t=this.$formulate.slotProps.bind(this.$formulate);return{label:t(this.type,"label",this.typeProps),help:t(this.type,"help",this.typeProps),errors:t(this.type,"errors",this.typeProps),repeatable:t(this.type,"repeatable",this.typeProps),addMore:t(this.type,"addMore",this.typeProps),remove:t(this.type,"remove",this.typeProps),component:t(this.type,"component",this.typeProps)}}}),watch:Object.assign({},l,{"context.model":{handler:function(t,e){var o=new s;Array.isArray(this.modelHook)?this.modelHook.map((function(t){return o.addHook(t)})):"function"==typeof this.modelHook?o.addHook({handler:this.modelHook}):o.addHook(this.modelHook),(this.$formulate.options.hooks&&this.$formulate.options.hooks.model?this.$formulate.options.hooks.model:[]).map((function(t){return o.addHook(t)}));var n=t;"box"===this.context.classification&&"string"==typeof t&&0===t.length&&(n=!1),t!==e&&o.hooks.length>0&&(this.context.model=o.apply(n,{oldModel:e,context:this.context}))}}})}),d=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{class:t.context.classes.outer,attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-has-value":t.hasValue,"data-type":t.type},on:{click:function(e){return t.$emit("outer-click")}}},[o("div",{class:t.context.classes.wrapper,on:{click:function(e){return t.$emit("wrapper-click")}}},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?o(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?o(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[o(t.context.component,t._g(t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.component,!1),t.listeners),[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?o(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?o(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():o(t.context.slotComponents.errors,t._b({tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}},"component",t.context.slotProps.errors,!1))],null,t.context)],2)};d._withStripped=!0;var m=h({render:d,staticRenderFns:[]},void 0,f,void 0,!1,void 0,!1,void 0,void 0,void 0);function v(t,e,o){void 0===o&&(o={});var n=o.hooks,r=o.h,a=o.state;if(t&&"object"==typeof t&&!Array.isArray(t)){var i=t.children;void 0===i&&(i=null);var c=t.component;void 0===c&&(c=m);var l=t.depth;void 0===l&&(l=1);var u=t.modelHook,p=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(o[n]=t[n]);return o}(t,["children","component","depth","modelHook"]),h=c===m?p.type||"text":"",f=p.name||h||"el",d=p.id||f+"-"+l+"-"+e,v=Array.isArray(i)?i.map((function(t){return Object.assign(t,{depth:l+1})})):i,k=(new s).setHooks(n.model).addHook(u).asSingleHook(),b=Object.assign({name:f,type:h,key:d,depth:l,component:c,definition:{attrs:Object.assign({},p,{modelHook:k})},children:y(v,{hooks:n,h:r,state:a})});return(new s).setHooks(n.schemaNode).setDefault((function(){return b})).apply(b,{state:a})}return null}function y(t,e){void 0===e&&(e={});var o=e.hooks,n=e.h,r=e.state;return Array.isArray(t)?t.map((function(t,e){var a=v(t,e,{hooks:o,h:n,state:r});return(new s).setHooks(o.schemaComponent).setDefault((function(){return n(a.component,a.definition,a.children)})).apply(a)})):t}var k={functional:!1,name:"FormulateSchema",props:{schema:e.defaults.components.FormulateForm.props.schema,hooks:a,formClass:{type:String,default:null}},data:function(){return{schemaHooks:null,schemaOptionsHooks:null}},methods:{emit:function(t,e){this.$emit(t,e)}},beforeMount:function(){this.schemaHooks=(new s).setHooks(this.hooks.schema),this.schemaOptionsHooks=(new s).setHooks(this.hooks.schemaOptions).setDefault((function(t){return t}))},render:function(t){return this.schemaHooks.apply(t("div",{class:this.$props.formClass},y(this.schema,this.schemaOptionsHooks.apply({hooks:this.hooks,h:t,state:{}},{emit:this.emit,props:this.$props}))),{emit:this.emit,props:this.$props})}},b={extends:e.defaults.components.FormulateForm,components:{FormulateSchema:k},props:{hooks:a,formClass:{type:String,default:null}},computed:{cleanedHooks:function(){var t=this,o=a.default();return Object.keys(o).forEach((function(e){o[e]=(new s).parse(t.hooks[e]).getHooks()})),e.merge(this.$formulate.options.hooks||{},o)}},watch:{formulateValue:{handler:function(t){var e=this;this.isVmodeled&&t&&"object"==typeof t&&Array.from(new Set(Object.keys(t).concat(Object.keys(this.proxy)))).forEach((function(n){o.shallowEqualObjects(t[n],e.proxy[n])||(e.setFieldValue(n,t[n]),e.registry.has(n)&&!o.shallowEqualObjects(t[n],e.registry.get(n).proxy)&&(e.registry.get(n).context.model=t[n]))}))},deep:!0}}},x=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.schema?o("FormulateSchema",{attrs:{schema:t.schema,hooks:t.cleanedHooks,formClass:t.formClass},on:{events:function(e){return t.$emit("events",e)}}}):t._e(),t._v(" "),t.hasFormErrorObservers?t._e():o("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default")],2)};x._withStripped=!0;var _=h({render:x,staticRenderFns:[]},void 0,b,void 0,!1,void 0,!1,void 0,void 0,void 0),g=function(){this.store=new Map};g.prototype.on=function(t,e){var o=this.store.get(t);o&&o.push(e)||this.store.set(t,[e])},g.prototype.off=function(t,e){var o=this.store.get(t),n=o.indexOf(e);o&&n>-1&&o.splice(n,1)},g.prototype.emit=function(t,e){this.store.get(t).slice().map((function(t){return t(e)}))};var H={hooks:{schemaOptions:[{handler:function(t,e){void 0===e&&(e={});var o=e.emit;return t.state=t.state||{},t.state.eventBus=new g,t.state.eventBus.on("events",(function(t){return o("events",t)})),t}}],schemaNode:[{handler:function(t,e){void 0===e&&(e={});var o=e.state,n=t.definition.attrs,r=n.events;void 0===r&&(r=[]);var s=n.on;void 0===s&&(s={});var a=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(o[n]=t[n]);return o}(n,["events","on"]);return t.definition.attrs=a,t.definition.on=Object.assign({},s,r.reduce((function(e,n){return e[n]=function(e){s[n]&&s[n](e),o.eventBus.emit("events",{eventName:n,name:t.name,type:t.type,key:t.key,payload:e})},e}),{})),t}}]}},O={hooks:{model:[{handler:function(t,e){var o=e.context,r="vfe-mask"in o.attributes||"vfeMask"in o.attributes;if("text"===o.classification&&r){var s=o.attributes["vfe-mask"]||o.attributes.vfeMask,a="object"==typeof s&&s.mask?s:{mask:s};return n.createMask(a).resolve(t)}return t}}]}},F={hooks:{model:[{handler:function(t,e){var o=e.context,n="string"==typeof o.attributes.vfeNumber||o.attributes.vfeNumber||"string"==typeof o.attributes["vfe-number"]||o.attributes["vfe-number"];return"number"===o.type&&"string"==typeof t&&n?+t:t}}]}},j={FormulateForm:_,FormulateSchema:k,FormulateInput:m},w={formEvents:H,enforceNumber:F,textMask:O};t.components=j,t.default=function(t){void 0===t&&(t={});var e=r.merge({features:{formEvents:!0,textMask:!1,enforceNumber:!1},override:{FormulateForm:!0,FormulateInput:!0,FormulateSchema:!0}},t);return function(t){e.override.FormulateForm&&t.extend({components:{FormulateForm:_}}),e.override.FormulateInput&&t.extend({components:{FormulateInput:m}}),e.override.FormulateSchema&&t.extend({components:{FormulateSchema:k}}),e.features.formEvents&&t.extend(H),e.features.textMask&&t.extend(O),e.features.enforceNumber&&t.extend(F)}},t.features=w,Object.defineProperty(t,"__esModule",{value:!0})})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@braid/vue-formulate"),require("@braid/vue-formulate/src/libs/utils.js"),require("imask"),require("@braid/vue-formulate/src/Formulate")):"function"==typeof define&&define.amd?define(["exports","@braid/vue-formulate","@braid/vue-formulate/src/libs/utils.js","imask","@braid/vue-formulate/src/Formulate"],e):e((t=t||self).VueFormulateExtended={},t.VueFormulate,t.utils_js,t.IMask,t.Formulate$1)}(this,(function(t,e,o,n,r){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n,r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var s=function(t){return void 0===t&&(t=[]),this.defaultHook=function(t){return t},this.setHooks(t)};s.prototype.parse=function(t){void 0===t&&(t=[]);var e=Array.isArray(t)?t:[];for(var o of e)this.isProperHook(o)&&this.hooks.push(o);return this},s.prototype.addHook=function(t){return this.isProperHook(t)&&this.isNewHook(t)&&this.hooks.push(t),this},s.prototype.setHooks=function(t){return void 0===t&&(t=[]),this.hooks=t.filter(this.isProperHook),this},s.prototype.setDefault=function(t){return this.defaultHook=t,this},s.prototype.isProperHook=function(t){return t&&"object"==typeof t&&"function"==typeof t.handler},s.prototype.isNewHook=function(t){return this.hooks.findIndex((function(e){return e===t}))<0},s.prototype.getHooks=function(){return this.hooks},s.prototype.empty=function(){return 0===this.hooks.length},s.prototype.apply=function(t,e){return this.empty()?this.defaultHook(t,e):this.hooks.reduce((function(t,o){return o.handler(t,e)}),t)},s.prototype.asSingleHook=function(){var t=this;return{handler:function(e,o){return t.apply(e,o)}}};var a={type:Object,default:function(){return{model:[],schema:[],schemaOptions:[],schemaNode:[],schemaComponent:[]}}};var i=e.defaults.components.FormulateInput,c=i.props,l=(i.created,i.watch),u=i.computed,p=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(o[n]=t[n]);return o}(i,["props","created","watch","computed"]);function h(t,e,o,n,r,s,a,i,c,l){"boolean"!=typeof a&&(c=i,i=a,a=!1);var u,p="function"==typeof o?o.options:o;if(t&&t.render&&(p.render=t.render,p.staticRenderFns=t.staticRenderFns,p._compiled=!0,r&&(p.functional=!0)),n&&(p._scopeId=n),s?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,c(t)),t&&t._registeredComponents&&t._registeredComponents.add(s)},p._ssrRegister=u):e&&(u=a?function(t){e.call(this,l(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,i(t))}),u)if(p.functional){var h=p.render;p.render=function(t,e){return u.call(e),h(t,e)}}else{var f=p.beforeCreate;p.beforeCreate=f?[].concat(f,u):[u]}return o}var f=Object.assign({},p,{props:Object.assign({},c,{modelHook:{type:[Function,Object,Array],default:null},standalone:{type:Boolean,default:function(){return!1}}}),created:function(){this.applyInitialValue(),!this.standalone&&this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.applyDefaultValue(),this.disableErrors||"function"!=typeof this.observeErrors||this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),this.updateLocalAttributes(this.$attrs),this.performValidation()},computed:Object.assign({},u,{slotProps:function(){var t=this.$formulate.slotProps.bind(this.$formulate);return{label:t(this.type,"label",this.typeProps),help:t(this.type,"help",this.typeProps),errors:t(this.type,"errors",this.typeProps),repeatable:t(this.type,"repeatable",this.typeProps),addMore:t(this.type,"addMore",this.typeProps),remove:t(this.type,"remove",this.typeProps),component:t(this.type,"component",this.typeProps)}}}),watch:Object.assign({},l,{"context.model":{handler:function(t,e){var o=new s;Array.isArray(this.modelHook)?this.modelHook.map((function(t){return o.addHook(t)})):"function"==typeof this.modelHook?o.addHook({handler:this.modelHook}):o.addHook(this.modelHook),(this.$formulate.options.hooks&&this.$formulate.options.hooks.model?this.$formulate.options.hooks.model:[]).map((function(t){return o.addHook(t)}));var n=t;"box"===this.context.classification&&"string"==typeof t&&0===t.length&&(n=!1),t!==e&&o.hooks.length>0&&(this.context.model=o.apply(n,{oldModel:e,context:this.context}))}}})}),d=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{class:t.context.classes.outer,attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-has-value":t.hasValue,"data-type":t.type},on:{click:function(e){return t.$emit("outer-click")}}},[o("div",{class:t.context.classes.wrapper,on:{click:function(e){return t.$emit("wrapper-click")}}},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?o(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?o(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[o(t.context.component,t._g(t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.component,!1),t.listeners),[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?o(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?o(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():o(t.context.slotComponents.errors,t._b({tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}},"component",t.context.slotProps.errors,!1))],null,t.context)],2)};d._withStripped=!0;var m=h({render:d,staticRenderFns:[]},void 0,f,void 0,!1,void 0,!1,void 0,void 0,void 0);function v(t,e,o){void 0===o&&(o={});var n=o.hooks,r=o.h,a=o.state;if(t&&"object"==typeof t&&!Array.isArray(t)){var i=t.children;void 0===i&&(i=null);var c=t.component;void 0===c&&(c=m);var l=t.depth;void 0===l&&(l=1);var u=t.modelHook,p=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(o[n]=t[n]);return o}(t,["children","component","depth","modelHook"]),h=c===m?p.type||"text":"",f=p.name||h||"el",d=p.id||f+"-"+l+"-"+e,v=Array.isArray(i)?i.map((function(t){return Object.assign(t,{depth:l+1})})):i,k=(new s).setHooks(n.model).addHook(u).asSingleHook(),b=Object.assign({name:f,type:h,key:d,depth:l,component:c,definition:{attrs:Object.assign({},p,{modelHook:k})},children:y(v,{hooks:n,h:r,state:a})});return(new s).setHooks(n.schemaNode).setDefault((function(){return b})).apply(b,{state:a})}return null}function y(t,e){void 0===e&&(e={});var o=e.hooks,n=e.h,r=e.state;return Array.isArray(t)?t.map((function(t,e){var a=v(t,e,{hooks:o,h:n,state:r});return(new s).setHooks(o.schemaComponent).setDefault((function(){return n(a.component,a.definition,a.children)})).apply(a)})):t}var k={functional:!1,name:"FormulateSchema",props:{schema:e.defaults.components.FormulateForm.props.schema,hooks:a,formClass:{type:String,default:null}},data:function(){return{schemaHooks:null,schemaOptionsHooks:null}},methods:{emit:function(t,e){this.$emit(t,e)}},beforeMount:function(){this.schemaHooks=(new s).setHooks(this.hooks.schema),this.schemaOptionsHooks=(new s).setHooks(this.hooks.schemaOptions).setDefault((function(t){return t}))},render:function(t){return this.schemaHooks.apply(t("div",{class:this.$props.formClass},y(this.schema,this.schemaOptionsHooks.apply({hooks:this.hooks,h:t,state:{}},{emit:this.emit,props:this.$props}))),{emit:this.emit,props:this.$props})}},b={extends:e.defaults.components.FormulateForm,components:{FormulateSchema:k},props:{hooks:a,formClass:{type:String,default:null}},computed:{cleanedHooks:function(){var t=this,o=a.default();return Object.keys(o).forEach((function(e){o[e]=(new s).parse(t.hooks[e]).getHooks()})),e.merge(this.$formulate.options.hooks||{},o)}},watch:{formulateValue:{handler:function(t){var e=this;this.isVmodeled&&t&&"object"==typeof t&&Array.from(new Set(Object.keys(t).concat(Object.keys(this.proxy)))).forEach((function(n){o.equals(t[n],e.proxy[n])||(e.setFieldValue(n,t[n]),e.registry.has(n)&&!o.equals(t[n],e.registry.get(n).proxy)&&(e.registry.get(n).context.model=t[n]))}))},deep:!0}}},x=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.schema?o("FormulateSchema",{attrs:{schema:t.schema,hooks:t.cleanedHooks,formClass:t.formClass},on:{events:function(e){return t.$emit("events",e)}}}):t._e(),t._v(" "),t.hasFormErrorObservers?t._e():o("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default")],2)};x._withStripped=!0;var _=h({render:x,staticRenderFns:[]},void 0,b,void 0,!1,void 0,!1,void 0,void 0,void 0),g=function(){this.store=new Map};g.prototype.on=function(t,e){var o=this.store.get(t);o&&o.push(e)||this.store.set(t,[e])},g.prototype.off=function(t,e){var o=this.store.get(t),n=o.indexOf(e);o&&n>-1&&o.splice(n,1)},g.prototype.emit=function(t,e){this.store.get(t).slice().map((function(t){return t(e)}))};var H={hooks:{schemaOptions:[{handler:function(t,e){void 0===e&&(e={});var o=e.emit;return t.state=t.state||{},t.state.eventBus=new g,t.state.eventBus.on("events",(function(t){return o("events",t)})),t}}],schemaNode:[{handler:function(t,e){void 0===e&&(e={});var o=e.state,n=t.definition.attrs,r=n.events;void 0===r&&(r=[]);var s=n.on;void 0===s&&(s={});var a=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(o[n]=t[n]);return o}(n,["events","on"]);return t.definition.attrs=a,t.definition.on=Object.assign({},s,r.reduce((function(e,n){return e[n]=function(e){s[n]&&s[n](e),o.eventBus.emit("events",{eventName:n,name:t.name,type:t.type,key:t.key,payload:e})},e}),{})),t}}]}},O={hooks:{model:[{handler:function(t,e){var o=e.context,r="vfe-mask"in o.attributes||"vfeMask"in o.attributes;if("text"===o.classification&&r){var s=o.attributes["vfe-mask"]||o.attributes.vfeMask,a="object"==typeof s&&s.mask?s:{mask:s};return n.createMask(a).resolve(t)}return t}}]}},F={hooks:{model:[{handler:function(t,e){var o=e.context,n="string"==typeof o.attributes.vfeNumber||o.attributes.vfeNumber||"string"==typeof o.attributes["vfe-number"]||o.attributes["vfe-number"];return"number"===o.type&&"string"==typeof t&&n?+t:t}}]}},P={FormulateForm:_,FormulateSchema:k,FormulateInput:m},j={formEvents:H,enforceNumber:F,textMask:O};t.components=P,t.default=function(t){void 0===t&&(t={});var e=r.merge({features:{formEvents:!0,textMask:!1,enforceNumber:!1},override:{FormulateForm:!0,FormulateInput:!0,FormulateSchema:!0}},t);return function(t){e.override.FormulateForm&&t.extend({components:{FormulateForm:_}}),e.override.FormulateInput&&t.extend({components:{FormulateInput:m}}),e.override.FormulateSchema&&t.extend({components:{FormulateSchema:k}}),e.features.formEvents&&t.extend(H),e.features.textMask&&t.extend(O),e.features.enforceNumber&&t.extend(F)}},t.features=j,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/package.json b/package.json index 9f7f2bf..cc83c32 100644 --- a/package.json +++ b/package.json @@ -19,12 +19,12 @@ "test:unit:watch": "vue-cli-service test:unit --coverage --watch" }, "peerDependencies": { - "@braid/vue-formulate": "2.4.3", + "@braid/vue-formulate": "^2.5.2", "imask": "^6.0.5", "vue": "^2.6.11" }, "devDependencies": { - "@braid/vue-formulate": "2.4.3", + "@braid/vue-formulate": "^2.5.2", "@rollup/plugin-buble": "^0.21.3", "@rollup/plugin-commonjs": "^13.0.0", "@rollup/plugin-node-resolve": "^8.1.0", diff --git a/readme.md b/readme.md index 7834f8e..e401c51 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,7 @@ yarn add vue-formulate-extended # don't forget to have the peer dependencies installed -yarn add @braid/vue-formulate@2.4.3 +yarn add @braid/vue-formulate@2.5.2 # install only if you want to use text-mask feature yarn add imask @@ -43,20 +43,20 @@ Vue.use(VueFormulate, { ## Activable features ### Events propagation -Events propagation from schema inputs with `events: []` in **FormulateForm** up to the top via `@events` - Check a live example +Events propagation from schema inputs with `events: []` in **FormulateForm** up to the top via `@events` + Check a live example Check the tests ### Text mask -Text mask on a **FormulateInput** with `vfe-mask` attribute (works in a **FormulateForm** schema too) - Check a live example - Check the tests +Text mask on a **FormulateInput** with `vfe-mask` attribute (works in a **FormulateForm** schema too) + Check a live example + Check the tests ### Enforce Number -Force number value on a **FormulateInput** number type with `vfe-number` attribute (works in a **FormulateForm** schema too) - Check a live example - Check the tests +Force number value on a **FormulateInput** number type with `vfe-number` attribute (works in a **FormulateForm** schema too) + Check a live example + Check the tests ## Q&A / Issues Feel free to open an issue for any question, request or bug. diff --git a/src/components/FormulateForm.vue b/src/components/FormulateForm.vue index cc1e949..854e56e 100644 --- a/src/components/FormulateForm.vue +++ b/src/components/FormulateForm.vue @@ -13,7 +13,7 @@