tg-controls_cli 0.0.21 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,5 +12,5 @@ var i=r("1fb5"),o=r("9152"),a=r("e3db");function s(){try{var t=new Uint8Array(1)
12
12
  * vee-validate v3.4.15
13
13
  * (c) 2023 Abdelrahman Awad
14
14
  * @license MIT
15
- */function Mt(e){return null===e||void 0===e}function Nt(e){return Array.isArray(e)&&0===e.length}function Rt(e){return"function"===typeof e}function Ft(e,t){return-1!==e.indexOf(t)}function zt(e){return Rt(Array.from)?Array.from(e):Lt(e)}function Lt(e){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}var Bt=function(e,t){return Array.isArray(e)?e.every((function(e){return Bt(e,t)})):zt(t).some((function(t){return t==e}))},Yt={validate:Bt},Vt=function(e,t){return!Bt(e,t)},Ut={validate:Vt},qt=function(e,t){var n=new RegExp(".("+t.join("|")+")$","i");return Array.isArray(e)?e.every((function(e){return n.test(e.name)})):n.test(e.name)},Ht={validate:qt},Gt=function(e){var t=/\.(jpg|svg|jpeg|png|bmp|gif|webp)$/i;return Array.isArray(e)?e.every((function(e){return t.test(e.name)})):t.test(e.name)},Wt={validate:Gt},Zt=function(e){return Array.isArray(e)?e.every((function(e){return/^-?[0-9]+$/.test(String(e))})):/^-?[0-9]+$/.test(String(e))},Kt={validate:Zt},Jt=function(e,t){var n=t.other;return e===n},Xt=[{name:"other"}],Qt={validate:Jt,params:Xt},en=function(e,t){var n=t.other;return e!==n},tn=[{name:"other"}],nn={validate:en,params:tn},rn=function(e,t){var n=t.length;return!Mt(e)&&("string"===typeof e&&(e=zt(e)),"number"===typeof e&&(e=String(e)),e.length||(e=zt(e)),e.length===n)},on=[{name:"length",cast:function(e){return Number(e)}}],an={validate:rn,params:on},sn=function(e,t){var n=t.length;return Mt(e)?n>=0:Array.isArray(e)?e.every((function(e){return sn(e,{length:n})})):String(e).length<=n},ln=[{name:"length",cast:function(e){return Number(e)}}],dn={validate:sn,params:ln},un=function(e,t){var n=t.max;return!Mt(e)&&""!==e&&(Array.isArray(e)?e.length>0&&e.every((function(e){return un(e,{max:n})})):Number(e)<=n)},cn=[{name:"max",cast:function(e){return Number(e)}}],fn={validate:un,params:cn},pn=function(e,t){var n=new RegExp(t.join("|").replace("*",".+")+"$","i");return Array.isArray(e)?e.every((function(e){return n.test(e.type)})):n.test(e.type)},hn={validate:pn},vn=function(e,t){var n=t.length;return!Mt(e)&&(Array.isArray(e)?e.every((function(e){return vn(e,{length:n})})):String(e).length>=n)},mn=[{name:"length",cast:function(e){return Number(e)}}],gn={validate:vn,params:mn},bn=function(e,t){var n=t.min;return!Mt(e)&&""!==e&&(Array.isArray(e)?e.length>0&&e.every((function(e){return bn(e,{min:n})})):Number(e)>=n)},_n=[{name:"min",cast:function(e){return Number(e)}}],yn={validate:bn,params:_n},$n=/^[٠١٢٣٤٥٦٧٨٩]+$/,xn=/^[0-9]+$/,wn=function(e){var t=function(e){var t=String(e);return xn.test(t)||$n.test(t)};return Array.isArray(e)?e.every(t):t(e)},kn={validate:wn},On=function(e,t){var n=t.regex;return Array.isArray(e)?e.every((function(e){return On(e,{regex:n})})):n.test(String(e))},Sn=[{name:"regex",cast:function(e){return"string"===typeof e?new RegExp(e):e}}],In={validate:On,params:Sn},Dn=function(e,t){var n=(void 0===t?{allowFalse:!0}:t).allowFalse,r={valid:!1,required:!0};return Mt(e)||Nt(e)?r:!1!==e||n?(r.valid=!!String(e).trim().length,r):r},Cn=!0,jn=[{name:"allowFalse",default:!0}],En={validate:Dn,params:jn,computesRequired:Cn},Pn=function(e){return Nt(e)||Ft([!1,null,void 0],e)||!String(e).trim().length},An=function(e,t){var n,r=t.target,i=t.values;return i&&i.length?(Array.isArray(i)||"string"!==typeof i||(i=[i]),n=i.some((function(e){return e==String(r).trim()}))):n=!Pn(r),n?{valid:!Pn(e),required:n}:{valid:!0,required:n}},Tn=[{name:"target",isTarget:!0},{name:"values"}],Mn=!0,Nn={validate:An,params:Tn,computesRequired:Mn},Rn=function(e,t){var n=t.size;if(isNaN(n))return!1;var r=1024*n;if(!Array.isArray(e))return e.size<=r;for(var i=0;i<e.length;i++)if(e[i].size>r)return!1;return!0},Fn=[{name:"size",cast:function(e){return Number(e)}}],zn={validate:Rn,params:Fn},Ln=function(e,t){var n=t||{},r=n.decimals,i=void 0===r?0:r,o=n.separator,a=void 0===o?"dot":o,s="comma"===a?",?":"\\.?",l=0===i?"\\d*":"(\\d{"+i+"})?",d=new RegExp("^-?\\d+"+s+l+"$");return Array.isArray(e)?e.every((function(e){return d.test(String(e))})):d.test(String(e))},Bn=[{name:"decimals",default:0},{name:"separator",default:"dot"}],Yn={validate:Ln,params:Bn};function Vn(e){return r("bb28")(`./${e}.json`).then(t=>{fe(e,t)})}function Un(e,t){let n={},r=Vn(null!==t&&void 0!==t?t:"en");return e&&("string"===typeof e||"undefined"===typeof e.length?n=e:"undefined"!==typeof e.length&&e.forEach((function(e){Object.keys(e).forEach(t=>{"errormessage"!=t.toLowerCase()&&(n[t]=e[t]),"errormessage"!=t.toLowerCase()&&"undefined"!=typeof e.errorMessage&&"function"!==typeof e[t]&&(r.messages[t]=e.errorMessage),"function"!==typeof e[t]&&"object"!==typeof e[t]||R(t,e[t])})}))),n}Object.keys(i).forEach(e=>{R(e,i[e])}),R("password",{params:["target"],validate(e,{target:t}){return e===t},message:"Password confirmation does not match"}),R("url",{validate(e){return!!e&&/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/.test(e)},message:"The {_field_} field must be a valid URL"}),R("colorCode",{validate(e){return!!e&&/^#[0-9A-F]{6}$/.test(e)},message:"The {_field_} field must be a valid color"}),R("ZipCode",{validate(e){return!!e&&/(^\d{6}$)|(^\d{5}-\d{4}$)/.test(e)},message:"The {_field_} field is not valid"});var qn=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("input",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],class:{"form-control w-100":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled,type:"text",placeholder:e.fieldInfo.placeholder},domProps:{value:e.fieldInfo.value},on:{change:function(t){return e.onChange(t)},blur:function(t){return e.onBlur(t)},keypress:e.onlyForCurrency,input:function(t){t.target.composing||e.$set(e.fieldInfo,"value",t.target.value)}}}),n[0]?t("span",{staticClass:"invalid-feedback",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},Hn=[],Gn={components:{Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{value:""}},methods:{onlyForCurrency(e){let t=e.keyCode?e.keyCode:e.which;!(t<48||t>57)||46===t&&-1==this.fieldInfo.value.indexOf(".")||e.preventDefault(),null!=this.fieldInfo.value&&this.fieldInfo.value.indexOf(".")>-1&&this.fieldInfo.value.split(".")[1].length>1&&e.preventDefault()},onChange:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},onBlur:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onBlur&&this.fieldInfo.config.onBlur(e,this.fieldInfo)}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)}},Wn=Gn;function Zn(e,t,n,r,i,o,a,s){var l,d="function"===typeof e?e.options:e;if(t&&(d.render=t,d.staticRenderFns=n,d._compiled=!0),r&&(d.functional=!0),o&&(d._scopeId="data-v-"+o),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},d._ssrRegister=l):i&&(l=s?function(){i.call(this,(d.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(d.functional){d._injectStyles=l;var u=d.render;d.render=function(e,t){return l.call(t),u(e,t)}}else{var c=d.beforeCreate;d.beforeCreate=c?[].concat(c,l):[l]}return{exports:e,options:d}}var Kn=Zn(Wn,qn,Hn,!1,null,null,null),Jn=Kn.exports,Xn=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"d-flex w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("select",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],class:{"form-control w-100":!0,"is-invalid":n[0]},attrs:{name:e.fieldInfo.name,disabled:e.fieldInfo.disabled},on:{change:[function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(e.fieldInfo,"value",t.target.multiple?n:n[0])},function(t){return e.onChange(t)}]}},[t("option",{attrs:{value:"",selected:""}},[e._v("Select "+e._s(e.fieldInfo.label))]),e._l(e.options,(function(n,r){return t("option",{key:r,domProps:{value:n.value,selected:e.fieldInfo.value==n.value}},[e._v(e._s(n.name)+" ")])}))],2),e.showAddIcon()?t("div",{staticClass:"ml-2 mt-1"},[t("a",{class:e.addButtonClass()},[t("i",{class:e.addIconClass(),attrs:{alt:"+"},on:{click:function(t){return e.onAddButtonClick(t)}}})])]):e._e(),n[0]?t("span",{staticClass:"invalid-feedback d-block"},[e._v(e._s(n[0]))]):e._e()]}}])})},Qn=[],er=(r("14d9"),r("bc3a")),tr=r.n(er),nr={components:{Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data(){return{options:[],dependentOptions:[]}},async created(){await this.GetSelectOptions()},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)},methods:{onChange(e){if(this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange){if(this.fieldInfo.config.hasOwnProperty("dependent_request_urls")){var t=[];this.fieldInfo.config.dependent_request_urls.forEach(async e=>{for(var n in e)await tr.a.get(this.fieldInfo.config.dependent_request_urls+e[n],{headers:{Authorization:"Bearer "+this.fieldInfo.config.token}}).then(e=>{e.data&&(t=e.data,this.dependentOptions.push({request:t}))}).catch(e=>{console.log("Error on binding slect option in tg-control- "+e)})})}this.fieldInfo.config.onChange(e,this.fieldInfo,this.dependentOptions)}},showAddIcon:function(){if(this.fieldInfo.config&&this.fieldInfo.config.showAddIcon)return this.fieldInfo.config.showAddIcon},onAddButtonClick:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onAddButtonClick&&this.fieldInfo.config.onAddButtonClick(e,this.fieldInfo)},addButtonClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIconBackground?"round-icon-small theme-primary "+this.fieldInfo.config.addIconBackground:"round-icon-small btn-dark theme-primary"},addIconClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIcon?"fa text-white pt-7 font-18 "+this.fieldInfo.config.addIcon:"fa fa-plus text-white pt-7 font-18"},GetSelectOptions:async function(){var e=this,t=[];e.fieldInfo.hasOwnProperty("picklist_options")&&"Lookup"!=e.fieldInfo.picklist_options?t=e.MakeArray(e.fieldInfo.picklist_options):e.fieldInfo.hasOwnProperty("select_options")&&e.fieldInfo.select_options.length>0?t=e.MakeNormalArray(e.fieldInfo.select_options):e.fieldInfo.hasOwnProperty("config")&&e.fieldInfo.config.hasOwnProperty("options")&&e.fieldInfo.config.options.length>0?t=e.fieldInfo.config.options:e.fieldInfo.hasOwnProperty("config")&&e.fieldInfo.config.hasOwnProperty("option_request_url")&&e.fieldInfo.config.option_request_url.length>0&&await tr.a.get(e.fieldInfo.config.option_request_url,{headers:{Authorization:"Bearer "+e.fieldInfo.config.token}}).then(e=>{console.log(e.data),e.data&&(t=e.data)}).catch(e=>{console.log("Error on binding slect option in tg-control- "+e)}),t.forEach((t,n)=>{e.options.push({value:t.value,name:t.hasOwnProperty("text")?t.text:t.name})})},MakeNormalArray:function(e){if(e)try{return JSON.parse(e)}catch(t){return e}else e=[]},MakeArray:function(e,t){var n=[],r=String(e).split(",");if("radio"==t||"checkbox"==t){if(r.length>0)for(let o of r)if(o.split("|").length>1){var i={name:o.split("|")[0].trim(),value:o.split("|")[1].trim()};n.push(i)}else{i={name:o.trim(),value:o.trim()};n.push(i)}}else if(r.length>0)for(let o of r){i={name:o.trim(),value:o.trim()};n.push(i)}return n}}},rr=nr,ir=Zn(rr,Xn,Qn,!1,null,null,null),or=ir.exports,ar=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("input",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],class:{"form-control w-100":!0,"is-invalid":n[0]},attrs:{name:e.fieldInfo.name,id:e.fieldInfo.name,type:"text",placeholder:e.fieldInfo.placeholder,disabled:e.fieldInfo.disabled},domProps:{value:e.fieldInfo.value},on:{change:function(t){return e.onChange(t)},blur:function(t){return e.onBlur(t)},input:function(t){t.target.composing||e.$set(e.fieldInfo,"value",t.target.value)}}}),e.showAddIcon()?t("div",{staticClass:"ml-2 mt-1"},[t("a",{class:e.addButtonClass()},[t("i",{class:e.addIconClass(),attrs:{alt:"+"},on:{click:function(t){return e.onAddButtonClick(t)}}})])]):e._e(),n[0]?t("span",{staticClass:"invalid-feedback",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},sr=[],lr={components:{Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)},methods:{onChange:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},onBlur:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onBlur&&this.fieldInfo.config.onBlur(e,this.fieldInfo)},showAddIcon:function(){if(this.fieldInfo.config&&this.fieldInfo.config.showAddIcon)return this.fieldInfo.config.showAddIcon},onAddButtonClick:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onAddButtonClick&&this.fieldInfo.config.onAddButtonClick(e,this.fieldInfo)},addButtonClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIconBackground?"round-icon-small theme-primary "+this.fieldInfo.config.addIconBackground:"round-icon-small btn-dark theme-primary"},addIconClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIcon?"fa text-white pt-7 font-18 "+this.fieldInfo.config.addIcon:"fa fa-plus text-white pt-7 font-18"}}},dr=lr,ur=Zn(dr,ar,sr,!1,null,null,null),cr=ur.exports,fr=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("DatePicker",{class:{"input-group w-100":!0,"is-invalid":n[0]},staticStyle:{"flex-wrap":"nowrap"},attrs:{is24hr:e.is24hr,mode:e.mode,disabled:e.fieldInfo.disabled,masks:e.masks,popover:e.popover,"min-date":e.getMinmumDate(e.fieldInfo),"max-date":e.getMaxDate(e.fieldInfo),"minute-increment":5},scopedSlots:e._u([{key:"default",fn:function({inputValue:r,inputEvents:i,togglePopover:o}){return[t("input",e._g({ref:"inputDatePicker",class:{"form-control w-100":!0,"is-invalid":n[0]},attrs:{autocomplete:"off",disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,placeholder:e.fieldInfo.label},domProps:{value:r},on:{blur:function(t){return e.onBlur(t,e.field)}}},i)),t("div",{staticClass:"input-group-append"},[t("span",e._g({staticClass:"input-group-text"},i),[t("i",{staticClass:"fa fa-calendar"})])])]}}],null,!0),model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}),t("span",{directives:[{name:"show",rawName:"v-show",value:n[0],expression:"errors[0]"}],ref:"errrorMessage",staticClass:"invalid-feedback d-block"},[e._v(e._s(n[0]))])]}}])})},pr=[],hr=r("404b"),vr=r.n(hr),mr={components:{Field:Le,DatePicker:vr.a},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{popover:{visibility:"click"},masks:{input:"DD-MM-YYYY"},date:new Date,mode:"date",is24hr:!1}},methods:{getMinmumDate(e){if(e.config&&this.fieldInfo.config.minDate)return e.config.minDate},getMaxDate(e){if(e.config&&this.fieldInfo.config.maxDate)return e.config.maxDate},onBlur(t){try{t.onBlur[0](),t.onBlur[1]()}catch(n){}this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onBlur&&this.fieldInfo.config.onBlur(e,this.fieldInfo)}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang),this.fieldInfo.config&&this.fieldInfo.config.is24hr&&(this.is24hr=this.fieldInfo.config.is24hr),this.fieldInfo.config&&this.fieldInfo.config.mode&&(this.mode=this.fieldInfo.config.mode),this.fieldInfo.config&&this.fieldInfo.config.format&&("date"==this.mode?this.masks.input=this.fieldInfo.config.format:"dateTime"==this.mode?this.masks.inputDateTime=this.fieldInfo.config.format:"time"==this.mode&&(this.masks.inputTime=this.fieldInfo.config.format))}},gr=mr,br=(r("9f68"),Zn(gr,fr,pr,!1,null,null,null)),_r=br.exports,yr=function(){var e=this,t=e._self._c;return t("Field",{attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[e._l(e.renderOptions(e.fieldInfo),(function(r,i){return t("label",{key:i,class:{"form-check form-check-inline":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled}},[t("div",{staticClass:"custom-control custom-check custom-control-inline"},[t("input",{staticClass:"custom-control-input",attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name+"_"+i,id:e.fieldInfo.name+"_"+i,type:"checkbox"},domProps:{checked:e.isChecked(r),value:r.value},on:{change:function(t){return e.onChange(t,e.field)}}}),t("label",{staticClass:"custom-control-label",attrs:{for:e.fieldInfo.name+"_"+i}},[e._v(e._s(r.name))])])])})),n[0]?t("span",{staticClass:"invalid-feedback"},[e._v(e._s(n[0]))]):e._e()]}}])})},$r=[],xr={components:{Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{checkOptions:[]}},created:function(){},methods:{renderOptions:function(e){if(e.config&&this.fieldInfo.config.options){var t=[].constructor;return this.fieldInfo.config.options.constructor===t?e.config.options:null}},onChange:function(e,t){"array"!=typeof this.fieldInfo.value&&"object"!=typeof this.fieldInfo.value&&(this.fieldInfo.value=this.fieldInfo.value.toString().split()),e.target.checked?(this.fieldInfo.value="string"==typeof this.fieldInfo.value?[]:this.fieldInfo.value,this.fieldInfo.value.push(e.target.value)):this.fieldInfo.value.splice(this.fieldInfo.value.indexOf(e.target.value),1);try{t.onBlur[0](),t.onBlur[1]()}catch(n){}this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},isChecked:function(t){try{return"array"==typeof this.fieldInfo.value||"object"==typeof this.fieldInfo.value?this.fieldInfo.value.includes(t.value):this.fieldInfo.value==t.value}catch(e){console.log("Checkbox value should be in string or array")}}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang),this.fieldInfo&&this.fieldInfo.value&&"array"!=typeof this.fieldInfo.value&&"object"!=typeof this.fieldInfo.value&&(this.fieldInfo.value=this.fieldInfo.value.toString().split())}},wr=xr,kr=Zn(wr,yr,$r,!1,null,null,null),Or=kr.exports,Sr=function(){var e=this,t=e._self._c;return t("Field",{attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label,slim:""},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return e._l(e.renderOptions(e.fieldInfo),(function(r,i){return t("label",{key:i,class:{"form-check form-check-inline":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled}},[t("div",{staticClass:"custom-control custom-radio custom-control-inline"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],staticClass:"custom-control-input",attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,id:e.fieldInfo.name+"_"+i,type:"radio"},domProps:{checked:r.value==e.fieldInfo.value,checked:e._q(e.fieldInfo.value,null)},on:{change:[function(t){return e.$set(e.fieldInfo,"value",null)},function(t){return e.onChange(t)}]}}),t("label",{staticClass:"custom-control-label",attrs:{for:e.fieldInfo.name+"_"+i}},[e._v(e._s(r.name))])])])}))}}])})},Ir=[],Dr={components:{Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{checkOptions:[]}},methods:{renderOptions:function(e){if(e.config&&this.fieldInfo.config.options){var t=[].constructor;return this.fieldInfo.config.options.constructor===t?e.config.options:null}},AssignToggleValues:function(e,t,n){this.$emit("AssignToggleValues",e,t,n)},showDependentItem:function(e,t){this.$emit("showDependentItem",e,t)},onChange(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)}},Cr=Dr,jr=Zn(Cr,Sr,Ir,!1,null,null,null),Er=jr.exports,Pr=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("Multiselect",{ref:"multiselect",class:{"form-control p-0 w-100":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled,options:e.options,"close-on-select":!1,searchable:!0,multiple:"tag"==e.fieldInfo.modemode,taggable:"tag"==e.fieldInfo.mode},on:{remove:function(t){return e.onRemove(t,e.field,e.meta)},"search-change":e.onSearch,select:e.onChange},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}),e.showAddIcon()?t("div",{staticClass:"ml-2 mt-1"},[t("a",{class:e.addButtonClass()},[t("i",{class:e.addIconClass(),attrs:{alt:"+"},on:{click:function(t){return e.onAddButtonClick(t)}}})])]):e._e(),n[0]?t("span",{staticClass:"invalid-feedback"},[e._v(e._s(n[0]))]):e._e()]}}])})},Ar=[],Tr=r("8e5f"),Mr=r.n(Tr),Nr={components:{Multiselect:Mr.a,Field:Le},props:{lang:{type:String,default:"en"},mode:{type:String,default:"single"},fieldInfo:{type:Object,required:!0}},watch:{fieldInfo:{handler:function(e,t){let n=this;if(console.log("Multi drop down",e,t),e.config&&e.config.options)try{n.options=[],e.config.options.forEach((function(e){let t={value:e.value,label:e.name};n.options.push(t)}))}catch(r){}},deep:!0}},created:function(){let e=this;if("undefined"!=typeof e.fieldInfo.value&&""!=e.fieldInfo.value||(e.fieldInfo.value=[]),"undefined"!=typeof e.fieldInfo.mode&&""!=e.fieldInfo.mode||(e.fieldInfo.mode="single"),e.fieldInfo.config&&e.fieldInfo.config.options)try{e.fieldInfo.config.options.forEach((function(t){let n={value:t.value,label:t.name};e.options.push(n)}))}catch(t){console.log(t)}},data:function(){return{isTouched:!1,value:[],selectedHtml:"",options:[]}},computed:{isInvalid(){return this.isTouched&&0===this.value.length}},methods:{onSearch:function(e,t){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onSearchChange&&this.fieldInfo.config.onSearchChange(t,this.fieldInfo)},onChange:function(e,t){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(t,this.fieldInfo)},showAddIcon:function(){if(this.fieldInfo.config&&this.fieldInfo.config.showAddIcon)return this.fieldInfo.config.showAddIcon},onAddButtonClick:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onAddButtonClick&&this.fieldInfo.config.onAddButtonClick(e,this.fieldInfo)},addButtonClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIconBackground?"round-icon-small theme-primary "+this.fieldInfo.config.addIconBackground:"round-icon-small btn-dark theme-primary"},addIconClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIcon?"fa text-white pt-7 font-18 "+this.fieldInfo.config.addIcon:"fa fa-plus text-white pt-7 font-18"}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)}},Rr=Nr,Fr=(r("8498"),Zn(Rr,Pr,Ar,!1,null,null,null)),zr=Fr.exports,Lr=function(){var e=this,t=e._self._c;return t("Field",{attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("div",{class:{"is-invalid":n[0]}},[t("Toggle",{attrs:{disabled:e.fieldInfo.disabled,"on-label":"Yes","off-label":"No"},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}})],1),n[0]?t("span",{staticClass:"invalid-feedback",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},Br=[];function Yr(e,t,n,r,i,o,a,s,l,d){"boolean"!=typeof a&&(l=s,s=a,a=!1);const u="function"==typeof n?n.options:n;let c;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,i&&(u.functional=!0)),r&&(u._scopeId=r),o?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=c):t&&(c=a?function(e){t.call(this,d(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,s(e))}),c)if(u.functional){const e=u.render;u.render=function(t,n){return c.call(n),e(t,n)}}else{const e=u.beforeCreate;u.beforeCreate=e?[].concat(e,c):[c]}return n}const Vr={name:"Toggle",emits:["input","update:modelValue","change"],props:{value:{validator:function(e){return e=>-1!==["number","string","boolean"].indexOf(typeof e)||null==e},required:!1},modelValue:{validator:function(e){return e=>-1!==["number","string","boolean"].indexOf(typeof e)||null==e},required:!1},id:{type:[String,Number],required:!1,default:"toggle"},name:{type:[String,Number],required:!1,default:"toggle"},disabled:{type:Boolean,required:!1,default:!1},required:{type:Boolean,required:!1,default:!1},falseValue:{type:[String,Number,Boolean],required:!1,default:!1},trueValue:{type:[String,Number,Boolean],required:!1,default:!0},onLabel:{type:[String,Object],required:!1,default:""},offLabel:{type:[String,Object],required:!1,default:""},classes:{type:Object,required:!1,default:()=>({})},labelledby:{type:String,required:!1},describedby:{type:String,required:!1},aria:{required:!1,type:Object,default:()=>({})}},setup(e,t){const n=function(e,t,n){const{value:r,modelValue:i,falseValue:o,trueValue:a,disabled:s}=Object(d["toRefs"])(e),l=i&&void 0!==i.value?i:r,u=Object(d["computed"])(()=>l.value===a.value),c=e=>{t.emit("input",e),t.emit("update:modelValue",e),t.emit("change",e)},f=()=>{c(a.value)},p=()=>{c(o.value)};return-1!==[null,void 0,!1,0,"0","off"].indexOf(l.value)&&-1===[o.value,a.value].indexOf(l.value)&&p(),-1!==[!0,1,"1","on"].indexOf(l.value)&&-1===[o.value,a.value].indexOf(l.value)&&f(),{externalValue:l,checked:u,update:c,check:f,uncheck:p,handleInput:e=>{c(e.target.checked?a.value:o.value)},handleClick:()=>{s.value||(u.value?p():f())}}}(e,t),r=function(e,t,n){const{trueValue:r,falseValue:i,onLabel:o,offLabel:a}=Object(d["toRefs"])(e),s=n.checked,l=n.update;return{label:Object(d["computed"])(()=>{let e=s.value?o.value:a.value;return e||(e="&nbsp;"),e}),toggle:()=>{l(s.value?i.value:r.value)},on:()=>{l(r.value)},off:()=>{l(i.value)}}}(e,0,{checked:n.checked,update:n.update}),i=function(e,t,n){const r=Object(d["toRefs"])(e),i=r.disabled,o=n.checked,a=Object(d["computed"])(()=>({container:"toggle-container",toggle:"toggle",toggleOn:"toggle-on",toggleOff:"toggle-off",toggleOnDisabled:"toggle-on-disabled",toggleOffDisabled:"toggle-off-disabled",handle:"toggle-handle",handleOn:"toggle-handle-on",handleOff:"toggle-handle-off",handleOnDisabled:"toggle-handle-on-disabled",handleOffDisabled:"toggle-handle-off-disabled",label:"toggle-label",...r.classes.value}));return{classList:Object(d["computed"])(()=>({container:a.value.container,toggle:[a.value.toggle,i.value?o.value?a.value.toggleOnDisabled:a.value.toggleOffDisabled:o.value?a.value.toggleOn:a.value.toggleOff],handle:[a.value.handle,i.value?o.value?a.value.handleOnDisabled:a.value.handleOffDisabled:o.value?a.value.handleOn:a.value.handleOff],label:a.value.label}))}}(e,0,{checked:n.checked}),o=function(e,t,n){const{disabled:r}=Object(d["toRefs"])(e),i=n.check,o=n.uncheck,a=n.checked;return{handleSpace:()=>{r.value||(a.value?o():i())}}}(e,0,{check:n.check,uncheck:n.uncheck,checked:n.checked});return{...n,...i,...r,...o}}};var Ur=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",e._b({class:e.classList.container,attrs:{tabindex:e.disabled?void 0:0,"aria-checked":e.checked,"aria-describedby":e.describedby,"aria-labelledby":e.labelledby,role:"switch"},on:{keypress:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])?null:(t.preventDefault(),e.handleSpace.apply(null,arguments))}}},"div",e.aria,!1),[n("input",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],attrs:{type:"checkbox",id:e.id,name:e.name,disabled:e.disabled},domProps:{value:e.trueValue,checked:e.checked}}),e._v(" "),n("div",{class:e.classList.toggle,on:{click:e.handleClick}},[n("span",{class:e.classList.handle}),e._v(" "),e._t("label",(function(){return[n("span",{class:e.classList.label,domProps:{innerHTML:e._s(e.label)}})]}),{checked:e.checked,classList:e.classList}),e._v(" "),e.required?n("input",{style:{appearance:"none",height:"1px",margin:"0",padding:"0",fontSize:"0",background:"transparent",position:"absolute",width:"100%",bottom:"0",outline:"none"},attrs:{type:"checkbox","aria-hidden":"true",tabindex:"-1",required:""},domProps:{checked:e.checked}}):e._e()],2)])};Ur._withStripped=!0;const qr=Yr({render:Ur,staticRenderFns:[]},void 0,Vr,void 0,!1,void 0,!1,void 0,void 0,void 0);var Hr,Gr,Wr={components:{Toggle:qr,Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,defineRule,configure,this.lang)}},Zr=Wr,Kr=(r("8542"),Zn(Zr,Lr,Br,!1,null,null,null)),Jr=Kr.exports,Xr=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,disabled:e.fieldInfo.disabled,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("vue-tel-input",{staticClass:"w-100",attrs:{mode:"international",validCharactersOnly:!0},on:{input:e.onInput},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}),n[0]?t("span",{staticClass:"invalid-feedback d-block",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},Qr=[],ei=r("e75b"),ti=r.n(ei),ni=(r("bf68"),{install:(e,t)=>{e.use(ti.a,{})},components:{VueTelInput:ti.a,Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{phoneError:!1}},methods:{onInput(e,t,n){t&&0==(null===t||void 0===t?void 0:t.valid)?this.phoneError=!0:null!==t&&void 0!==t&&t.formatted&&null!==t&&void 0!==t&&t.valid&&(this.fieldInfo.value=t.formatted,this.phoneError=!1)}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)}}),ri=ni,ii=Zn(ri,Xr,Qr,!1,null,null,null),oi=ii.exports,ai=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("Multiselect",{class:{"form-control p-0 w-100":!0,"is-invalid":n[0]},attrs:{"filter-results":!1,object:!0,showNoOptions:!0,searchable:!0,label:"label","track-by":"value","show-labels":!1,"show-no-results":!1,"internal-search":!1,disabled:e.fieldInfo.disabled,options:e.options,multiple:"tag"==e.fieldInfo.mode,taggable:"tag"==e.fieldInfo.mode,"clear-on-select":!1,"close-on-select":!1,"open-direction":"bottom"},on:{"search-change":e.onSearch,select:e.onChange},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}},[t("span",{attrs:{slot:"noOptions"},slot:"noOptions"},[e._v(" Type to search "+e._s(e.fieldInfo.display_name)+" ")])]),e.showAddIcon()?t("div",{staticClass:"ml-2 mt-1"},[t("a",{class:e.addButtonClass()},[t("i",{class:e.addIconClass(),attrs:{alt:"+"},on:{click:function(t){return e.onAddButtonClick(t)}}})])]):e._e(),n[0]?t("span",{staticClass:"invalid-feedback"},[e._v(e._s(n[0]))]):e._e()]}}])})},si=[],li={components:{Multiselect:Mr.a,Field:Le},props:{lang:{type:String,default:"en"},mode:{type:String,default:"single"},fieldInfo:{type:Object,required:!0}},watch:{fieldInfo:{handler:function(e,t){let n=this;if(console.log("Multi drop down",e,t),e.config&&e.config.options)try{n.options=[],e.config.options.forEach((function(e){let t={value:e.value,label:e.name};n.options.push(t)}))}catch(r){}},deep:!0}},created:function(){let e=this;if("undefined"!=typeof e.fieldInfo.value&&""!=e.fieldInfo.value||(e.fieldInfo.value=[]),"undefined"!=typeof e.fieldInfo.mode&&""!=e.fieldInfo.mode||(e.fieldInfo.mode="single"),e.fieldInfo.config&&e.fieldInfo.config.options)try{e.fieldInfo.config.options.forEach((function(t){let n={value:t.value,label:t.name};e.options.push(n)}))}catch(t){console.log(t)}},data:function(){return{isTouched:!1,value:[],options:[]}},computed:{isInvalid(){return this.isTouched&&0===this.value.length}},methods:{onSearch:function(e,t){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onSearchChange&&this.fieldInfo.config.onSearchChange(t,this.fieldInfo)},onChange:function(e,t){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(t,this.fieldInfo)},showAddIcon:function(){if(this.fieldInfo.config&&this.fieldInfo.config.showAddIcon)return this.fieldInfo.config.showAddIcon},onAddButtonClick:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onAddButtonClick&&this.fieldInfo.config.onAddButtonClick(e,this.fieldInfo)},addButtonClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIconBackground?"round-icon-small theme-primary "+this.fieldInfo.config.addIconBackground:"round-icon-small btn-dark theme-primary"},addIconClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIcon?"fa text-white pt-7 font-18 "+this.fieldInfo.config.addIcon:"fa fa-plus text-white pt-7 font-18"}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)}},di=li,ui=Zn(di,ai,si,!1,null,null,null),ci=ui.exports,fi=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],class:{"form-control":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled,rows:e.getRows(e.fieldInfo),cols:e.getColumns(e.fieldInfo),placeholder:e.fieldInfo.placeholder},domProps:{value:e.fieldInfo.value},on:{change:function(t){return e.onChange(t)},blur:function(t){return e.onBlur(t)},input:function(t){t.target.composing||e.$set(e.fieldInfo,"value",t.target.value)}}}),n[0]?t("span",{staticClass:"invalid-feedback",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},pi=[],hi={components:{Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},methods:{getColumns(e){if(e.config&&this.fieldInfo.config.cols)return e.config.cols},getRows(e){if(e.config&&this.fieldInfo.config.rows)return e.config.rows},onChange:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},onBlur:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onBlur&&this.fieldInfo.config.onBlur(e,this.fieldInfo)}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)}},vi=hi,mi=Zn(vi,fi,pi,!1,null,null,null),gi=mi.exports,bi=function(){var e=this,t=e._self._c;return t("div",{ref:"colorpicker",staticClass:"input-group color-picker"},[t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("input",{staticClass:"form-control w-100",attrs:{disabled:"disabled",type:"text",name:e.fieldInfo.name,pattern:"^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},domProps:{value:e.fieldInfo.value},on:{input:e.updateFromInput,change:e.updateFromInput}})]}}])}),t("span",{staticClass:"input-group-addon color-picker-container",staticStyle:{padding:"6px 12px","font-size":"14px","font-weight":"400","line-height":"1",color:"#555","text-align":"center","background-color":"#eee",border:"1px solid #ccc","border-radius":"4px"},on:{click:function(t){return e.showPicker()}}},[t("span",{staticClass:"current-color",staticStyle:{width:"20px",height:"20px",display:"block"},style:"background-color:"+e.colorValue,on:{click:function(t){return e.togglePicker()}}}),e.displayPicker?t("ColorPicker",{staticStyle:{position:"absolute"},attrs:{theme:"light",disabled:e.fieldInfo.disabled},on:{changeColor:e.updateFromPicker},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}):e._e()],1)],1)},_i=[],yi=r("b9d7"),$i=r.n(yi),xi={props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},components:{Field:Le,ColorPicker:$i.a.component},data:function(){return{color:"#000000",suckerCanvas:null,suckerArea:[],isSucking:!0,colorValue:"",displayPicker:!1}},created(){this.fieldInfo&&this.fieldInfo.value?this.color=this.fieldInfo.value:this.fieldInfo.value=this.color},mounted:function(){this.setColor(this.color||"#59c7f9"),this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)},methods:{setColor:function(e){this.updateColors(e),this.colorValue=e},updateColors:function(e){if("#"==e.slice(0,1))this.colors={hex:e};else if("rgba"==e.slice(0,4)){var t=e.replace(/^rgba?\(|\s+|\)$/g,"").split(","),n="#"+((1<<24)+(parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).slice(1);this.colors={hex:n,a:t[3]}}this.isSucking=!0},showPicker:function(){document.addEventListener("click",this.documentClick),this.displayPicker=!0},hidePicker:function(){document.removeEventListener("click",this.documentClick),this.displayPicker=!1},togglePicker:function(){this.displayPicker?this.hidePicker():this.showPicker()},updateFromInput:function(){var e=new RegExp("^#[0-9A-F]{6}$"),t=this.colorValue;if(!e.test(t))return!1;this.updateColors(this.colorValue)},updateFromPicker(e){this.colors=e,1==e.rgba.a?(this.colorValue=e.hex,this.fieldInfo.value=this.colorValue):(this.colorValue="rgba("+e.rgba.r+", "+e.rgba.g+", "+e.rgba.b+", "+e.rgba.a+")",this.fieldInfo.value=this.colorValue)},documentClick:function(e){var t=this.$refs.colorpicker,n=e.target;t===n||t.contains(n)||this.hidePicker()}},watch:{colorValue:function(e){e&&(this.updateColors(e),this.updateFromInput(),this.$emit("input",e))}}},wi=xi,ki=Zn(wi,bi,_i,!1,null,null,null),Oi=ki.exports,Si=function(){var e=this,t=e._self._c;return t("div",{staticClass:"col-12 p-0",attrs:{id:"fileAttachment"}},[t("div",{staticClass:"col-12 mb-2 mt-2"},[t("label",[e._v("Allowed File Type:")]),e._l(e.fieldInfo.config.accept,(function(n){return t("div",{staticClass:"mx-2 d-inline-block doc-ico-legend"},[t("em",{staticClass:"fa text-primary",class:n.iconClass,attrs:{id:"helpText"}}),e._v(" "+e._s(n.fileType)+" ")])}))],2),t("div",{staticClass:"file-upload"},[t("div",{staticClass:"file-upload__area",on:{click:e.openFilePopup}},[t("div",[0==e.previewFiles.length?t("span",[e._v("Drop files here to upload")]):e._e(),t("input",{staticClass:"d-none",attrs:{type:"file",id:"customFile",disabled:e.fieldInfo.disabled,multiple:e.canUploadMultipleFile()},on:{change:function(t){return e.onChange(t)}}}),e.errors.length>0?t("div",e._l(e.errors,(function(n,r){return t("div",{key:r,staticClass:"file-upload__error"},[t("span",[e._v(e._s(n))])])})),0):e._e()]),e._l(e.previewFiles,(function(n,r){return t("div",{key:r,staticClass:"upload-preview"},[n.isImage?t("img",{staticClass:"file-image",attrs:{src:n.url,alt:""}}):e._e(),n.isImage?e._e():t("div",{staticClass:"file-extention"},[e._v(" "+e._s(n.fileExtention)+" ")]),t("span",{staticClass:"file-name"},[e._v(" "+e._s(n.name)+e._s(n.isImage?"."+n.fileExtention:"")+" ")]),t("span",{staticClass:"crossimg"},[t("a",{staticClass:"fa fa-times text-white",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.RemoveFile(t,r)}}})])])}))],2)])])},Ii=[],Di={components:{Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{maxSize:0,accept:"",errors:[],file:{name:"",size:0,type:"",fileExtention:"",url:"",isImage:!1,isUploaded:!1},previewFiles:[]}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang),this.fieldInfo.placeholder&&(this.fileName=this.fieldInfo.placeholder),this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.hasOwnProperty("maxSize")&&(this.maxSize=this.fieldInfo.config.maxSize),this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.hasOwnProperty("accept")&&(this.accept=Array.prototype.map.call(this.fieldInfo.config.accept,(function(e){return e.fileType})).join(","),console.log(this.accept))},methods:{openFilePopup(){document.querySelectorAll('[type="file"]')[0].click()},RemoveFile(e,t){e.stopPropagation();const n=new DataTransfer,r=document.querySelectorAll('[type="file"]')[0],{files:i}=r;this.previewFiles=[];for(let s=0;s<i.length;s++){const e=i[s];if(t!==s){n.items.add(e);var o=e.name.split(".").pop(),a=["jpg","jpeg","png","gif"].includes(o);let t=new FileReader;t.addEventListener("load",()=>{this.file={name:e.name.split(".").shift(),size:Math.round(e.size/1024/1024*100)/100,type:e.type,fileExtention:o,isImage:a,url:t.result,isUploaded:!0},this.previewFiles.push(this.file)},!1),t.readAsDataURL(e)}}r.files=n.files},onChange(e){if(this.errors=[],e.target.files&&e.target.files[0]){for(let o=0;o<e.target.files.length;o++){const a=e.target.files[o];if(this.isFileValid(a)){var t=Math.round(a.size/1024/1024*100)/100,n=a.name.split(".").pop(),r=a.name.split(".").shift(),i=["jpg","jpeg","png","gif"].includes(n);console.log(t,n,r,i);let e=new FileReader;e.addEventListener("load",()=>{this.file={name:r,size:t,type:a.type,fileExtention:n,isImage:i,url:e.result,isUploaded:!0},this.previewFiles.push(this.file)},!1),e.readAsDataURL(a)}else console.log("Invalid file")}0==this.errors.length&&(this.fieldInfo.value=e.target.files,this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo))}},isFileSizeValid(e){e<=this.maxSize?console.log("File size is valid"):this.errors.push(`File size should be less than ${this.maxSize} MB`)},isFileTypeValid(e){this.accept.split(",").includes(e)?console.log("File type is valid"):this.errors.push("File type should be "+this.accept)},isFileValid(e){return this.isFileSizeValid(Math.round(e.size/1024/1024*100)/100),this.isFileTypeValid(e.name.split(".").pop()),0===this.errors.length},canUploadMultipleFile(){return!(!this.fieldInfo.config||!this.fieldInfo.config.hasOwnProperty("multiple"))&&this.fieldInfo.config.multiple}}},Ci=Di,ji=(r("4859"),Zn(Ci,Si,Ii,!1,null,"0a861c4c",null)),Ei=ji.exports,Pi={name:"DynamicForm",components:{ValidationObserver:Je,NumericField:Jn,SelectField:or,TextField:cr,DateField:_r,CheckBoxField:Or,RadioField:Er,MultiSelectField:zr,ToggleField:Jr,PhoneField:oi,CustomSelectField:ci,TextAreaField:gi,ColorField:Oi,FileField:Ei},data:function(){return{clickedButton:null}},props:{lang:{type:String,default:"en"},buttons:{type:Array,default:[]},schema:{type:Array,default:[],required:!0}},methods:{renderButtons:function(e){if(e){var t=[].constructor;return e.constructor===t?e:[]}},GetGroupName:function(e,t){return e||t},isRequired:function(e){let t=!1;if(e){if("string"===typeof e)return e.includes("required");"undefined"===typeof e.length?Object.keys(e).forEach(n=>{"required"==n.toLowerCase()&&1==e[n]&&0==t&&(t=!0)}):"undefined"!==typeof e.length&&e.forEach((function(e){Object.keys(e).forEach(n=>{"required"==n.toLowerCase()&&1==e[n]&&0==t&&(t=!0)})}))}return t},onSubmit:function(){var e={};this.schema.forEach(t=>{t.Data.forEach(t=>{e[t.name]=t.value})}),console.log(e),this.$emit("OnSubmit",e,this.clickedButton),console.log(1001)},onButtonClick:function(e){let t="";t=e.name?e.name:e.text,this.clickedButton=t,e.hasOwnProperty("onClick")&&e.onClick(e)},GetDisplayLabel(e){var t="";return e.hasOwnProperty("label")&&e.label?t=e.label:e.hasOwnProperty("display_name")&&e.display_name&&(t=e.display_name),t},SetFormValues(e){var t=this;e.forEach(e=>{for(var n in e)t.schema.forEach(t=>{t.Data.forEach(t=>{n==t.name&&(t.value=e[n])})})})}},created:function(){}},Ai=Pi,Ti=Zn(Ai,s,l,!1,null,null,null),Mi=Ti.exports,Ni={},Ri=Zn(Ni,Hr,Gr,!1,null,null,null),Fi=Ri.exports,zi={install(e,t={}){e.component("DynamicForm",Mi),e.component("NumericField",Jn),e.component("SelectField",or),e.component("TextField",cr),e.component("DateField",_r),e.component("CheckBoxField",Or),e.component("RadioField",Er),e.component("PhoneField",oi),e.component("CustomSelectField",ci),e.component("MultiSelectField",zr),e.component("TextAreaField",gi),e.component("CKEditorField",Fi)}};n["default"]=zi},fb60:function(e,t,n){"use strict";var r=n("7917"),i=n("c532");function o(e){r.call(this,null==e?"canceled":e,r.ERR_CANCELED),this.name="CanceledError"}i.inherits(o,r,{__CANCEL__:!0}),e.exports=o},fc6a:function(e,t,n){"use strict";var r=n("44ad"),i=n("1d80");e.exports=function(e){return r(i(e))}},fdbf:function(e,t,n){"use strict";var r=n("04f8");e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},fdcd:function(e){e.exports=JSON.parse('{"code":"ka","messages":{"alpha":"{_field_} უნდა შეიცავდეს მხოლოდ ასოებს","alpha_num":"{_field_} უნდა შეიცავდეს მხოლოდ ციფრებს","alpha_dash":"{_field_} უნდა შესაძლებელია შეიცავდეს ციფრებს, ასოებს და პუნქტუაციის ნიშნებს","alpha_spaces":"{_field_} უნდა შეიცავდეს მხოლოდ ასოებსა და ცარიელ სივრცეებს","between":"{_field_} უნდა იყოს {min} და {max}ს შორის","confirmed":"{_field_} არ ემთხვევა {target}(ი)ს","digits":"{_field_} უნდა შეიცავდეს ციფრებს და უნდა იყოს ზუსტად {length}-ნიშნა","dimensions":"{_field_} უნდა იყოს {width}x{height} ზომის (pixel)","email":"{_field_}-ს უნდა ჰქონდეს ელ-ფოსტის სწორი ფორმატი","excluded":"{_field_} უნდა იყოს სწორი მნიშვნელობა","ext":"{_field_} უნდა იყოს ფაილი","image":"{_field_} უნდა იყოს სურათი","max_value":"{_field_} უნდა შეიცავდეს {max} სიმბოლოს ან ნაკლებს","max":"{_field_} არ უნდა იყოს {length} სიმბოლოზე მეტი","mimes":"{_field_}ს უნდა ჰქონდეს სწორი ფაილის ფორმატი","min_value":"{_field_} უნდა შეიცავდეს {min} ან მეტ სიმბოლოს","min":"{_field_} უნდა შეიცავდეს მინიმუმ {length} სიმბოლოს","numeric":"{_field_} უნდა შეიცავდეს ციფრებს","oneOf":"{_field_} უნდა იყოს სწორი მნიშვნელობა","regex":"{_field_}-(ი)ს ფორმატი არასწორია","required":"{_field_} აუცილებელია","required_if":"{_field_} აუცილებელია","size":"{_field_} უნდა იყოს {size}KB-ზე ნაკლები","double":"{_field_} ველი უნდა იყოს სწორი ათობითი"}}')}})}));
15
+ */function Mt(e){return null===e||void 0===e}function Nt(e){return Array.isArray(e)&&0===e.length}function Rt(e){return"function"===typeof e}function Ft(e,t){return-1!==e.indexOf(t)}function zt(e){return Rt(Array.from)?Array.from(e):Lt(e)}function Lt(e){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}var Bt=function(e,t){return Array.isArray(e)?e.every((function(e){return Bt(e,t)})):zt(t).some((function(t){return t==e}))},Yt={validate:Bt},Vt=function(e,t){return!Bt(e,t)},Ut={validate:Vt},qt=function(e,t){var n=new RegExp(".("+t.join("|")+")$","i");return Array.isArray(e)?e.every((function(e){return n.test(e.name)})):n.test(e.name)},Ht={validate:qt},Gt=function(e){var t=/\.(jpg|svg|jpeg|png|bmp|gif|webp)$/i;return Array.isArray(e)?e.every((function(e){return t.test(e.name)})):t.test(e.name)},Wt={validate:Gt},Zt=function(e){return Array.isArray(e)?e.every((function(e){return/^-?[0-9]+$/.test(String(e))})):/^-?[0-9]+$/.test(String(e))},Kt={validate:Zt},Jt=function(e,t){var n=t.other;return e===n},Xt=[{name:"other"}],Qt={validate:Jt,params:Xt},en=function(e,t){var n=t.other;return e!==n},tn=[{name:"other"}],nn={validate:en,params:tn},rn=function(e,t){var n=t.length;return!Mt(e)&&("string"===typeof e&&(e=zt(e)),"number"===typeof e&&(e=String(e)),e.length||(e=zt(e)),e.length===n)},on=[{name:"length",cast:function(e){return Number(e)}}],an={validate:rn,params:on},sn=function(e,t){var n=t.length;return Mt(e)?n>=0:Array.isArray(e)?e.every((function(e){return sn(e,{length:n})})):String(e).length<=n},ln=[{name:"length",cast:function(e){return Number(e)}}],dn={validate:sn,params:ln},un=function(e,t){var n=t.max;return!Mt(e)&&""!==e&&(Array.isArray(e)?e.length>0&&e.every((function(e){return un(e,{max:n})})):Number(e)<=n)},cn=[{name:"max",cast:function(e){return Number(e)}}],fn={validate:un,params:cn},pn=function(e,t){var n=new RegExp(t.join("|").replace("*",".+")+"$","i");return Array.isArray(e)?e.every((function(e){return n.test(e.type)})):n.test(e.type)},hn={validate:pn},vn=function(e,t){var n=t.length;return!Mt(e)&&(Array.isArray(e)?e.every((function(e){return vn(e,{length:n})})):String(e).length>=n)},mn=[{name:"length",cast:function(e){return Number(e)}}],gn={validate:vn,params:mn},bn=function(e,t){var n=t.min;return!Mt(e)&&""!==e&&(Array.isArray(e)?e.length>0&&e.every((function(e){return bn(e,{min:n})})):Number(e)>=n)},_n=[{name:"min",cast:function(e){return Number(e)}}],yn={validate:bn,params:_n},$n=/^[٠١٢٣٤٥٦٧٨٩]+$/,xn=/^[0-9]+$/,wn=function(e){var t=function(e){var t=String(e);return xn.test(t)||$n.test(t)};return Array.isArray(e)?e.every(t):t(e)},kn={validate:wn},On=function(e,t){var n=t.regex;return Array.isArray(e)?e.every((function(e){return On(e,{regex:n})})):n.test(String(e))},Sn=[{name:"regex",cast:function(e){return"string"===typeof e?new RegExp(e):e}}],In={validate:On,params:Sn},Dn=function(e,t){var n=(void 0===t?{allowFalse:!0}:t).allowFalse,r={valid:!1,required:!0};return Mt(e)||Nt(e)?r:!1!==e||n?(r.valid=!!String(e).trim().length,r):r},Cn=!0,jn=[{name:"allowFalse",default:!0}],En={validate:Dn,params:jn,computesRequired:Cn},Pn=function(e){return Nt(e)||Ft([!1,null,void 0],e)||!String(e).trim().length},An=function(e,t){var n,r=t.target,i=t.values;return i&&i.length?(Array.isArray(i)||"string"!==typeof i||(i=[i]),n=i.some((function(e){return e==String(r).trim()}))):n=!Pn(r),n?{valid:!Pn(e),required:n}:{valid:!0,required:n}},Tn=[{name:"target",isTarget:!0},{name:"values"}],Mn=!0,Nn={validate:An,params:Tn,computesRequired:Mn},Rn=function(e,t){var n=t.size;if(isNaN(n))return!1;var r=1024*n;if(!Array.isArray(e))return e.size<=r;for(var i=0;i<e.length;i++)if(e[i].size>r)return!1;return!0},Fn=[{name:"size",cast:function(e){return Number(e)}}],zn={validate:Rn,params:Fn},Ln=function(e,t){var n=t||{},r=n.decimals,i=void 0===r?0:r,o=n.separator,a=void 0===o?"dot":o,s="comma"===a?",?":"\\.?",l=0===i?"\\d*":"(\\d{"+i+"})?",d=new RegExp("^-?\\d+"+s+l+"$");return Array.isArray(e)?e.every((function(e){return d.test(String(e))})):d.test(String(e))},Bn=[{name:"decimals",default:0},{name:"separator",default:"dot"}],Yn={validate:Ln,params:Bn};function Vn(e){return r("bb28")(`./${e}.json`).then(t=>{fe(e,t)})}function Un(e,t){let n={},r=Vn(null!==t&&void 0!==t?t:"en");return e&&("string"===typeof e||"undefined"===typeof e.length?n=e:"undefined"!==typeof e.length&&e.forEach((function(e){Object.keys(e).forEach(t=>{"errormessage"!=t.toLowerCase()&&(n[t]=e[t]),"errormessage"!=t.toLowerCase()&&"undefined"!=typeof e.errorMessage&&"function"!==typeof e[t]&&(r.messages[t]=e.errorMessage),"function"!==typeof e[t]&&"object"!==typeof e[t]||R(t,e[t])})}))),n}Object.keys(i).forEach(e=>{R(e,i[e])}),R("password",{params:["target"],validate(e,{target:t}){return e===t},message:"Password confirmation does not match"}),R("url",{validate(e){return!!e&&/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/.test(e)},message:"The {_field_} field must be a valid URL"}),R("colorCode",{validate(e){return!!e&&/^#[0-9A-F]{6}$/.test(e)},message:"The {_field_} field must be a valid color"}),R("ZipCode",{validate(e){return!!e&&/(^\d{6}$)|(^\d{5}-\d{4}$)/.test(e)},message:"The {_field_} field is not valid"});var qn=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("input",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],class:{"form-control w-100":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled,type:"text",placeholder:e.fieldInfo.placeholder},domProps:{value:e.fieldInfo.value},on:{change:function(t){return e.onChange(t)},blur:function(t){return e.onBlur(t)},keypress:e.onlyForCurrency,input:function(t){t.target.composing||e.$set(e.fieldInfo,"value",t.target.value)}}}),n[0]?t("span",{staticClass:"invalid-feedback",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},Hn=[],Gn={components:{Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{value:""}},methods:{onlyForCurrency(e){let t=e.keyCode?e.keyCode:e.which;!(t<48||t>57)||46===t&&-1==this.fieldInfo.value.indexOf(".")||e.preventDefault(),null!=this.fieldInfo.value&&this.fieldInfo.value.indexOf(".")>-1&&this.fieldInfo.value.split(".")[1].length>1&&e.preventDefault()},onChange:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},onBlur:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onBlur&&this.fieldInfo.config.onBlur(e,this.fieldInfo)}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)}},Wn=Gn;function Zn(e,t,n,r,i,o,a,s){var l,d="function"===typeof e?e.options:e;if(t&&(d.render=t,d.staticRenderFns=n,d._compiled=!0),r&&(d.functional=!0),o&&(d._scopeId="data-v-"+o),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},d._ssrRegister=l):i&&(l=s?function(){i.call(this,(d.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(d.functional){d._injectStyles=l;var u=d.render;d.render=function(e,t){return l.call(t),u(e,t)}}else{var c=d.beforeCreate;d.beforeCreate=c?[].concat(c,l):[l]}return{exports:e,options:d}}var Kn=Zn(Wn,qn,Hn,!1,null,null,null),Jn=Kn.exports,Xn=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"d-flex w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("select",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],class:{"form-control w-100":!0,"is-invalid":n[0]},attrs:{name:e.fieldInfo.name,disabled:e.fieldInfo.disabled},on:{change:[function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(e.fieldInfo,"value",t.target.multiple?n:n[0])},function(t){return e.onChange(t)}]}},[t("option",{attrs:{value:"",selected:""}},[e._v("Select "+e._s(e.fieldInfo.label))]),e._l(e.options,(function(n,r){return t("option",{key:r,domProps:{value:n.value,selected:e.fieldInfo.value==n.value}},[e._v(e._s(n.name)+" ")])}))],2),e.showAddIcon()?t("div",{staticClass:"ml-2 mt-1"},[t("a",{class:e.addButtonClass()},[t("i",{class:e.addIconClass(),attrs:{alt:"+"},on:{click:function(t){return e.onAddButtonClick(t)}}})])]):e._e(),n[0]?t("span",{staticClass:"invalid-feedback d-block"},[e._v(e._s(n[0]))]):e._e()]}}])})},Qn=[],er=(r("14d9"),r("bc3a")),tr=r.n(er),nr={components:{Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data(){return{options:[],dependentOptions:[]}},async created(){await this.GetSelectOptions()},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)},methods:{onChange(e){if(this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange){if(this.fieldInfo.config.hasOwnProperty("dependent_request_urls")){var t=[];this.fieldInfo.config.dependent_request_urls.forEach(async e=>{for(var n in e)await tr.a.get(this.fieldInfo.config.dependent_request_urls+e[n],{headers:{Authorization:"Bearer "+this.fieldInfo.config.token}}).then(e=>{e.data&&(t=e.data,this.dependentOptions.push({request:t}))}).catch(e=>{console.log("Error on binding slect option in tg-control- "+e)})})}this.fieldInfo.config.onChange(e,this.fieldInfo,this.dependentOptions)}},showAddIcon:function(){if(this.fieldInfo.config&&this.fieldInfo.config.showAddIcon)return this.fieldInfo.config.showAddIcon},onAddButtonClick:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onAddButtonClick&&this.fieldInfo.config.onAddButtonClick(e,this.fieldInfo)},addButtonClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIconBackground?"round-icon-small theme-primary "+this.fieldInfo.config.addIconBackground:"round-icon-small btn-dark theme-primary"},addIconClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIcon?"fa text-white pt-7 font-18 "+this.fieldInfo.config.addIcon:"fa fa-plus text-white pt-7 font-18"},GetSelectOptions:async function(){var e=this,t=[];e.fieldInfo.hasOwnProperty("picklist_options")&&"Lookup"!=e.fieldInfo.picklist_options?t=e.MakeArray(e.fieldInfo.picklist_options):e.fieldInfo.hasOwnProperty("select_options")&&e.fieldInfo.select_options.length>0?t=e.MakeNormalArray(e.fieldInfo.select_options):e.fieldInfo.hasOwnProperty("config")&&e.fieldInfo.config.hasOwnProperty("options")&&e.fieldInfo.config.options.length>0?t=e.fieldInfo.config.options:e.fieldInfo.hasOwnProperty("config")&&e.fieldInfo.config.hasOwnProperty("option_request_url")&&e.fieldInfo.config.option_request_url.length>0&&await tr.a.get(e.fieldInfo.config.option_request_url,{headers:{Authorization:"Bearer "+e.fieldInfo.config.token}}).then(e=>{console.log(e.data),e.data&&(t=e.data)}).catch(e=>{console.log("Error on binding slect option in tg-control- "+e)}),t.length>0?t.forEach((t,n)=>{e.options.push({value:t.value,name:t.hasOwnProperty("text")?t.text:t.name})}):console.log(" No select options found for the - "+e.fieldInfo.name)},MakeNormalArray:function(e){if(e)try{return JSON.parse(e)}catch(t){return e}else e=[]},MakeArray:function(e,t){var n=[],r=String(e).split(",");if("radio"==t||"checkbox"==t){if(r.length>0)for(let o of r)if(o.split("|").length>1){var i={name:o.split("|")[0].trim(),value:o.split("|")[1].trim()};n.push(i)}else{i={name:o.trim(),value:o.trim()};n.push(i)}}else if(r.length>0)for(let o of r){i={name:o.trim(),value:o.trim()};n.push(i)}return n}}},rr=nr,ir=Zn(rr,Xn,Qn,!1,null,null,null),or=ir.exports,ar=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("input",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],class:{"form-control w-100":!0,"is-invalid":n[0]},attrs:{name:e.fieldInfo.name,id:e.fieldInfo.name,type:"text",placeholder:e.fieldInfo.placeholder,disabled:e.fieldInfo.disabled},domProps:{value:e.fieldInfo.value},on:{change:function(t){return e.onChange(t)},blur:function(t){return e.onBlur(t)},input:function(t){t.target.composing||e.$set(e.fieldInfo,"value",t.target.value)}}}),e.showAddIcon()?t("div",{staticClass:"ml-2 mt-1"},[t("a",{class:e.addButtonClass()},[t("i",{class:e.addIconClass(),attrs:{alt:"+"},on:{click:function(t){return e.onAddButtonClick(t)}}})])]):e._e(),n[0]?t("span",{staticClass:"invalid-feedback",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},sr=[],lr={components:{Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)},methods:{onChange:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},onBlur:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onBlur&&this.fieldInfo.config.onBlur(e,this.fieldInfo)},showAddIcon:function(){if(this.fieldInfo.config&&this.fieldInfo.config.showAddIcon)return this.fieldInfo.config.showAddIcon},onAddButtonClick:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onAddButtonClick&&this.fieldInfo.config.onAddButtonClick(e,this.fieldInfo)},addButtonClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIconBackground?"round-icon-small theme-primary "+this.fieldInfo.config.addIconBackground:"round-icon-small btn-dark theme-primary"},addIconClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIcon?"fa text-white pt-7 font-18 "+this.fieldInfo.config.addIcon:"fa fa-plus text-white pt-7 font-18"}}},dr=lr,ur=Zn(dr,ar,sr,!1,null,null,null),cr=ur.exports,fr=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("DatePicker",{class:{"input-group w-100":!0,"is-invalid":n[0]},staticStyle:{"flex-wrap":"nowrap"},attrs:{is24hr:e.is24hr,mode:e.mode,disabled:e.fieldInfo.disabled,masks:e.masks,popover:e.popover,"min-date":e.getMinmumDate(e.fieldInfo),"max-date":e.getMaxDate(e.fieldInfo),"minute-increment":5},scopedSlots:e._u([{key:"default",fn:function({inputValue:r,inputEvents:i,togglePopover:o}){return[t("input",e._g({ref:"inputDatePicker",class:{"form-control w-100":!0,"is-invalid":n[0]},attrs:{autocomplete:"off",disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,placeholder:e.fieldInfo.label},domProps:{value:r},on:{blur:function(t){return e.onBlur(t,e.field)}}},i)),t("div",{staticClass:"input-group-append"},[t("span",e._g({staticClass:"input-group-text"},i),[t("i",{staticClass:"fa fa-calendar"})])])]}}],null,!0),model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}),t("span",{directives:[{name:"show",rawName:"v-show",value:n[0],expression:"errors[0]"}],ref:"errrorMessage",staticClass:"invalid-feedback d-block"},[e._v(e._s(n[0]))])]}}])})},pr=[],hr=r("404b"),vr=r.n(hr),mr={components:{Field:Le,DatePicker:vr.a},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{popover:{visibility:"click"},masks:{input:"DD-MM-YYYY"},date:new Date,mode:"date",is24hr:!1}},methods:{getMinmumDate(e){if(e.config&&this.fieldInfo.config.minDate)return e.config.minDate},getMaxDate(e){if(e.config&&this.fieldInfo.config.maxDate)return e.config.maxDate},onBlur(t){try{t.onBlur[0](),t.onBlur[1]()}catch(n){}this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onBlur&&this.fieldInfo.config.onBlur(e,this.fieldInfo)}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang),this.fieldInfo.config&&this.fieldInfo.config.is24hr&&(this.is24hr=this.fieldInfo.config.is24hr),this.fieldInfo.config&&this.fieldInfo.config.mode&&(this.mode=this.fieldInfo.config.mode),this.fieldInfo.config&&this.fieldInfo.config.format&&("date"==this.mode?this.masks.input=this.fieldInfo.config.format:"dateTime"==this.mode?this.masks.inputDateTime=this.fieldInfo.config.format:"time"==this.mode&&(this.masks.inputTime=this.fieldInfo.config.format))}},gr=mr,br=(r("9f68"),Zn(gr,fr,pr,!1,null,null,null)),_r=br.exports,yr=function(){var e=this,t=e._self._c;return t("Field",{attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[e._l(e.renderOptions(e.fieldInfo),(function(r,i){return t("label",{key:i,class:{"form-check form-check-inline":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled}},[t("div",{staticClass:"custom-control custom-check custom-control-inline"},[t("input",{staticClass:"custom-control-input",attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name+"_"+i,id:e.fieldInfo.name+"_"+i,type:"checkbox"},domProps:{checked:e.isChecked(r),value:r.value},on:{change:function(t){return e.onChange(t,e.field)}}}),t("label",{staticClass:"custom-control-label",attrs:{for:e.fieldInfo.name+"_"+i}},[e._v(e._s(r.name))])])])})),n[0]?t("span",{staticClass:"invalid-feedback"},[e._v(e._s(n[0]))]):e._e()]}}])})},$r=[],xr={components:{Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{checkOptions:[]}},created:function(){},methods:{renderOptions:function(e){if(e.config&&this.fieldInfo.config.options){var t=[].constructor;return this.fieldInfo.config.options.constructor===t?e.config.options:null}},onChange:function(e,t){"array"!=typeof this.fieldInfo.value&&"object"!=typeof this.fieldInfo.value&&(this.fieldInfo.value=this.fieldInfo.value.toString().split()),e.target.checked?(this.fieldInfo.value="string"==typeof this.fieldInfo.value?[]:this.fieldInfo.value,this.fieldInfo.value.push(e.target.value)):this.fieldInfo.value.splice(this.fieldInfo.value.indexOf(e.target.value),1);try{t.onBlur[0](),t.onBlur[1]()}catch(n){}this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},isChecked:function(t){try{return"array"==typeof this.fieldInfo.value||"object"==typeof this.fieldInfo.value?this.fieldInfo.value.includes(t.value):this.fieldInfo.value==t.value}catch(e){console.log("Checkbox value should be in string or array")}}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang),this.fieldInfo&&this.fieldInfo.value&&"array"!=typeof this.fieldInfo.value&&"object"!=typeof this.fieldInfo.value&&(this.fieldInfo.value=this.fieldInfo.value.toString().split())}},wr=xr,kr=Zn(wr,yr,$r,!1,null,null,null),Or=kr.exports,Sr=function(){var e=this,t=e._self._c;return t("Field",{attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label,slim:""},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return e._l(e.renderOptions(e.fieldInfo),(function(r,i){return t("label",{key:i,class:{"form-check form-check-inline":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled}},[t("div",{staticClass:"custom-control custom-radio custom-control-inline"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],staticClass:"custom-control-input",attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,id:e.fieldInfo.name+"_"+i,type:"radio"},domProps:{checked:r.value==e.fieldInfo.value,checked:e._q(e.fieldInfo.value,null)},on:{change:[function(t){return e.$set(e.fieldInfo,"value",null)},function(t){return e.onChange(t)}]}}),t("label",{staticClass:"custom-control-label",attrs:{for:e.fieldInfo.name+"_"+i}},[e._v(e._s(r.name))])])])}))}}])})},Ir=[],Dr={components:{Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{checkOptions:[]}},methods:{renderOptions:function(e){if(e.config&&this.fieldInfo.config.options){var t=[].constructor;return this.fieldInfo.config.options.constructor===t?e.config.options:null}},AssignToggleValues:function(e,t,n){this.$emit("AssignToggleValues",e,t,n)},showDependentItem:function(e,t){this.$emit("showDependentItem",e,t)},onChange(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)}},Cr=Dr,jr=Zn(Cr,Sr,Ir,!1,null,null,null),Er=jr.exports,Pr=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("Multiselect",{ref:"multiselect",class:{"form-control p-0 w-100":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled,options:e.options,"close-on-select":!1,searchable:!0,multiple:"tag"==e.fieldInfo.modemode,taggable:"tag"==e.fieldInfo.mode},on:{remove:function(t){return e.onRemove(t,e.field,e.meta)},"search-change":e.onSearch,select:e.onChange},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}),e.showAddIcon()?t("div",{staticClass:"ml-2 mt-1"},[t("a",{class:e.addButtonClass()},[t("i",{class:e.addIconClass(),attrs:{alt:"+"},on:{click:function(t){return e.onAddButtonClick(t)}}})])]):e._e(),n[0]?t("span",{staticClass:"invalid-feedback"},[e._v(e._s(n[0]))]):e._e()]}}])})},Ar=[],Tr=r("8e5f"),Mr=r.n(Tr),Nr={components:{Multiselect:Mr.a,Field:Le},props:{lang:{type:String,default:"en"},mode:{type:String,default:"single"},fieldInfo:{type:Object,required:!0}},watch:{fieldInfo:{handler:function(e,t){let n=this;if(console.log("Multi drop down",e,t),e.config&&e.config.options)try{n.options=[],e.config.options.forEach((function(e){let t={value:e.value,label:e.name};n.options.push(t)}))}catch(r){}},deep:!0}},created:function(){let e=this;if("undefined"!=typeof e.fieldInfo.value&&""!=e.fieldInfo.value||(e.fieldInfo.value=[]),"undefined"!=typeof e.fieldInfo.mode&&""!=e.fieldInfo.mode||(e.fieldInfo.mode="single"),e.fieldInfo.config&&e.fieldInfo.config.options)try{e.fieldInfo.config.options.forEach((function(t){let n={value:t.value,label:t.name};e.options.push(n)}))}catch(t){console.log(t)}},data:function(){return{isTouched:!1,value:[],selectedHtml:"",options:[]}},computed:{isInvalid(){return this.isTouched&&0===this.value.length}},methods:{onSearch:function(e,t){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onSearchChange&&this.fieldInfo.config.onSearchChange(t,this.fieldInfo)},onChange:function(e,t){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(t,this.fieldInfo)},showAddIcon:function(){if(this.fieldInfo.config&&this.fieldInfo.config.showAddIcon)return this.fieldInfo.config.showAddIcon},onAddButtonClick:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onAddButtonClick&&this.fieldInfo.config.onAddButtonClick(e,this.fieldInfo)},addButtonClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIconBackground?"round-icon-small theme-primary "+this.fieldInfo.config.addIconBackground:"round-icon-small btn-dark theme-primary"},addIconClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIcon?"fa text-white pt-7 font-18 "+this.fieldInfo.config.addIcon:"fa fa-plus text-white pt-7 font-18"}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)}},Rr=Nr,Fr=(r("8498"),Zn(Rr,Pr,Ar,!1,null,null,null)),zr=Fr.exports,Lr=function(){var e=this,t=e._self._c;return t("Field",{attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("div",{class:{"is-invalid":n[0]}},[t("Toggle",{attrs:{disabled:e.fieldInfo.disabled,"on-label":"Yes","off-label":"No"},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}})],1),n[0]?t("span",{staticClass:"invalid-feedback",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},Br=[];function Yr(e,t,n,r,i,o,a,s,l,d){"boolean"!=typeof a&&(l=s,s=a,a=!1);const u="function"==typeof n?n.options:n;let c;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,i&&(u.functional=!0)),r&&(u._scopeId=r),o?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=c):t&&(c=a?function(e){t.call(this,d(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,s(e))}),c)if(u.functional){const e=u.render;u.render=function(t,n){return c.call(n),e(t,n)}}else{const e=u.beforeCreate;u.beforeCreate=e?[].concat(e,c):[c]}return n}const Vr={name:"Toggle",emits:["input","update:modelValue","change"],props:{value:{validator:function(e){return e=>-1!==["number","string","boolean"].indexOf(typeof e)||null==e},required:!1},modelValue:{validator:function(e){return e=>-1!==["number","string","boolean"].indexOf(typeof e)||null==e},required:!1},id:{type:[String,Number],required:!1,default:"toggle"},name:{type:[String,Number],required:!1,default:"toggle"},disabled:{type:Boolean,required:!1,default:!1},required:{type:Boolean,required:!1,default:!1},falseValue:{type:[String,Number,Boolean],required:!1,default:!1},trueValue:{type:[String,Number,Boolean],required:!1,default:!0},onLabel:{type:[String,Object],required:!1,default:""},offLabel:{type:[String,Object],required:!1,default:""},classes:{type:Object,required:!1,default:()=>({})},labelledby:{type:String,required:!1},describedby:{type:String,required:!1},aria:{required:!1,type:Object,default:()=>({})}},setup(e,t){const n=function(e,t,n){const{value:r,modelValue:i,falseValue:o,trueValue:a,disabled:s}=Object(d["toRefs"])(e),l=i&&void 0!==i.value?i:r,u=Object(d["computed"])(()=>l.value===a.value),c=e=>{t.emit("input",e),t.emit("update:modelValue",e),t.emit("change",e)},f=()=>{c(a.value)},p=()=>{c(o.value)};return-1!==[null,void 0,!1,0,"0","off"].indexOf(l.value)&&-1===[o.value,a.value].indexOf(l.value)&&p(),-1!==[!0,1,"1","on"].indexOf(l.value)&&-1===[o.value,a.value].indexOf(l.value)&&f(),{externalValue:l,checked:u,update:c,check:f,uncheck:p,handleInput:e=>{c(e.target.checked?a.value:o.value)},handleClick:()=>{s.value||(u.value?p():f())}}}(e,t),r=function(e,t,n){const{trueValue:r,falseValue:i,onLabel:o,offLabel:a}=Object(d["toRefs"])(e),s=n.checked,l=n.update;return{label:Object(d["computed"])(()=>{let e=s.value?o.value:a.value;return e||(e="&nbsp;"),e}),toggle:()=>{l(s.value?i.value:r.value)},on:()=>{l(r.value)},off:()=>{l(i.value)}}}(e,0,{checked:n.checked,update:n.update}),i=function(e,t,n){const r=Object(d["toRefs"])(e),i=r.disabled,o=n.checked,a=Object(d["computed"])(()=>({container:"toggle-container",toggle:"toggle",toggleOn:"toggle-on",toggleOff:"toggle-off",toggleOnDisabled:"toggle-on-disabled",toggleOffDisabled:"toggle-off-disabled",handle:"toggle-handle",handleOn:"toggle-handle-on",handleOff:"toggle-handle-off",handleOnDisabled:"toggle-handle-on-disabled",handleOffDisabled:"toggle-handle-off-disabled",label:"toggle-label",...r.classes.value}));return{classList:Object(d["computed"])(()=>({container:a.value.container,toggle:[a.value.toggle,i.value?o.value?a.value.toggleOnDisabled:a.value.toggleOffDisabled:o.value?a.value.toggleOn:a.value.toggleOff],handle:[a.value.handle,i.value?o.value?a.value.handleOnDisabled:a.value.handleOffDisabled:o.value?a.value.handleOn:a.value.handleOff],label:a.value.label}))}}(e,0,{checked:n.checked}),o=function(e,t,n){const{disabled:r}=Object(d["toRefs"])(e),i=n.check,o=n.uncheck,a=n.checked;return{handleSpace:()=>{r.value||(a.value?o():i())}}}(e,0,{check:n.check,uncheck:n.uncheck,checked:n.checked});return{...n,...i,...r,...o}}};var Ur=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",e._b({class:e.classList.container,attrs:{tabindex:e.disabled?void 0:0,"aria-checked":e.checked,"aria-describedby":e.describedby,"aria-labelledby":e.labelledby,role:"switch"},on:{keypress:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])?null:(t.preventDefault(),e.handleSpace.apply(null,arguments))}}},"div",e.aria,!1),[n("input",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],attrs:{type:"checkbox",id:e.id,name:e.name,disabled:e.disabled},domProps:{value:e.trueValue,checked:e.checked}}),e._v(" "),n("div",{class:e.classList.toggle,on:{click:e.handleClick}},[n("span",{class:e.classList.handle}),e._v(" "),e._t("label",(function(){return[n("span",{class:e.classList.label,domProps:{innerHTML:e._s(e.label)}})]}),{checked:e.checked,classList:e.classList}),e._v(" "),e.required?n("input",{style:{appearance:"none",height:"1px",margin:"0",padding:"0",fontSize:"0",background:"transparent",position:"absolute",width:"100%",bottom:"0",outline:"none"},attrs:{type:"checkbox","aria-hidden":"true",tabindex:"-1",required:""},domProps:{checked:e.checked}}):e._e()],2)])};Ur._withStripped=!0;const qr=Yr({render:Ur,staticRenderFns:[]},void 0,Vr,void 0,!1,void 0,!1,void 0,void 0,void 0);var Hr,Gr,Wr={components:{Toggle:qr,Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,defineRule,configure,this.lang)}},Zr=Wr,Kr=(r("8542"),Zn(Zr,Lr,Br,!1,null,null,null)),Jr=Kr.exports,Xr=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,disabled:e.fieldInfo.disabled,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("vue-tel-input",{staticClass:"w-100",attrs:{mode:"international",validCharactersOnly:!0},on:{input:e.onInput},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}),n[0]?t("span",{staticClass:"invalid-feedback d-block",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},Qr=[],ei=r("e75b"),ti=r.n(ei),ni=(r("bf68"),{install:(e,t)=>{e.use(ti.a,{})},components:{VueTelInput:ti.a,Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{phoneError:!1}},methods:{onInput(e,t,n){t&&0==(null===t||void 0===t?void 0:t.valid)?this.phoneError=!0:null!==t&&void 0!==t&&t.formatted&&null!==t&&void 0!==t&&t.valid&&(this.fieldInfo.value=t.formatted,this.phoneError=!1)}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)}}),ri=ni,ii=Zn(ri,Xr,Qr,!1,null,null,null),oi=ii.exports,ai=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("Multiselect",{class:{"form-control p-0 w-100":!0,"is-invalid":n[0]},attrs:{"filter-results":!1,object:!0,showNoOptions:!0,searchable:!0,label:"label","track-by":"value","show-labels":!1,"show-no-results":!1,"internal-search":!1,disabled:e.fieldInfo.disabled,options:e.options,multiple:"tag"==e.fieldInfo.mode,taggable:"tag"==e.fieldInfo.mode,"clear-on-select":!1,"close-on-select":!1,"open-direction":"bottom"},on:{"search-change":e.onSearch,select:e.onChange},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}},[t("span",{attrs:{slot:"noOptions"},slot:"noOptions"},[e._v(" Type to search "+e._s(e.fieldInfo.display_name)+" ")])]),e.showAddIcon()?t("div",{staticClass:"ml-2 mt-1"},[t("a",{class:e.addButtonClass()},[t("i",{class:e.addIconClass(),attrs:{alt:"+"},on:{click:function(t){return e.onAddButtonClick(t)}}})])]):e._e(),n[0]?t("span",{staticClass:"invalid-feedback"},[e._v(e._s(n[0]))]):e._e()]}}])})},si=[],li={components:{Multiselect:Mr.a,Field:Le},props:{lang:{type:String,default:"en"},mode:{type:String,default:"single"},fieldInfo:{type:Object,required:!0}},watch:{fieldInfo:{handler:function(e,t){let n=this;if(console.log("Multi drop down",e,t),e.config&&e.config.options)try{n.options=[],e.config.options.forEach((function(e){let t={value:e.value,label:e.name};n.options.push(t)}))}catch(r){}},deep:!0}},created:function(){let e=this;if("undefined"!=typeof e.fieldInfo.value&&""!=e.fieldInfo.value||(e.fieldInfo.value=[]),"undefined"!=typeof e.fieldInfo.mode&&""!=e.fieldInfo.mode||(e.fieldInfo.mode="single"),e.fieldInfo.config&&e.fieldInfo.config.options)try{e.fieldInfo.config.options.forEach((function(t){let n={value:t.value,label:t.name};e.options.push(n)}))}catch(t){console.log(t)}},data:function(){return{isTouched:!1,value:[],options:[]}},computed:{isInvalid(){return this.isTouched&&0===this.value.length}},methods:{onSearch:function(e,t){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onSearchChange&&this.fieldInfo.config.onSearchChange(t,this.fieldInfo)},onChange:function(e,t){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(t,this.fieldInfo)},showAddIcon:function(){if(this.fieldInfo.config&&this.fieldInfo.config.showAddIcon)return this.fieldInfo.config.showAddIcon},onAddButtonClick:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onAddButtonClick&&this.fieldInfo.config.onAddButtonClick(e,this.fieldInfo)},addButtonClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIconBackground?"round-icon-small theme-primary "+this.fieldInfo.config.addIconBackground:"round-icon-small btn-dark theme-primary"},addIconClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIcon?"fa text-white pt-7 font-18 "+this.fieldInfo.config.addIcon:"fa fa-plus text-white pt-7 font-18"}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)}},di=li,ui=Zn(di,ai,si,!1,null,null,null),ci=ui.exports,fi=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],class:{"form-control":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled,rows:e.getRows(e.fieldInfo),cols:e.getColumns(e.fieldInfo),placeholder:e.fieldInfo.placeholder},domProps:{value:e.fieldInfo.value},on:{change:function(t){return e.onChange(t)},blur:function(t){return e.onBlur(t)},input:function(t){t.target.composing||e.$set(e.fieldInfo,"value",t.target.value)}}}),n[0]?t("span",{staticClass:"invalid-feedback",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},pi=[],hi={components:{Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},methods:{getColumns(e){if(e.config&&this.fieldInfo.config.cols)return e.config.cols},getRows(e){if(e.config&&this.fieldInfo.config.rows)return e.config.rows},onChange:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},onBlur:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onBlur&&this.fieldInfo.config.onBlur(e,this.fieldInfo)}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)}},vi=hi,mi=Zn(vi,fi,pi,!1,null,null,null),gi=mi.exports,bi=function(){var e=this,t=e._self._c;return t("div",{ref:"colorpicker",staticClass:"input-group color-picker"},[t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("input",{staticClass:"form-control w-100",attrs:{disabled:"disabled",type:"text",name:e.fieldInfo.name,pattern:"^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},domProps:{value:e.fieldInfo.value},on:{input:e.updateFromInput,change:e.updateFromInput}})]}}])}),t("span",{staticClass:"input-group-addon color-picker-container",staticStyle:{padding:"6px 12px","font-size":"14px","font-weight":"400","line-height":"1",color:"#555","text-align":"center","background-color":"#eee",border:"1px solid #ccc","border-radius":"4px"},on:{click:function(t){return e.showPicker()}}},[t("span",{staticClass:"current-color",staticStyle:{width:"20px",height:"20px",display:"block"},style:"background-color:"+e.colorValue,on:{click:function(t){return e.togglePicker()}}}),e.displayPicker?t("ColorPicker",{staticStyle:{position:"absolute"},attrs:{theme:"light",disabled:e.fieldInfo.disabled},on:{changeColor:e.updateFromPicker},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}):e._e()],1)],1)},_i=[],yi=r("b9d7"),$i=r.n(yi),xi={props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},components:{Field:Le,ColorPicker:$i.a.component},data:function(){return{color:"#000000",suckerCanvas:null,suckerArea:[],isSucking:!0,colorValue:"",displayPicker:!1}},created(){this.fieldInfo&&this.fieldInfo.value?this.color=this.fieldInfo.value:this.fieldInfo.value=this.color},mounted:function(){this.setColor(this.color||"#59c7f9"),this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang)},methods:{setColor:function(e){this.updateColors(e),this.colorValue=e},updateColors:function(e){if("#"==e.slice(0,1))this.colors={hex:e};else if("rgba"==e.slice(0,4)){var t=e.replace(/^rgba?\(|\s+|\)$/g,"").split(","),n="#"+((1<<24)+(parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).slice(1);this.colors={hex:n,a:t[3]}}this.isSucking=!0},showPicker:function(){document.addEventListener("click",this.documentClick),this.displayPicker=!0},hidePicker:function(){document.removeEventListener("click",this.documentClick),this.displayPicker=!1},togglePicker:function(){this.displayPicker?this.hidePicker():this.showPicker()},updateFromInput:function(){var e=new RegExp("^#[0-9A-F]{6}$"),t=this.colorValue;if(!e.test(t))return!1;this.updateColors(this.colorValue)},updateFromPicker(e){this.colors=e,1==e.rgba.a?(this.colorValue=e.hex,this.fieldInfo.value=this.colorValue):(this.colorValue="rgba("+e.rgba.r+", "+e.rgba.g+", "+e.rgba.b+", "+e.rgba.a+")",this.fieldInfo.value=this.colorValue)},documentClick:function(e){var t=this.$refs.colorpicker,n=e.target;t===n||t.contains(n)||this.hidePicker()}},watch:{colorValue:function(e){e&&(this.updateColors(e),this.updateFromInput(),this.$emit("input",e))}}},wi=xi,ki=Zn(wi,bi,_i,!1,null,null,null),Oi=ki.exports,Si=function(){var e=this,t=e._self._c;return t("div",{staticClass:"col-12 p-0",attrs:{id:"fileAttachment"}},[t("div",{staticClass:"col-12 mb-2 mt-2"},[t("label",[e._v("Allowed File Type:")]),e._l(e.fieldInfo.config.accept,(function(n){return t("div",{staticClass:"mx-2 d-inline-block doc-ico-legend"},[t("em",{staticClass:"fa text-primary",class:n.iconClass,attrs:{id:"helpText"}}),e._v(" "+e._s(n.fileType)+" ")])}))],2),t("div",{staticClass:"file-upload"},[t("div",{staticClass:"file-upload__area",on:{click:e.openFilePopup}},[t("div",[0==e.previewFiles.length?t("span",[e._v("Drop files here to upload")]):e._e(),t("input",{staticClass:"d-none",attrs:{type:"file",id:"customFile",disabled:e.fieldInfo.disabled,multiple:e.canUploadMultipleFile()},on:{change:function(t){return e.onChange(t)}}}),e.errors.length>0?t("div",e._l(e.errors,(function(n,r){return t("div",{key:r,staticClass:"file-upload__error"},[t("span",[e._v(e._s(n))])])})),0):e._e()]),e._l(e.previewFiles,(function(n,r){return t("div",{key:r,staticClass:"upload-preview"},[n.isImage?t("img",{staticClass:"file-image",attrs:{src:n.url,alt:""}}):e._e(),n.isImage?e._e():t("div",{staticClass:"file-extention"},[e._v(" "+e._s(n.fileExtention)+" ")]),t("span",{staticClass:"file-name"},[e._v(" "+e._s(n.name)+e._s(n.isImage?"."+n.fileExtention:"")+" ")]),t("span",{staticClass:"crossimg"},[t("a",{staticClass:"fa fa-times text-white",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.RemoveFile(t,r)}}})])])}))],2)])])},Ii=[],Di={components:{Field:Le},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{maxSize:0,accept:"",errors:[],file:{name:"",size:0,type:"",fileExtention:"",url:"",isImage:!1,isUploaded:!1},previewFiles:[]}},mounted:function(){this.fieldInfo.validationRules=Un(this.fieldInfo.validationRules,this.lang),this.fieldInfo.placeholder&&(this.fileName=this.fieldInfo.placeholder),this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.hasOwnProperty("maxSize")&&(this.maxSize=this.fieldInfo.config.maxSize),this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.hasOwnProperty("accept")&&(this.accept=Array.prototype.map.call(this.fieldInfo.config.accept,(function(e){return e.fileType})).join(","),console.log(this.accept))},methods:{openFilePopup(){document.querySelectorAll('[type="file"]')[0].click()},RemoveFile(e,t){e.stopPropagation();const n=new DataTransfer,r=document.querySelectorAll('[type="file"]')[0],{files:i}=r;this.previewFiles=[];for(let s=0;s<i.length;s++){const e=i[s];if(t!==s){n.items.add(e);var o=e.name.split(".").pop(),a=["jpg","jpeg","png","gif"].includes(o);let t=new FileReader;t.addEventListener("load",()=>{this.file={name:e.name.split(".").shift(),size:Math.round(e.size/1024/1024*100)/100,type:e.type,fileExtention:o,isImage:a,url:t.result,isUploaded:!0},this.previewFiles.push(this.file)},!1),t.readAsDataURL(e)}}r.files=n.files},onChange(e){if(this.errors=[],e.target.files&&e.target.files[0]){for(let o=0;o<e.target.files.length;o++){const a=e.target.files[o];if(this.isFileValid(a)){var t=Math.round(a.size/1024/1024*100)/100,n=a.name.split(".").pop(),r=a.name.split(".").shift(),i=["jpg","jpeg","png","gif"].includes(n);console.log(t,n,r,i);let e=new FileReader;e.addEventListener("load",()=>{this.file={name:r,size:t,type:a.type,fileExtention:n,isImage:i,url:e.result,isUploaded:!0},this.previewFiles.push(this.file)},!1),e.readAsDataURL(a)}else console.log("Invalid file")}0==this.errors.length&&(this.fieldInfo.value=e.target.files,this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo))}},isFileSizeValid(e){e<=this.maxSize?console.log("File size is valid"):this.errors.push(`File size should be less than ${this.maxSize} MB`)},isFileTypeValid(e){this.accept.split(",").includes(e)?console.log("File type is valid"):this.errors.push("File type should be "+this.accept)},isFileValid(e){return this.isFileSizeValid(Math.round(e.size/1024/1024*100)/100),this.isFileTypeValid(e.name.split(".").pop()),0===this.errors.length},canUploadMultipleFile(){return!(!this.fieldInfo.config||!this.fieldInfo.config.hasOwnProperty("multiple"))&&this.fieldInfo.config.multiple}}},Ci=Di,ji=(r("4859"),Zn(Ci,Si,Ii,!1,null,"0a861c4c",null)),Ei=ji.exports,Pi={name:"DynamicForm",components:{ValidationObserver:Je,NumericField:Jn,SelectField:or,TextField:cr,DateField:_r,CheckBoxField:Or,RadioField:Er,MultiSelectField:zr,ToggleField:Jr,PhoneField:oi,CustomSelectField:ci,TextAreaField:gi,ColorField:Oi,FileField:Ei},data:function(){return{clickedButton:null}},props:{lang:{type:String,default:"en"},buttons:{type:Array,default:[]},schema:{type:Array,default:[],required:!0}},methods:{renderButtons:function(e){if(e){var t=[].constructor;return e.constructor===t?e:[]}},GetGroupName:function(e,t){return e||t},isRequired:function(e){let t=!1;if(e){if("string"===typeof e)return e.includes("required");"undefined"===typeof e.length?Object.keys(e).forEach(n=>{"required"==n.toLowerCase()&&1==e[n]&&0==t&&(t=!0)}):"undefined"!==typeof e.length&&e.forEach((function(e){Object.keys(e).forEach(n=>{"required"==n.toLowerCase()&&1==e[n]&&0==t&&(t=!0)})}))}return t},onSubmit:function(){var e={};this.schema.forEach(t=>{t.Data.forEach(t=>{e[t.name]=t.value})}),console.log(e),this.$emit("OnSubmit",e,this.clickedButton),console.log(1001)},onButtonClick:function(e){let t="";t=e.name?e.name:e.text,this.clickedButton=t,e.hasOwnProperty("onClick")&&e.onClick(e)},GetDisplayLabel(e){var t="";return e.hasOwnProperty("label")&&e.label?t=e.label:e.hasOwnProperty("display_name")&&e.display_name&&(t=e.display_name),t},SetFormValues(e){var t=this;e.forEach(e=>{for(var n in e)t.schema.forEach(t=>{t.Data.forEach(t=>{n==t.name&&(t.value=e[n])})})})}},created:function(){}},Ai=Pi,Ti=Zn(Ai,s,l,!1,null,null,null),Mi=Ti.exports,Ni={},Ri=Zn(Ni,Hr,Gr,!1,null,null,null),Fi=Ri.exports,zi={install(e,t={}){e.component("DynamicForm",Mi),e.component("NumericField",Jn),e.component("SelectField",or),e.component("TextField",cr),e.component("DateField",_r),e.component("CheckBoxField",Or),e.component("RadioField",Er),e.component("PhoneField",oi),e.component("CustomSelectField",ci),e.component("MultiSelectField",zr),e.component("TextAreaField",gi),e.component("CKEditorField",Fi)}};n["default"]=zi},fb60:function(e,t,n){"use strict";var r=n("7917"),i=n("c532");function o(e){r.call(this,null==e?"canceled":e,r.ERR_CANCELED),this.name="CanceledError"}i.inherits(o,r,{__CANCEL__:!0}),e.exports=o},fc6a:function(e,t,n){"use strict";var r=n("44ad"),i=n("1d80");e.exports=function(e){return r(i(e))}},fdbf:function(e,t,n){"use strict";var r=n("04f8");e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},fdcd:function(e){e.exports=JSON.parse('{"code":"ka","messages":{"alpha":"{_field_} უნდა შეიცავდეს მხოლოდ ასოებს","alpha_num":"{_field_} უნდა შეიცავდეს მხოლოდ ციფრებს","alpha_dash":"{_field_} უნდა შესაძლებელია შეიცავდეს ციფრებს, ასოებს და პუნქტუაციის ნიშნებს","alpha_spaces":"{_field_} უნდა შეიცავდეს მხოლოდ ასოებსა და ცარიელ სივრცეებს","between":"{_field_} უნდა იყოს {min} და {max}ს შორის","confirmed":"{_field_} არ ემთხვევა {target}(ი)ს","digits":"{_field_} უნდა შეიცავდეს ციფრებს და უნდა იყოს ზუსტად {length}-ნიშნა","dimensions":"{_field_} უნდა იყოს {width}x{height} ზომის (pixel)","email":"{_field_}-ს უნდა ჰქონდეს ელ-ფოსტის სწორი ფორმატი","excluded":"{_field_} უნდა იყოს სწორი მნიშვნელობა","ext":"{_field_} უნდა იყოს ფაილი","image":"{_field_} უნდა იყოს სურათი","max_value":"{_field_} უნდა შეიცავდეს {max} სიმბოლოს ან ნაკლებს","max":"{_field_} არ უნდა იყოს {length} სიმბოლოზე მეტი","mimes":"{_field_}ს უნდა ჰქონდეს სწორი ფაილის ფორმატი","min_value":"{_field_} უნდა შეიცავდეს {min} ან მეტ სიმბოლოს","min":"{_field_} უნდა შეიცავდეს მინიმუმ {length} სიმბოლოს","numeric":"{_field_} უნდა შეიცავდეს ციფრებს","oneOf":"{_field_} უნდა იყოს სწორი მნიშვნელობა","regex":"{_field_}-(ი)ს ფორმატი არასწორია","required":"{_field_} აუცილებელია","required_if":"{_field_} აუცილებელია","size":"{_field_} უნდა იყოს {size}KB-ზე ნაკლები","double":"{_field_} ველი უნდა იყოს სწორი ათობითი"}}')}})}));
16
16
  //# sourceMappingURL=myLib.umd.min.js.map