(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-cdad258c"],{"097d":function(t,e,r){"use strict";r("f8a0")},1945:function(t,e,r){},"3b5c":function(t,e,r){},"3d35":function(t,e,r){},7638:function(t,e,r){"use strict";r("3b5c")},ac7f6:function(t,e,r){"use strict";r.r(e);var o=r("8336"),n=r("b0af"),i=r("99d9"),a=r("62ad"),c=r("a523"),l=r("8fea"),s=r("169a"),u=r("ce7e"),p=r("0789"),f=r("4bd4"),d=r("ce87"),m=r("132d"),y=r("adda"),h=r("da13"),g=r("5d23"),v=r("a797"),b=r("490a"),x=r("0fd9"),w=r("2db4"),C=r("2fa4"),_=r("8654"),k=r("3a2f"),O=function(){var t=this,e=t._self._c;return e(c["a"],{attrs:{fluid:""}},[e(h["a"],{attrs:{"three-line":""}},[e(g["g"],{staticClass:"d-flex flex-column align-content-space-between align-center"},[e("div",{staticClass:"d-flex justify-center align-center align-items-center"},[e("p",{staticClass:"display-1 text--primary align-center d-flex ma-0 pa-0 mr-2"},[t._v(" "+t._s(t.$t("menu.company"))+" ")]),t.check([{domain:"Company",permisions:["Update"]}])?e(o["a"],{attrs:{small:"",fab:"",icon:""},on:{click:function(e){t.showDialogConfig=!0}}},[e(m["a"],{attrs:{color:"neuter",size:"20"}},[t._v("mdi-cog")])],1):t._e(),t.check([{domain:"Company",permisions:["Update"]}])&&t.showDialogConfig?e("ConfigComponent",{attrs:{"show-tab-dialog":t.showDialogConfig},on:{"on:close":function(e){t.showDialogConfig=!1}}}):t._e()],1),!t.loading&&t.companyById.length>0&&t.companyById[0].logo?e(d["a"],{scopedSlots:t._u([{key:"default",fn:function(r){var n=r.hover;return[t.companyById.length>0&&t.companyById[0].logo?e(y["a"],{attrs:{alt:"company_logo","aspect-ratio":"2",width:"150","max-width":"200",contain:"","lazy-src":t.companyById[0].logo.s3_url,src:t.companyById[0].logo.s3_url}},[e(p["i"],[n?e(v["a"],{attrs:{absolute:"",color:"white"}},[e(k["a"],{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(o["a"],t._g({attrs:{small:"",fab:"",color:"white",loading:t.loadingDeleteLogo},scopedSlots:t._u([{key:"loader",fn:function(){return[e(b["a"],{attrs:{color:"primary",indeterminate:"",size:"16",width:"2"}})]},proxy:!0}],null,!0)},n),[e(m["a"],{attrs:{color:"error",loading:t.loadingDeleteLogo},on:{click:function(e){return t.deleteLogo()}}},[t._v("mdi-trash-can-outline")])],1)]}}],null,!0)},[e("span",{staticStyle:{"font-size":"10px"}},[t._v(" "+t._s(t.$t("general.buttons.delete")+" LOGO")+" ")])])],1):t._e()],1)],1):t._e()]}}],null,!1,427693327)}):!t.loading&&t.companyById.length>0&&t.companyById[0].logo?e("div",{staticClass:"d-flex justify-center align-center",staticStyle:{width:"140px",height:"140px"}},[e(b["a"],{attrs:{color:"primary",indeterminate:"",size:"20",width:"2"}})],1):t._e()],1)],1),e(l["a"],{staticClass:"agTable",attrs:{headers:t.headers,items:t.companyById,loading:t.loading,search:t.search,"no-results-text":t.$t("general.ui.not_search_found"),"no-data-text":t.$t("general.ui.not_data_found"),"loading-text":t.$t("general.notification.loadData"),"footer-props":{itemsPerPageText:t.$t("general.table.itemsPerPageText"),pageText:"{0}-{1} "+t.$t("general.table.pageText")+" {2}"}},scopedSlots:t._u([{key:"item.action",fn:function(r){var o=r.item;return[e(k["a"],{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[t.check([{domain:"Company",permisions:["Update"]}])?e(m["a"],t._g({staticClass:"mouse-pointer mr-2",attrs:{color:"neuter",small:""},on:{click:function(e){return t.editItem(o)}}},n),[t._v(" mdi-square-edit-outline ")]):t._e()]}}],null,!0)},[e("span",[t._v(" "+t._s(t.$t("general.buttons.edit"))+" "),e("span",{staticStyle:{"font-size":"12px",color:"#aaaaaa"}},[t._v(" "+t._s(t.$t("menu.company"))+" ")])])]),e(k["a"],{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[t.check([{domain:"QrAdmin",permisions:["Update"]}])?e(m["a"],t._g({staticClass:"mouse-pointer",attrs:{color:"neuter",size:"14"},on:{click:function(e){return e.stopPropagation(),t.manageQR(o)}}},n),[t._v(" mdi-qrcode-edit ")]):t._e()]}}],null,!0)},[e("span",[t._v(" "+t._s(t.$t("locations.titles.manageQr"))+" "),e("span",{staticStyle:{"font-size":"12px",color:"#aaaaaa"}},[t._v(" "+t._s(t.$t("menu.company"))+" ")])])])]}}])}),e(x["a"],{attrs:{justify:"center"}},[e(s["a"],{attrs:{persistent:"","max-width":"500px"},model:{value:t.dialog,callback:function(e){t.dialog=e},expression:"dialog"}},[e(n["a"],{attrs:{light:!0,color:"white"}},[e(i["e"],[e("span",{staticClass:"headline"},[t._v(t._s(t.formTitle))])]),e(u["a"]),e(i["d"],{staticClass:"pa-6"},[e(c["a"],[e(f["a"],{ref:"form",model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(x["a"],[e(a["a"],{attrs:{cols:"12"}},[e(_["a"],{staticClass:"required",attrs:{onkeypress:"return (event.charCode != 34)",color:"primary",required:"",outlined:"",dense:"",rules:t.requireAndMaxRules(t.max),counter:t.max,maxlength:"max"},on:{keyup:[function(e){return e.type.indexOf("key")||86===e.keyCode?t.replaceName.apply(null,arguments):null},function(e){return(e.type.indexOf("key")||86===e.keyCode)&&e.ctrlKey?t.replaceName.apply(null,arguments):null}]},scopedSlots:t._u([{key:"label",fn:function(){return[t._v(" "+t._s(t.$t("company.fields.name"))+" "),e("span",{staticClass:"red--text"},[e("strong",[t._v("*")])])]},proxy:!0}]),model:{value:t.editedItem.name,callback:function(e){t.$set(t.editedItem,"name",e)},expression:"editedItem.name"}})],1)],1),e(x["a"],[e(a["a"],{attrs:{cols:"12"}},[e(_["a"],{staticClass:"required",attrs:{onkeypress:"return (event.charCode != 34)",color:"primary",required:"",outlined:"",dense:"",rules:t.requireAndMaxRules(t.maxPrefix),counter:t.maxPrefix,maxlength:"maxPrefix"},on:{keyup:[function(e){return e.type.indexOf("key")||86===e.keyCode?t.replacePrefixGS1.apply(null,arguments):null},function(e){return(e.type.indexOf("key")||86===e.keyCode)&&e.ctrlKey?t.replacePrefixGS1.apply(null,arguments):null}]},scopedSlots:t._u([{key:"label",fn:function(){return[t._v(" "+t._s(t.$t("company.fields.prefixGs1"))+" "),e("span",{staticClass:"red--text"},[e("strong",[t._v("*")])])]},proxy:!0}]),model:{value:t.editedItem.prefixGS1,callback:function(e){t.$set(t.editedItem,"prefixGS1",e)},expression:"editedItem.prefixGS1"}})],1)],1),e(x["a"],[e(a["a"],{attrs:{cols:"12"}},[e(_["a"],{staticClass:"required",attrs:{onkeypress:"return (event.charCode != 34)",color:"primary",required:"",outlined:"",dense:"",rules:t.requireRules},on:{keyup:[function(e){return e.type.indexOf("key")||86===e.keyCode?t.replaceEmail.apply(null,arguments):null},function(e){return(e.type.indexOf("key")||86===e.keyCode)&&e.ctrlKey?t.replaceEmail.apply(null,arguments):null}]},scopedSlots:t._u([{key:"label",fn:function(){return[t._v(" "+t._s(t.$t("company.fields.email"))+" "),e("span",{staticClass:"red--text"},[e("strong",[t._v("*")])])]},proxy:!0}]),model:{value:t.editedItem.email,callback:function(e){t.$set(t.editedItem,"email",e)},expression:"editedItem.email"}})],1)],1),e(x["a"],[e(a["a"],{attrs:{cols:"12"}},[e(_["a"],{staticClass:"required",attrs:{onkeypress:"return (event.charCode != 34)",color:"primary",required:"",outlined:"",dense:"",rules:t.requireRules},on:{keyup:[function(e){return e.type.indexOf("key")||86===e.keyCode?t.replaceDocumentKey.apply(null,arguments):null},function(e){return(e.type.indexOf("key")||86===e.keyCode)&&e.ctrlKey?t.replaceDocumentKey.apply(null,arguments):null}]},scopedSlots:t._u([{key:"label",fn:function(){return[t._v(" "+t._s(t.$t("company.fields.identificationType"))+" "),e("span",{staticClass:"red--text"},[e("strong",[t._v("*")])])]},proxy:!0}]),model:{value:t.editedItem.document_key,callback:function(e){t.$set(t.editedItem,"document_key",e)},expression:"editedItem.document_key"}})],1)],1),e(x["a"],[e(a["a"],{attrs:{cols:"12"}},[e(_["a"],{staticClass:"required",attrs:{onkeypress:"return (event.charCode != 34)",color:"primary",required:"",outlined:"",dense:"",rules:t.requireRules},on:{keyup:[function(e){return e.type.indexOf("key")||86===e.keyCode?t.replaceDocumentValue.apply(null,arguments):null},function(e){return(e.type.indexOf("key")||86===e.keyCode)&&e.ctrlKey?t.replaceDocumentValue.apply(null,arguments):null}]},scopedSlots:t._u([{key:"label",fn:function(){return[t._v(" "+t._s(t.$t("company.fields.identificationValue"))+" "),e("span",{staticClass:"red--text"},[e("strong",[t._v("*")])])]},proxy:!0}]),model:{value:t.editedItem.document_value,callback:function(e){t.$set(t.editedItem,"document_value",e)},expression:"editedItem.document_value"}})],1)],1),e(x["a"],[e(a["a"],{attrs:{cols:"12"}},[e(_["a"],{staticClass:"required",attrs:{onkeypress:"return (event.charCode != 34)",color:"primary",required:"",outlined:"",dense:"",rules:t.requireRules},on:{keyup:[function(e){return e.type.indexOf("key")||86===e.keyCode?t.replaceTelephone.apply(null,arguments):null},function(e){return(e.type.indexOf("key")||86===e.keyCode)&&e.ctrlKey?t.replaceTelephone.apply(null,arguments):null}]},scopedSlots:t._u([{key:"label",fn:function(){return[t._v(" "+t._s(t.$t("company.fields.telephone"))+" "),e("span",{staticClass:"red--text"},[e("strong",[t._v("*")])])]},proxy:!0}]),model:{value:t.editedItem.telephone,callback:function(e){t.$set(t.editedItem,"telephone",e)},expression:"editedItem.telephone"}})],1)],1),e(x["a"],[e(a["a"],{staticClass:"ma-0 pa-0",attrs:{cols:"12"}},[e("CropperPhotoDialog",{attrs:{"append-icon":!0,"hide-input":!1,"free-resize":!0,type:"logo",reference:"logo_company",disabled:!1},on:{"update:logo":t.handleLogoUpdate}})],1)],1)],1)],1)],1),e(u["a"]),e(i["b"],{staticClass:"pa-6"},[e(C["a"]),e(o["a"],{attrs:{disabled:t.loadingSave,small:"",text:"",color:"neuter"},on:{click:t.close}},[t._v(" "+t._s(t.$t("general.buttons.cancel"))+" ")]),e(o["a"],{staticClass:"t-bw-primary--text",attrs:{small:"",elevation:"0",color:"primary",loading:t.loadingSave,disabled:!t.valid},on:{click:t.save}},[t._v(" "+t._s(t.$t("general.buttons.save"))+" ")])],1)],1)],1)],1),e(x["a"],{attrs:{justify:"center"}},[e(s["a"],{attrs:{persistent:"",width:"600px"},model:{value:t.showDialog,callback:function(e){t.showDialog=e},expression:"showDialog"}},[e(n["a"],[e(i["e"],{staticClass:"headline"},[t._v(t._s(t.title))]),e(i["d"],{staticClass:"pa-6"},[t._v(t._s(t.dialogText))]),e(i["b"],{staticClass:"pa-6"},[e(C["a"]),e(o["a"],{attrs:{small:"",text:"",color:"neuter"},on:{click:t.dialogClose}},[t._v(" "+t._s(t.$t("general.buttons.cancel"))+" ")]),e(o["a"],{staticClass:"t-bw-error--text",attrs:{small:"",elevation:"0",color:"error"},on:{click:t.deleteItem}},[t._v(" "+t._s(t.$t("general.buttons.confirm"))+" ")])],1)],1)],1)],1),e(w["a"],{attrs:{app:"",bottom:""},scopedSlots:t._u([{key:"action",fn:function(r){var n=r.attrs;return[e(o["a"],t._b({attrs:{color:"pink",text:""},on:{click:function(e){t.snackbar=!1}}},"v-btn",n,!1),[t._v(" "+t._s(t.$t("general.buttons.close"))+" ")])]}}]),model:{value:t.snackbar,callback:function(e){t.snackbar=e},expression:"snackbar"}},[t._v(" "+t._s(t.text)+" ")])],1)},S=[],I=r("fe0b"),L=r("2f62"),j=r("eb7f"),E=r("835d"),P=function(){var t=this,e=t._self._c;return e("tab-dialog",{attrs:{title:t.$t("company.titles.configurations"),dialog:t.showTabDialog,tabs:t.tabsConfig,valid:t.valid,"is-editable":!0,loading:t.loading,"card-props":{height:"auto",title:{class:"headline secondary t-bw-secondary--text"}},"show-actions":t.currentTab.showActions,"show-save-action":t.currentTab.save},on:{"update:show-actions":function(e){t.currentTab=e},"on:save":t.confirm,"on:close":t.close},scopedSlots:t._u([{key:"general",fn:function(){return[e("GeneralConfigTab",{attrs:{company:t.company},on:{"on:show-actions":function(e){return t.updateTabShowAction(0,e)},"update:valid":function(e){t.valid=e}}})]},proxy:!0},{key:"blockchain",fn:function(){return[e("BlockchainConfigTab",{on:{"on:show-actions":function(e){return t.updateTabShowAction(1,e)},"update:valid":function(e){t.valid=e}}})]},proxy:!0},{key:"export",fn:function(){return[e("ImportExportConfigTab",{attrs:{company:t.company},on:{"on:show-actions":function(e){return t.updateTabShowAction(2,e)},"update:valid":function(e){t.valid=e}}})]},proxy:!0},{key:"identity",fn:function(){return[e("IdentityConfigTab",{ref:"identityConfigForm",on:{"on:show-actions":function(e){return t.updateTabShowAction(3,e)},"update:valid":function(e){t.valid=e}}})]},proxy:!0},{key:"bottom-actions",fn:function(){return["identity"===t.currentTab.slotName?e(o["a"],{staticClass:"t-bw-gray--text",attrs:{small:"",color:"gray",elevation:"0"},on:{click:function(e){t.isPreviewMode?t.restoreOriginalColors():t.applyPreviewColors()}}},[e(m["a"],{attrs:{left:""}},[t._v(t._s(t.isPreviewMode?"mdi-backup-restore":"mdi-eye"))]),t._v(" "+t._s(t.isPreviewMode?t.$t("customization.buttons.restore"):t.$t("customization.buttons.preview"))+" ")],1):t._e()]},proxy:!0}])})},$=[],T=r("67f7"),D=r("7fb5"),A=r("282b"),N=r("24c9"),U=function(){var t=this,e=t._self._c;return e("form-wrapper",{ref:"form",attrs:{reference:"generalConfigForm",boxed:"","form-title":t.$t("general.titles.general")},on:{"update:valid":function(e){return t.$emit("update:valid",e)}},scopedSlots:t._u([{key:"fields",fn:function(){return[e(a["a"],{attrs:{cols:"6"}},[e(N["a"],[t._v(t._s(t.$t("company.titles.decimalNumbers")))]),e(_["a"],{attrs:{placeholder:null===t.company.traceability.structure.number.afterPoint||""===t.company.traceability.structure.number.afterPoint?t.$t("company.titles.defaultValue"):"",id:"afterPoint",dense:"",outlined:"",color:"primary",type:"number",clearable:"",rules:t.compareMax(0,5)},model:{value:t.company.traceability.structure.number.afterPoint,callback:function(e){t.$set(t.company.traceability.structure.number,"afterPoint",e)},expression:"company.traceability.structure.number.afterPoint"}})],1)]},proxy:!0}])})},G=[],F=r("cfb2");function z(t){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function q(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?q(Object(r),!0).forEach((function(e){M(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function M(t,e,r){return(e=B(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function B(t){var e=V(t,"string");return"symbol"==z(e)?e:e+""}function V(t,e){if("object"!=z(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=z(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var J={components:{FormWrapper:F["a"]},props:{company:{type:Object,required:!0},isEditable:{type:Boolean,default:!0}},computed:R({},Object(L["c"])({compareMax:"general/compareMax"})),beforeDestroy:function(){this.$refs.form.$refs.generalConfigForm.reset(),console.log("GeneralConfigTab Destroyed")}},W=J,K=(r("ba35"),r("2877")),H=Object(K["a"])(W,U,G,!1,null,"78775170",null),Q=H.exports,Y=function(){var t=this,e=t._self._c;return e("form-wrapper",{ref:"form",attrs:{reference:"blockchainConfigForm",boxed:"","form-title":"Blockchain"},on:{"update:valid":function(e){return t.$emit("update:valid",!0)}},scopedSlots:t._u([{key:"fields",fn:function(){return[e(x["a"],[e(a["a"],{attrs:{cols:"12"}},[e("FormWalletComponent",{on:{isValid:function(e){t.isValid=e}}})],1),e(a["a"],{attrs:{cols:"12"}},[e("WalletsTable")],1)],1)]},proxy:!0}])})},X=[],Z={components:{FormWrapper:F["a"],FormWalletComponent:A["a"],WalletsTable:D["a"]},data:function(){return{isValid:!1}},beforeDestroy:function(){this.$refs.form.$refs.blockchainConfigForm.reset(),console.log("BlockchainConfigTab Destroyed")}},tt=Z,et=(r("097d"),Object(K["a"])(tt,Y,X,!1,null,"b3950cfc",null)),rt=et.exports,ot=function(){var t=this,e=t._self._c;return e("div",[e("form-wrapper",{ref:"form",attrs:{reference:"importConfigForm",boxed:"","form-title":t.$t("general.buttons.import").slice(0,1)+t.$t("general.buttons.import").slice(1,t.$t("general.buttons.import").length)},on:{"update:valid":function(e){return t.$emit("update:valid",e)}},scopedSlots:t._u([{key:"fields",fn:function(){return[e(a["a"],{attrs:{cols:"12",md:"6"}},[e(N["a"],[t._v(t._s(t.$t("modules.name.Record")))]),e(_["a"],{attrs:{placeholder:null===t.company.import.recordImportLimit||""===t.company.import.recordImportLimit?t.$t("company.titles.defaultExportRecordsValue"):"",id:"importRecordLimit",dense:"",outlined:"",color:"primary",clearable:""},on:{keypress:function(e){return t.onlyAllowNumbers(e)},input:function(e){return t.filterInput("import","recordImportLimit")}},model:{value:t.company.import.recordImportLimit,callback:function(e){t.$set(t.company.import,"recordImportLimit",e)},expression:"company.import.recordImportLimit"}})],1)]},proxy:!0}])}),e("form-wrapper",{ref:"form",staticClass:"my-12",attrs:{reference:"exportConfigForm",boxed:"","form-title":t.$t("general.buttons.export").slice(0,1)+t.$t("general.buttons.export").slice(1,t.$t("general.buttons.export").length)},on:{"update:valid":function(e){return t.$emit("update:valid",e)}},scopedSlots:t._u([{key:"fields",fn:function(){return[e(a["a"],{attrs:{cols:"12",md:"6"}},[e(N["a"],[t._v(t._s(t.$t("modules.name.Record")))]),e(_["a"],{attrs:{placeholder:null===t.company.export.recordExportLimit||""===t.company.export.recordExportLimit?t.$t("company.titles.defaultExportRecordsValue"):"",id:"exportRecordLimit",dense:"",outlined:"",color:"primary",clearable:""},on:{keypress:function(e){return t.onlyAllowNumbers(e)},input:function(e){return t.filterInput("export","recordExportLimit")}},model:{value:t.company.export.recordExportLimit,callback:function(e){t.$set(t.company.export,"recordExportLimit",e)},expression:"company.export.recordExportLimit"}})],1),e(a["a"],{attrs:{cols:"12",md:"6"}},[e(N["a"],[t._v(t._s(t.$t("modules.name.Survey")))]),e(_["a"],{attrs:{placeholder:null===t.company.export.inspectionExportLimit||""===t.company.export.inspectionExportLimit?t.$t("company.titles.defaultExportInspectionsValue"):"",id:"inspectionExportLimit",dense:"",outlined:"",color:"primary",clearable:""},on:{keypress:function(e){return t.onlyAllowNumbers(e)},input:function(e){return t.filterInput("export","inspectionExportLimit")}},model:{value:t.company.export.inspectionExportLimit,callback:function(e){t.$set(t.company.export,"inspectionExportLimit",e)},expression:"company.export.inspectionExportLimit"}})],1)]},proxy:!0}])})],1)},nt=[],it={components:{FormWrapper:F["a"]},props:{company:{type:Object,required:!0},isEditable:{type:Boolean,default:!0}},methods:{onlyAllowNumbers:function(t){var e=t.keyCode?t.keyCode:t.which;(e<48||e>57)&&t.preventDefault()},filterInput:function(t,e){var r=this.company[t][e];if(null!==r&&void 0!==r&&""!==r){var o=r.replace(/\D/g,"");this.$set(this.company[t],e,o)}}},beforeDestroy:function(){this.$refs.form.$refs.exportConfigForm.reset(),console.log("ExportConfigTab Destroyed")}},at=it,ct=(r("7638"),Object(K["a"])(at,ot,nt,!1,null,"2d7574e4",null)),lt=ct.exports,st=r("2b18"),ut=r("0798"),pt=r("03a4"),ft=r("8860"),dt=r("e449"),mt=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("form-wrapper",{ref:"form",attrs:{reference:"identityConfigForm",boxed:"","form-title":t.$t("customization.titles.identity")},on:{"update:valid":function(e){return t.$emit("update:valid",e)}},scopedSlots:t._u([{key:"fields",fn:function(){return[e(a["a"],{attrs:{cols:"12"}},[e(ft["a"],t._l(t.filteredColors,(function(r,a,c){return e(h["a"],{key:"".concat(a,"-").concat(c)},[e(g["g"],{staticClass:"color-list-item"},[e(g["k"],{staticClass:"black--text d-flex justify-space-between"},[e("p",{staticClass:"ma-0 pa-0"},[t._v(t._s(t.$t("customization.fields.".concat(a)).toString().toUpperCase()))]),e(dt["a"],{staticClass:"elevation-0",attrs:{"close-on-content-click":!1,"offset-y":"","nudge-left":"260"},scopedSlots:t._u([{key:"activator",fn:function(o){var n=o.on,i=o.attrs;return[e("div",t._g(t._b({staticClass:"color-block",style:{backgroundColor:r}},"div",i,!1),n),[t.hoverColor===a?e(m["a"],{staticClass:"edit-icon",on:{mouseover:function(e){t.hoverColor=a},mouseleave:function(e){t.hoverColor=null}}},[t._v("mdi-pencil")]):t._e()],1)]}}],null,!0),model:{value:t.menus[a],callback:function(e){t.$set(t.menus,a,e)},expression:"menus[key]"}},[e(n["a"],[e(pt["a"],{staticClass:"elevation-0",attrs:{mode:"hexa","hide-canvas":"","show-swatches":"",flat:""},model:{value:t.localColors[a],callback:function(e){t.$set(t.localColors,a,e)},expression:"localColors[key]"}}),e(i["b"],{staticClass:"pa-6"},[e(C["a"]),e(o["a"],{attrs:{small:"",text:"",color:"neuter"},on:{click:function(e){return t.cancelColorEdit(a)}}},[t._v(t._s(t.$t("general.buttons.cancel")))]),e(o["a"],{staticClass:"t-bw-primary--text",attrs:{small:"",elevation:"0",color:"primary"},on:{click:function(e){t.menus[a]=!1}}},[t._v(t._s(t.$t("general.buttons.save")))])],1)],1)],1)],1),e(ut["a"],{key:a,class:"colored__icon mt-3 t-bw-gray--text",attrs:{id:"colorAlert",type:"info",border:"left",color:"gray"},scopedSlots:t._u([{key:"prepend",fn:function(){return[e(m["a"],{staticClass:"mx-2",attrs:{color:"t-bw-gray"}},[t._v("mdi-information-slab-circle")])]},proxy:!0}],null,!0)},[e("p",{staticClass:"ma-0 pa-0"},[t._v(" "+t._s(t.colorDescriptions[a])+" ")])])],1)],1)})),1)],1)]},proxy:!0}])})},yt=[],ht=r("9ab4"),gt=r("60a3"),vt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isDrawerOpen=!1,e.originalColors=Object(ht["a"])({},e.themeColors),e.localColors=Object(ht["a"])({},e.themeColors),e.previewColors=Object(ht["a"])({},e.themeColors),e.menus={},e.hoverColor=null,e.colorDescriptions={primary:I["a"].t("customization.notification.primary"),secondary:I["a"].t("customization.notification.secondary")},e}return Object(ht["d"])(e,t),Object.defineProperty(e.prototype,"themeColors",{get:function(){return this.$store.getters["customization/themeColors"]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"filteredColors",{get:function(){var t=this,e=["primary","secondary"],r={};return e.forEach((function(e){e in t.localColors&&(r[e]=t.localColors[e])})),r},enumerable:!1,configurable:!0}),e.prototype.toggleDrawer=function(){this.isDrawerOpen=!this.isDrawerOpen,this.isDrawerOpen?this.localColors=Object(ht["a"])({},this.themeColors):(this.$store.commit("customization/UPDATE_THEME_COLORS",this.originalColors),this.clearColorStates())},e.prototype.cancelColorEdit=function(t){this.localColors[t]=this.originalColors[t],this.menus[t]=!1},e.prototype.applyPreview=function(){this.previewColors=Object(ht["a"])({},this.themeColors),this.$store.commit("customization/UPDATE_THEME_COLORS",this.localColors)},e.prototype.restoreOriginalColors=function(){this.localColors=Object(ht["a"])({},this.originalColors),this.$store.commit("customization/UPDATE_THEME_COLORS",this.originalColors)},e.prototype.saveColors=function(){return Object(ht["b"])(this,void 0,void 0,(function(){return Object(ht["e"])(this,(function(t){switch(t.label){case 0:return this.originalColors=Object(ht["a"])({},this.localColors),[4,this.$store.dispatch("customization/UPDATE_THEME_COLORS",this.localColors)];case 1:return t.sent(),[4,this.$store.dispatch("customization/SAVE_CONFIGURATION")];case 2:return t.sent(),this.clearColorStates(),[2]}}))}))},e.prototype.clearColorStates=function(){this.localColors=Object(ht["a"])({},this.themeColors),this.previewColors=Object(ht["a"])({},this.themeColors)},e.prototype.loadInitConfiguration=function(){return Object(ht["b"])(this,void 0,void 0,(function(){return Object(ht["e"])(this,(function(t){switch(t.label){case 0:return[4,this.$store.dispatch("customization/LOAD_CONFIGURATION")];case 1:return t.sent(),this.originalColors=Object(ht["a"])({},this.themeColors),this.localColors=Object(ht["a"])({},this.themeColors),this.previewColors=Object(ht["a"])({},this.themeColors),[2]}}))}))},e.prototype.mounted=function(){return Object(ht["b"])(this,void 0,void 0,(function(){return Object(ht["e"])(this,(function(t){switch(t.label){case 0:return console.log(localStorage.getItem("preview:colors")),localStorage.getItem("preview:colors")?[3,2]:[4,this.loadInitConfiguration()];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},e=Object(ht["c"])([Object(gt["a"])({components:{FormWrapper:F["a"]},computed:Object(ht["a"])({},Object(L["c"])("customization",["theme","themeColors"])),methods:Object(ht["a"])({},Object(L["b"])("customization",["UPDATE_THEME_COLORS","SAVE_CONFIGURATION"]))})],e),e}(gt["c"]),bt=vt,xt=bt,wt=(r("e61f"),Object(K["a"])(xt,mt,yt,!1,null,"ed84143c",null)),Ct=wt.exports;function _t(t){return _t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(t)}function kt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function Ot(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?kt(Object(r),!0).forEach((function(e){St(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function St(t,e,r){return(e=It(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function It(t){var e=Lt(t,"string");return"symbol"==_t(e)?e:e+""}function Lt(t,e){if("object"!=_t(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=_t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function jt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */jt=function(){return e};var t,e={},r=Object.prototype,o=r.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new E(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var f="suspendedStart",d="suspendedYield",m="executing",y="completed",h={};function g(){}function v(){}function b(){}var x={};s(x,a,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(P([])));C&&C!==r&&o.call(C,a)&&(x=C);var _=b.prototype=g.prototype=Object.create(x);function k(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(n,i,a,c){var l=p(t[n],t,i);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==_t(u)&&o.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(u).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var i;n(this,"_invoke",{value:function(t,o){function n(){return new e((function(e,n){r(t,o,e,n)}))}return i=i?i.then(n,n):n()}})}function S(e,r,o){var n=f;return function(i,a){if(n===m)throw Error("Generator is already running");if(n===y){if("throw"===i)throw a;return{value:t,done:!0}}for(o.method=i,o.arg=a;;){var c=o.delegate;if(c){var l=I(c,o);if(l){if(l===h)continue;return l}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(n===f)throw n=y,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);n=m;var s=p(e,r,o);if("normal"===s.type){if(n=o.done?y:d,s.arg===h)continue;return{value:s.arg,done:o.done}}"throw"===s.type&&(n=y,o.method="throw",o.arg=s.arg)}}}function I(e,r){var o=r.method,n=e.iterator[o];if(n===t)return r.delegate=null,"throw"===o&&e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+o+"' method")),h;var i=p(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,h;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,h):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function P(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function r(){for(;++n<e.length;)if(o.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(_t(e)+" is not iterable")}return v.prototype=b,n(_,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},k(O.prototype),s(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,o,n,i){void 0===i&&(i=Promise);var a=new O(u(t,r,o,n),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(_),s(_,l,"Generator"),s(_,a,(function(){return this})),s(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var o in e)r.push(o);return r.reverse(),function t(){for(;r.length;){var o=r.pop();if(o in e)return t.value=o,t.done=!1,t}return t.done=!0,t}},e.values=P,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(o,n){return c.type="throw",c.arg=e,r.next=o,n&&(r.method="next",r.arg=t),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var l=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(l&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var n=o.arg;j(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,r,o){return this.delegate={iterator:P(e),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=t),h}},e}function Et(t,e,r,o,n,i,a){try{var c=t[i](a),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(o,n)}function Pt(t){return function(){var e=this,r=arguments;return new Promise((function(o,n){var i=t.apply(e,r);function a(t){Et(i,o,n,a,c,"next",t)}function c(t){Et(i,o,n,a,c,"throw",t)}a(void 0)}))}}var $t=JSON.parse(localStorage.getItem("profile")),Tt={components:{IdentityConfigTab:Ct,MainSection:st["a"],ImportExportConfigTab:lt,BlockchainConfigTab:rt,GeneralConfigTab:Q,TabDialog:T["a"],FormWalletComponent:A["a"],WalletsTable:D["a"]},props:{showTabDialog:{type:Boolean,required:!0}},data:function(){return{valid:!1,tab:0,showActions:!0,isPreviewMode:"true"===localStorage.getItem("preview:colors"),company:{traceability:{structure:{number:{afterPoint:null}}},export:{recordExportLimit:null,inspectionExportLimit:null},import:{recordImportLimit:null}},loading:!1,loadingReset:!1,loadingCancel:!1,configUser:{},currentTab:null,form:{company:!1},tabsConfig:[{name:I["a"].t("general.titles.general"),icon:"mdi-information",slotName:"general",visible:!0,showActions:!0,save:!0},{name:"Blockchain",icon:"mdi-network",slotName:"blockchain",visible:1===$t.company_id,showActions:!0,save:!1},{name:"".concat(I["a"].t("general.buttons.import").slice(0,3).toUpperCase()+"/"+I["a"].t("general.buttons.export").slice(0,3).toUpperCase()),icon:"mdi-arrow-collapse",slotName:"export",visible:!0,showActions:!0,save:!0},{name:I["a"].t("customization.titles.identity"),icon:"mdi-palette",slotName:"identity",visible:!0,showActions:!0,save:!0}]}},created:function(){var t=this;return Pt(jt().mark((function e(){return jt().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.configUser=JSON.parse(localStorage.getItem("config")),t.company.traceability.structure.number=t.configUser.company.traceability.structure.number,t.company.import.recordImportLimit=t.configUser.company.import.recordImportLimit,t.company.export.recordExportLimit=t.configUser.company.export.recordExportLimit,t.company.export.inspectionExportLimit=t.configUser.company.export.inspectionExportLimit,t.currentTab=t.tabsConfig[0];case 6:case"end":return e.stop()}}),e)})))()},computed:Ot({},Object(L["c"])({compareMax:"general/compareMax"})),methods:Ot(Ot({},Object(L["b"])({createConfigUser:"authority/createConfigUser",loadConfigUser:"authority/loadConfigUser"})),{},{updateTabShowAction:function(t,e){this.tabsConfig[t].showActions=e},confirm:function(){var t=this;return Pt(jt().mark((function e(){var r;return jt().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if("identity"!==t.currentTab.slotName){e.next=6;break}return e.next=3,t.$refs.identityConfigForm.saveColors();case 3:localStorage.removeItem("preview:colors"),e.next=15;break;case 6:return t.loading=!0,r=t.manageModule("create"),t.configUser.company.import.recordImportLimit=r.recordImportLimit,t.configUser.company.export.recordExportLimit=r.recordExportLimit,t.configUser.company.export.inspectionExportLimit=r.inspectionExportLimit,e.next=13,E["a"].setConfig(r).finally((function(){t.loading=!1,t.dialog=!1}));case 13:console.log(t.configUser),localStorage.setItem("config",JSON.stringify(t.configUser));case 15:t.$emit("on:close");case 16:case"end":return e.stop()}}),e)})))()},manageModule:function(t){var e={};return"create"===t?(e={companyStructuresPreferences:{afterPoint:this.company.traceability.structure.number.afterPoint},recordImportLimit:this.company.import.recordImportLimit,recordExportLimit:this.company.export.recordExportLimit,inspectionExportLimit:this.company.export.inspectionExportLimit},this.configUser.company.traceability.structure.number=this.company.traceability.structure.number,localStorage.setItem("config",JSON.stringify(this.configUser)),e):(e={companyStructuresPreferences:{afterPoint:null},recordImportLimit:0,recordExportLimit:0,inspectionExportLimit:0},this.company.traceability.structure.number.afterPoint=null,this.configUser.company.traceability.structure.number=this.company.traceability.structure.number,localStorage.setItem("config",JSON.stringify(this.configUser)),e)},cancelDialogConfig:function(){var t=this;return Pt(jt().mark((function e(){return jt().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.loadingCancel=!0,"identity"!==t.currentTab.slotName){e.next=6;break}return e.next=4,t.restoreOriginalColors();case 4:e.next=8;break;case 6:return e.next=8,t.loadConfigUser([t.$toast]).finally((function(){t.loadingCancel=!1,t.dialog=!1}));case 8:case"end":return e.stop()}}),e)})))()},applyPreviewColors:function(){var t=this;return Pt(jt().mark((function e(){return jt().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$refs.identityConfigForm.applyPreview();case 2:t.isPreviewMode=!0,localStorage.setItem("preview:colors","true"),t.$emit("on:close");case 5:case"end":return e.stop()}}),e)})))()},restoreOriginalColors:function(){var t=this;return Pt(jt().mark((function e(){return jt().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$refs.identityConfigForm.restoreOriginalColors();case 2:return t.isPreviewMode=!1,localStorage.removeItem("preview:colors"),e.next=6,t.$refs.identityConfigForm.loadInitConfiguration();case 6:case"end":return e.stop()}}),e)})))()},close:function(){var t=this;return Pt(jt().mark((function e(){return jt().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.cancelDialogConfig();case 2:t.$emit("on:close");case 3:case"end":return e.stop()}}),e)})))()}}),destroyed:function(){this.configUser={},this.$root.$off("updateOptions")}},Dt=Tt,At=Object(K["a"])(Dt,P,$,!1,null,null,null),Nt=At.exports,Ut=r("6376");function Gt(t){return Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gt(t)}function Ft(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ft=function(){return e};var t,e={},r=Object.prototype,o=r.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new E(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var f="suspendedStart",d="suspendedYield",m="executing",y="completed",h={};function g(){}function v(){}function b(){}var x={};s(x,a,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(P([])));C&&C!==r&&o.call(C,a)&&(x=C);var _=b.prototype=g.prototype=Object.create(x);function k(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(n,i,a,c){var l=p(t[n],t,i);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==Gt(u)&&o.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(u).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var i;n(this,"_invoke",{value:function(t,o){function n(){return new e((function(e,n){r(t,o,e,n)}))}return i=i?i.then(n,n):n()}})}function S(e,r,o){var n=f;return function(i,a){if(n===m)throw Error("Generator is already running");if(n===y){if("throw"===i)throw a;return{value:t,done:!0}}for(o.method=i,o.arg=a;;){var c=o.delegate;if(c){var l=I(c,o);if(l){if(l===h)continue;return l}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(n===f)throw n=y,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);n=m;var s=p(e,r,o);if("normal"===s.type){if(n=o.done?y:d,s.arg===h)continue;return{value:s.arg,done:o.done}}"throw"===s.type&&(n=y,o.method="throw",o.arg=s.arg)}}}function I(e,r){var o=r.method,n=e.iterator[o];if(n===t)return r.delegate=null,"throw"===o&&e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+o+"' method")),h;var i=p(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,h;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,h):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function P(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function r(){for(;++n<e.length;)if(o.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Gt(e)+" is not iterable")}return v.prototype=b,n(_,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},k(O.prototype),s(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,o,n,i){void 0===i&&(i=Promise);var a=new O(u(t,r,o,n),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(_),s(_,l,"Generator"),s(_,a,(function(){return this})),s(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var o in e)r.push(o);return r.reverse(),function t(){for(;r.length;){var o=r.pop();if(o in e)return t.value=o,t.done=!1,t}return t.done=!0,t}},e.values=P,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(o,n){return c.type="throw",c.arg=e,r.next=o,n&&(r.method="next",r.arg=t),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var l=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(l&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var n=o.arg;j(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,r,o){return this.delegate={iterator:P(e),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=t),h}},e}function zt(t,e,r,o,n,i,a){try{var c=t[i](a),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(o,n)}function qt(t){return function(){var e=this,r=arguments;return new Promise((function(o,n){var i=t.apply(e,r);function a(t){zt(i,o,n,a,c,"next",t)}function c(t){zt(i,o,n,a,c,"throw",t)}a(void 0)}))}}function Rt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function Mt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Rt(Object(r),!0).forEach((function(e){Bt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Rt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Bt(t,e,r){return(e=Vt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Vt(t){var e=Jt(t,"string");return"symbol"==Gt(e)?e:e+""}function Jt(t,e){if("object"!=Gt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=Gt(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Wt={jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",png:"image/png",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",doc:"application/msword",csv:"text/csv",pdf:"application/pdf",zip:"application/zip",xml:"text/xml"},Kt={components:{CropperPhotoDialog:Ut["a"],ConfigComponent:Nt},data:function(){return{langs:[],profile:null,dialog:!1,editedIndex:-1,fileEditChange:!1,search:"",snackbar:!1,text:I["a"].t("general.rules.size"),editedItem:{name:"",email:"",document_key:"",document_value:"",telephone:"",prefixGS1:""},defaultItem:{name:"",email:"",document_key:"",document_value:"",telephone:"",prefixGS1:""},fileSelected:null,loadingLogo:!1,loadingSave:!1,loadingDeleteLogo:!1,showDialog:!1,showDialogConfig:!1,title:"Información",dialogText:"Añada un texto a este dialogo",valid:!1,max:40,maxPrefix:10,deletingItem:{}}},computed:Mt(Mt({},Object(L["c"])({companies:"company/userCompanies",companyById:"company/companyById",authority:"authority/authority",loading:"company/loading",requireAndMaxRules:"general/requireAndMaxRules",requireRules:"general/requireRules",validateImage:"general/validateImage",configUser:"general/config"})),{},{headers:function(){return[{text:I["a"].t("company.fields.name"),value:"name"},{text:I["a"].t("company.fields.prefixGs1"),value:"prefixGS1"},{text:I["a"].t("company.fields.email"),value:"email"},{text:I["a"].t("company.fields.identificationType"),value:"document_key"},{text:I["a"].t("company.fields.identificationValue"),value:"document_value"},{text:I["a"].t("company.fields.telephone"),value:"telephone"},{text:I["a"].t("general.fields.action"),value:"action",width:100,sortable:!1,align:"center"}]},formTitle:function(){return(-1===this.editedIndex?I["a"].t("general.titles.new"):I["a"].t("general.titles.edit"))+" "+I["a"].t("menu.company")}}),watch:{dialog:function(t){t||this.close()}},created:function(){var t=this;return qt(Ft().mark((function e(){return Ft().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.initialize();case 2:case"end":return e.stop()}}),e)})))()},methods:Mt(Mt({},Object(L["b"])({fetchCompany:"company/fetchCompany",fetchAuthority:"authority/fetchAuthority",update:"company/update",delete:"company/delete",deleteCompany:"company/deleteCompany",fetchAvailableCompanies:"company/fetchAvailableCompanies"})),{},{handleLogoUpdate:function(t){var e=t.url,r=t.file;this.previewUrl=e,this.fileSelected=r,this.changeLogo()},initialize:function(){var t=this;return qt(Ft().mark((function e(){return Ft().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.profile=JSON.parse(localStorage.getItem("profile")),t.langs=t.$i18n.availableLocales,e.next=4,t.fetchCompany([t.profile,t.$toast]);case 4:case"end":return e.stop()}}),e)})))()},manageQR:function(t){var e=localStorage.getItem("token"),r=this.profile.company_owner;window.open(encodeURI("".concat(this.profile.qrDomain,"/admin/qr?owner=").concat(r,"&type=qrg&token=").concat(e)),"_blank")},changeLogo:function(){this.editedItem.logo&&(this.editedItem.logo.update_logo=!(-1===this.editedIndex||!this.editedItem.logo))},editItem:function(t){var e=this;return qt(Ft().mark((function r(){return Ft().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return e.fileEditChange=!1,e.editedIndex=e.companyById.indexOf(t),e.editedItem=Object.assign({},t),e.editedItem.logo||(e.editedItem.logo={update_logo:!1}),e.dialog=!0,e.loadingLogo=!0,r.next=8,E["a"].downloadLogo(e.editedItem).then((function(t){var r=Wt[e.editedItem.logo.file_extension],o=new Blob([t.data],{type:"application/zip"});e.fileSelected=new File([o],"logo-".concat(e.editedItem.name,".").concat(e.editedItem.logo.file_extension),{type:r})})).catch((function(t){})).finally((function(){e.loadingLogo=!1}));case 8:case"end":return r.stop()}}),r)})))()},deleteLogo:function(){var t=this;return qt(Ft().mark((function e(){return Ft().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.loadingDeleteLogo=!0,e.next=3,t.delete([t.profile.company_id,t.$toast]).finally(qt(Ft().mark((function e(){var r;return Ft().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=JSON.parse(localStorage.getItem("company:current")),localStorage.setItem("company:current",JSON.stringify(t.companies.find((function(t){return t.identity===r.identity})))),e.next=4,t.$store.dispatch("login/loadInitData").finally((function(){window.location.reload()}));case 4:case"end":return e.stop()}}),e)}))));case 3:case"end":return e.stop()}}),e)})))()},clearLogo:function(){var t=this;return qt(Ft().mark((function e(){return Ft().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.editedItem.logo=null;case 1:case"end":return e.stop()}}),e)})))()},check:function(t){return j["a"].check(t)},deleteItem:function(){var t=this;this.dialogClose(),this.deleteCompany([this.deletingItem.id,this.$toast]).finally((function(){t.fetchCompany([t.profile,t.$toast])}))},close:function(){var t=this;this.dialog=!1,setTimeout((function(){t.editedItem=Object.assign({},t.defaultItem),t.editedIndex=-1,t.fileSelected=null}),300)},save:function(){var t=this;return qt(Ft().mark((function e(){var r;return Ft().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.loadingSave=!0,r=Object.assign({},t.editedItem),e.next=4,t.update([r,t.fileSelected,t.$toast]).finally(qt(Ft().mark((function e(){return Ft().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.fetchCompany([t.profile,t.$toast]);case 2:return e.next=4,t.fetchAuthority([t.profile.id,t.$toast]);case 4:return e.next=6,t.$store.dispatch("login/loadInitData");case 6:return e.next=8,t.$store.dispatch("login/loadInitData").finally((function(){t.loadingSave=!1,t.dialog=!1,window.location.reload()}));case 8:case"end":return e.stop()}}),e)}))));case 4:case"end":return e.stop()}}),e)})))()},dialogShow:function(t){this.title=t.title,this.dialogText=t.dialogText,this.showDialog=!0},dialogClose:function(){this.showDialog=!1},deleteItemDialog:function(t){this.deletingItem=t,this.dialogShow({title:I["a"].t("general.titles.alert"),dialogText:I["a"].t("general.notification.deleteItems")})},replaceName:function(t){this.editedItem.name=t.currentTarget.value.toString().replaceAll('"',"")},replacePrefixGS1:function(t){this.editedItem.prefixGS1=t.currentTarget.value.toString().replaceAll('"',"")},replaceEmail:function(t){this.editedItem.email=t.currentTarget.value.toString().replaceAll('"',"")},replaceDocumentKey:function(t){this.editedItem.document_key=t.currentTarget.value.toString().replaceAll('"',"")},replaceDocumentValue:function(t){this.editedItem.document_value=t.currentTarget.value.toString().replaceAll('"',"")},replaceTelephone:function(t){this.editedItem.telephone=t.currentTarget.value.toString().replaceAll('"',"")}})},Ht=Kt,Qt=Object(K["a"])(Ht,O,S,!1,null,"2660c222",null);e["default"]=Qt.exports},ba35:function(t,e,r){"use strict";r("3d35")},e61f:function(t,e,r){"use strict";r("1945")},f8a0:function(t,e,r){}}]);
//# sourceMappingURL=chunk-cdad258c.df53e981.js.map