{"version":3,"sources":["webpack:///./src/views/settings/SettingsBranding.vue?8cb0","webpack:///./src/views/settings/SettingsBranding.vue","webpack:///./src/views/settings/SettingsBranding.vue?0ee4","webpack:///./src/views/settings/SettingsBranding.vue?cda5","webpack:///./src/views/settings/SettingsBillingDetails.vue?3281","webpack:///./src/views/settings/SettingsBillingDetails.vue","webpack:///./src/views/settings/SettingsBillingDetails.vue?2d13","webpack:///./src/views/settings/SettingsBillingDetails.vue?2565","webpack:///./src/views/settings/SettingsBranding.vue?b534","webpack:///./src/views/settings/SettingsBillingDetails.vue?a4dc"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","$t","model","value","callback","$$v","attachedFile","expression","saving","on","$event","saveUserInfo","_v","_s","staticStyle","confirmDialog","confirmRemove","staticRenderFns","auth","namespace","SettingsAccountDetails","Vue","constructor","firstName","surname","streetAddress","locality","region","postalCode","country","buyerDetails","buyerId","loadingDetails","created","claims","msalPluginInstance","GetCurrentSessionPayload","given_name","family_name","address","JSON","parse","formatted","street_address","postal_code","getBuyerDetails","removeLogo","SettingsApiService","saveBuyerLogo","then","Toast","success","initializeUserSettings","catch","err","error","finally","toString","saveAddress","saveUserAddress","BuyersApiService","res","__decorate","Action","INITIALIZE_USER_SETTINGS","Component","components","LoadingSpinner","ConfirmDialog","component","VBtn","VCol","VDialog","VFileInput","VRow","staticClass","currentplan","toggleCardElement","planType","_e","seatQuantity","newVal","loadingUpdateLicenses","updateLicenses","loadingPortalUrl","gotToCustomerPortal","stripePromise","loadStripe","AppConfig","stripePublishableKey","SettingsBillingDetails","PlanType","Standard","Basic","subscriptionId","stripe","cardElement","getCurrentBillingPlan","elements","style","base","fontFamily","fontSmoothing","fontSize","color","invalid","iconColor","create","mount","displayError","document","getElementById","textContent","message","BillingApiService","getbillingPlan","quantity","selectedPlan","initStripe","getCustomerPortalUrl","window","location","href","url","changeSeatQuantity","paymentMethodId","priceId","basicPriceId","procurePlan","createPaymentMethod","type","card","result","paymentMethod","id","SeatQuantitySelector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BU,mBACjB,CACCR,SAAUzH,KAAKqF,aACf6C,gBAAkBO,EAAOC,cAAgCC,GACzDR,QAAStC,OAAUuC,aACnBC,YAAarI,KAAKmF,WAElB7B,KAAKY,IACLlE,KAAKsG,wBACL/C,OAAMC,QAAQ,gCAEdE,MAAMC,IACNJ,OAAMK,MAAMD,KAEZE,QAAQ,KACR7D,KAAKuF,uBAAwB,QAtJhBQ,EAAsB,gBAH1CzB,eAAU,CACVC,WAAY,CAAEC,sBAAgBoE,4BAAsBnE,yBAEhCsB,WCvE8Y,I,iICQ/ZrB,EAAY,eACd,EACA5E,EACAwB,GACA,EACA,KACA,WACA,MAIa,aAAAoD,EAAiB,QAYhC,IAAkBA,EAAW,CAACC,OAAA,KAAKkE,QAAA,KAAMC,UAAA,OAAUC,WAAA,OAAWnE,OAAA,KAAKoE,SAAA,KAAOC,cAAA,KAAYlE,OAAA,Q,oCC/BtF,yBAAkkB,EAAG,G,kCCArkB,yBAAwkB,EAAG","file":"js/settings-billing.266b133f.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-row',[_c('v-col',{attrs:{\"md\":\"6\"}},[_c('v-file-input',{attrs:{\"label\":_vm.$t('SettingsBranding.logo'),\"outlined\":\"\",\"rounded\":\"\",\"show-size\":\"\",\"accept\":'.jpg, .jpeg, .png, .gif, .webp, .tiff, .tif',\"prepend-icon\":\"ri-attachment-line\"},model:{value:(_vm.attachedFile),callback:function ($$v) {_vm.attachedFile=$$v},expression:\"attachedFile\"}}),_c('v-btn',{attrs:{\"loading\":_vm.saving,\"color\":\"primary\",\"large\":\"\",\"rounded\":\"\",\"disabled\":_vm.attachedFile==null,\"type\":\"button\"},on:{\"click\":function($event){return _vm.saveUserInfo()}}},[_vm._v(\" \"+_vm._s(_vm.$t('SettingsBranding.buttons.save')))]),_c('v-btn',{staticStyle:{\"margin-left\":\"0.75rem\"},attrs:{\"loading\":_vm.saving,\"color\":\"error\",\"large\":\"\",\"rounded\":\"\",\"type\":\"button\"},on:{\"click\":function($event){_vm.confirmDialog = true}}},[_vm._v(_vm._s(_vm.$t('SettingsBranding.buttons.remove')))])],1),_c('v-dialog',{attrs:{\"width\":\"600\"},model:{value:(_vm.confirmDialog),callback:function ($$v) {_vm.confirmDialog=$$v},expression:\"confirmDialog\"}},[_c('ConfirmDialog',{attrs:{\"actionText\":_vm.$t('SettingsBranding.buttons.remove'),\"color\":'error',\"header\":_vm.$t('SettingsBranding.confirm'),\"onActionComplete\":function () {\n\t\t\t\t\t\t/* */\n\t\t\t\t\t},\"cancelText\":_vm.$t('SettingsBranding.cancel'),\"action\":function () { return _vm.confirmRemove(); },\"message\":_vm.$t('SettingsBranding.confirmMessage'),\"cancelAction\":function () { return (_vm.confirmDialog = false); }}})],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue } from 'vue-property-decorator';\r\nimport SettingsApiService from '@/api/settings.api';\r\nimport Toast from '@/services/toast.service';\r\nimport { namespace } from 'vuex-class';\r\nimport { INITIALIZE_USER_SETTINGS } from '@/store/auth/actions'\r\nimport { msalPluginInstance } from \"@/plugins/msal-plugin\";\r\nimport BuyersApiService from '@/api/buyers.api';\r\nimport { BuyerDetails } from '@/models/buyerDetails';\r\nimport ConfirmDialog from '@/components/ConfirmDialog.vue';\r\nimport LoadingSpinner from '@/components/LoadingSpinner.vue';\r\n\r\nconst auth = namespace('auth');\r\n\r\n@Component({\r\n\tcomponents: {LoadingSpinner,ConfirmDialog}\r\n})\r\nexport default class SettingsAccountDetails extends Vue {\r\n\t@auth.Action(INITIALIZE_USER_SETTINGS) public initializeUserSettings!: any;\r\n\tpublic saving = false;\r\n\tpublic firstName = '';\r\n\tpublic confirmDialog = false;\r\n\tpublic surname = '';\r\n\tpublic streetAddress = '';\r\n\tpublic locality = '';\r\n\tpublic region = '';\r\n\tpublic postalCode = '';\r\n\tpublic country = '';\r\n public attachedFile: File | null = null;\r\n public buyerDetails: BuyerDetails | null = null;\r\n public buyerId = '';\r\n \r\n\r\n\tpublic loadingDetails = false;\r\n\tcreated() {\r\n\t\tconst claims = msalPluginInstance.GetCurrentSessionPayload();\r\n\t\t\tthis.firstName = claims.given_name;\r\n\t\t\tthis.surname = claims.family_name;\r\n\r\n\t\t\tif (claims.address) {\r\n\t\t\t\tconst address = JSON.parse(claims.address.formatted);\r\n\t\t\t\tthis.streetAddress = address.street_address;\r\n\t\t\t\tthis.locality = address.locality;\r\n\t\t\t\tthis.region = address.region;\r\n\t\t\t\tthis.postalCode = address.postal_code;\r\n\t\t\t\tthis.country = address.country;\r\n\t\t\t}\r\n this.getBuyerDetails();\r\n\t}\r\n\tpublic removeLogo(){\r\n\t\tSettingsApiService.saveBuyerLogo({\r\n buyerId: this.buyerId,\r\n attachedFile: null\r\n\t\t})\r\n\t\t\t.then(() => {\r\n\t\t\t\tToast.success('Removed');\r\n\t\t\t\tthis.initializeUserSettings();\r\n\t\t\t})\r\n\t\t\t.catch(err => {\r\n\t\t\t\tToast.error(err);\r\n\t\t\t})\r\n\t\t\t.finally(() => (this.saving = false,this.confirmDialog=false,this.loadingDetails = false));\r\n\t}\r\n\tpublic saveUserInfo() {\r\n\t\tthis.saving = true;\r\n\t\tSettingsApiService.saveBuyerLogo({\r\n buyerId: this.buyerId,\r\n attachedFile: this.attachedFile\r\n\t\t})\r\n\t\t\t.then(() => {\r\n\t\t\t\tToast.success(this.$t('SettingsBranding.Saved').toString());\r\n\t\t\t\tthis.initializeUserSettings();\r\n\t\t\t})\r\n\t\t\t.catch(err => {\r\n\t\t\t\tToast.error(err);\r\n\t\t\t})\r\n\t\t\t.finally(() => (this.saving = false,this.confirmDialog=false,this.loadingDetails = false));\r\n\t}\r\n\r\n\tpublic saveAddress() {\r\n\t\tSettingsApiService.saveUserAddress({\r\n\t\t\tstreetAddress: this.streetAddress,\r\n\t\t\tlocality: this.locality,\r\n\t\t\tregion: this.region,\r\n\t\t\tpostalCode: this.postalCode,\r\n\t\t\tcountry: this.country\r\n\t\t})\r\n\t\t\t.then(() => {\r\n\t\t\t\tToast.success(this.$t('SettingsBranding.Saved').toString());\r\n\r\n\t\t\t})\r\n\t\t\t.catch(err => {\r\n\t\t\t\tToast.error(err);\r\n\t\t\t});\r\n\t}\r\n\tpublic confirmRemove() {\r\n this.removeLogo();\r\n\t}\r\n private getBuyerDetails() {\r\n\t\tthis.loadingDetails = true;\r\n\t\tBuyersApiService.getBuyerDetails()\r\n\t\t\t.then(res => {\r\n\t\t\t\tthis.buyerId = res.buyerId;\r\n\t\t\t})\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.loadingDetails = false;\r\n\t\t\t});\r\n\t}\r\n\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SettingsBranding.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SettingsBranding.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./SettingsBranding.vue?vue&type=template&id=822ca7d0&scoped=true&\"\nimport script from \"./SettingsBranding.vue?vue&type=script&lang=ts&\"\nexport * from \"./SettingsBranding.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./SettingsBranding.vue?vue&type=style&index=0&id=822ca7d0&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"822ca7d0\",\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VCol } from 'vuetify/lib/components/VGrid';\nimport { VDialog } from 'vuetify/lib/components/VDialog';\nimport { VFileInput } from 'vuetify/lib/components/VFileInput';\nimport { VRow } from 'vuetify/lib/components/VGrid';\ninstallComponents(component, {VBtn,VCol,VDialog,VFileInput,VRow})\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticStyle:{\"position\":\"relative\"}},[_c('v-row',{staticClass:\"justify-center\"},[_c('v-col',{attrs:{\"xs\":\"12\",\"sm\":\"8\",\"lg\":\"5\"}},[(_vm.currentplan == 0)?_c('v-radio-group',{staticClass:\"row col-sm-12\",attrs:{\"label\":\"Choose plan type:\"},on:{\"change\":function($event){return _vm.toggleCardElement()}},model:{value:(_vm.planType),callback:function ($$v) {_vm.planType=$$v},expression:\"planType\"}},[_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-sm-5 ma-4 planTypeBox\"},[_c('v-radio',{attrs:{\"label\":\"Basic\",\"value\":\"0\"}}),_c('p',[_vm._v(\"This plan includes max 3 user licenses\")])],1),_c('div',{staticClass:\"col-sm-5 ma-4 planTypeBox ml-10\"},[_c('v-radio',{attrs:{\"label\":\"Standard\",\"value\":\"1\"}}),_c('p',[_vm._v(\"This plan needs payment method (Card Details)\")])],1)])]):_vm._e(),_c('v-card',{attrs:{\"outlined\":\"\"}},[_c('v-card-title',[_c('h3',[_vm._v(\" Select number of seats \")])]),_c('v-card-text',[_c('SeatQuantitySelector',{attrs:{\"value\":_vm.seatQuantity},on:{\"change\":function (newVal) { return (_vm.seatQuantity = newVal); }}}),(_vm.currentplan == 0 && _vm.planType == 1)?_c('form',{attrs:{\"id\":\"subscription-form\"}},[_c('div',{staticClass:\"MyCardElement\",attrs:{\"id\":\"card-element\"}},[_vm._v(\" Elements will create input elements here \")]),_c('span',{staticStyle:{\"margin\":\"20px\"}},[_c('b',[_vm._v(\"No need to fill it for basic plan type\")])]),_c('div',{attrs:{\"id\":\"card-errors\",\"role\":\"alert\"}})]):_vm._e()],1)],1)],1)],1),_c('v-row',{staticClass:\"justify-center\"},[_c('v-col',{attrs:{\"xs\":\"12\",\"sm\":\"8\",\"lg\":\"5\"}},[_c('v-btn',{staticClass:\"mt-4\",staticStyle:{\"margin-right\":\"10px\"},attrs:{\"type\":\"button\",\"color\":\"primary\",\"loading\":_vm.loadingUpdateLicenses,\"depressed\":\"\",\"rounded\":\"\",\"large\":\"\"},on:{\"click\":function($event){return _vm.updateLicenses()}}},[_vm._v(\"Update Licenses\")]),(_vm.currentplan == 1)?_c('v-btn',{staticClass:\"mt-4\",attrs:{\"type\":\"button\",\"color\":\"primary\",\"loading\":_vm.loadingPortalUrl,\"depressed\":\"\",\"rounded\":\"\",\"large\":\"\"},on:{\"click\":function($event){return _vm.gotToCustomerPortal()}}},[_vm._v(\"Manage Subscription\")]):_vm._e()],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue } from 'vue-property-decorator';\r\nimport Toast from '@/services/toast.service';\r\nimport LoadingSpinner from '@/components/LoadingSpinner.vue';\r\nimport ConfirmDialog from '@/components/ConfirmDialog.vue';\r\nimport SeatQuantitySelector from '@/components/SeatQuantitySelector.vue';\r\nimport BillingApiService from '@/api/billing.api';\r\nimport { PlanType } from '@/models/enums/planType';\r\nimport { th } from 'date-fns/locale';\r\nimport {\r\n\tloadStripe,\r\n\tPaymentMethod,\r\n\tStripe,\r\n\tStripeCardElement\r\n} from '@stripe/stripe-js';\r\nimport AppConfig from '@/services/appConfig';\r\nconst stripePromise = loadStripe(AppConfig.stripePublishableKey);\r\n\r\n@Component({\r\n\tcomponents: { LoadingSpinner, SeatQuantitySelector, ConfirmDialog }\r\n})\r\nexport default class SettingsBillingDetails extends Vue {\r\n\tpublic loadingPortalUrl = false;\r\n\tpublic loadingUpdateLicenses = false;\r\n\tpublic seatQuantity = 1;\r\n\tpublic currentplan = PlanType.Standard;\r\n\tpublic planType = PlanType.Basic;\r\n\tpublic subscriptionId = '';\r\n\tprivate stripe: Stripe | null = null;\r\n\tprivate cardElement: StripeCardElement | null = null;\r\n\r\n\r\n\r\n\r\n\tpublic async created() {\r\n\t\tthis.getCurrentBillingPlan();\r\n\t}\r\n\r\n\tpublic async initStripe() {\r\n\t\tconst stripe = await stripePromise;\r\n\r\n\t\tif (!stripe) {\r\n\t\t\tToast.error('Failed to initiate payment flow');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst elements = stripe.elements();\r\n\r\n\t\tconst style = {\r\n\t\t\tbase: {\r\n\t\t\t\tfontFamily: '\"Montserrat\", Helvetica, sans-serif',\r\n\t\t\t\tfontSmoothing: 'antialiased',\r\n\t\t\t\tfontSize: '16px',\r\n\t\t\t\t'::placeholder': {\r\n\t\t\t\t\tcolor: 'rgba(0, 0, 0, 0.38)'\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tinvalid: {\r\n\t\t\t\tcolor: '#fa755a',\r\n\t\t\t\ticonColor: '#fa755a'\r\n\t\t\t}\r\n\t\t};\r\n\t\tconst cardElement = elements.create('card', { style: style });\r\n\t\tcardElement.mount('#card-element');\r\n\r\n\t\tcardElement.on('change', ({ error }) => {\r\n\t\t\tconst displayError = document.getElementById('card-errors');\r\n\r\n\t\t\tif (displayError) {\r\n\t\t\t\tif (error) {\r\n\t\t\t\t\tdisplayError.textContent = error.message;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdisplayError.textContent = '';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.stripe = stripe;\r\n\t\tthis.cardElement = cardElement;\r\n\t}\r\n\r\n\tpublic getCurrentBillingPlan() {\r\n\t\tthis.loadingPortalUrl = true;\r\n\t\tBillingApiService.getbillingPlan()\r\n\t\t\t.then(res => {\r\n\t\t\t\tthis.seatQuantity = res.quantity;\r\n\t\t\t\tthis.currentplan = res.selectedPlan;\r\n\t\t\t\tthis.planType = res.selectedPlan;\r\n\t\t\t\tthis.subscriptionId = res.subscriptionId;\r\n\t\t\t})\r\n\t\t\t.catch(err => {\r\n\t\t\t\tToast.error(err);\r\n\t\t\t})\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.loadingPortalUrl = false;\r\n\t\t\t\tthis.initStripe();\r\n\t\t\t});\r\n\t}\r\n\tpublic gotToCustomerPortal() {\r\n\t\tthis.loadingPortalUrl = true;\r\n\t\tBillingApiService.getCustomerPortalUrl()\r\n\t\t\t.then(res => {\r\n\t\t\t\twindow.location.href = res.url;\r\n\t\t\t})\r\n\t\t\t.catch(err => {\r\n\t\t\t\tToast.error(err);\r\n\t\t\t})\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.loadingPortalUrl = false;\r\n\t\t\t});\r\n\t}\r\n\tpublic toggleCardElement() {\r\n\t\tif (this.planType == 1)\r\n\t\t\tthis.initStripe();\r\n\t}\r\n\tpublic updateLicenses() {\r\n\t\tif (this.planType == PlanType.Basic || this.currentplan == PlanType.Standard) {\r\n\t\t\tif (this.planType == PlanType.Basic && this.seatQuantity > 3) {\r\n\t\t\t\tToast.error('In basic plan you can not select more than 3 seats')\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tthis.loadingUpdateLicenses = true;\r\n\r\n\t\t\tBillingApiService.changeSeatQuantity(\r\n\t\t\t\t{\r\n\t\t\t\t\tquantity: this.seatQuantity,\r\n\t\t\t\t\tpaymentMethodId: '000000',\r\n\t\t\t\t\tpriceId: AppConfig.basicPriceId,\r\n\t\t\t\t\tprocurePlan: this.planType\r\n\t\t\t\t}\r\n\t\t\t)\r\n\t\t\t\t.then(res => {\r\n\t\t\t\t\tthis.getCurrentBillingPlan();\r\n\t\t\t\t\tToast.success('Seats updated successfully');\r\n\t\t\t\t})\r\n\t\t\t\t.catch(err => {\r\n\t\t\t\t\tToast.error(err);\r\n\t\t\t\t})\r\n\t\t\t\t.finally(() => {\r\n\t\t\t\t\tthis.loadingUpdateLicenses = false;\r\n\t\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.loadingUpdateLicenses = true;\r\n\t\t\t(this.stripe as Stripe)\r\n\t\t\t\t.createPaymentMethod({\r\n\t\t\t\t\ttype: 'card',\r\n\t\t\t\t\tcard: this.cardElement as StripeCardElement\r\n\t\t\t\t})\r\n\t\t\t\t.then(result => {\r\n\t\t\t\t\tif (result.error) {\r\n\t\t\t\t\t\tToast.error(result.error.message as string);\r\n\t\t\t\t\t\tthis.loadingUpdateLicenses = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tBillingApiService.changeSeatQuantity(\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tquantity: this.seatQuantity,\r\n\t\t\t\t\t\t\t\tpaymentMethodId: (result.paymentMethod as PaymentMethod).id,\r\n\t\t\t\t\t\t\t\tpriceId: AppConfig.basicPriceId,\r\n\t\t\t\t\t\t\t\tprocurePlan: this.planType\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t.then(res => {\r\n\t\t\t\t\t\t\t\tthis.getCurrentBillingPlan();\r\n\t\t\t\t\t\t\t\tToast.success('Seats updated successfully');\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t.catch(err => {\r\n\t\t\t\t\t\t\t\tToast.error(err);\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t.finally(() => {\r\n\t\t\t\t\t\t\t\tthis.loadingUpdateLicenses = false;\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SettingsBillingDetails.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SettingsBillingDetails.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./SettingsBillingDetails.vue?vue&type=template&id=5c7f7714&scoped=true&\"\nimport script from \"./SettingsBillingDetails.vue?vue&type=script&lang=ts&\"\nexport * from \"./SettingsBillingDetails.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./SettingsBillingDetails.vue?vue&type=style&index=0&id=5c7f7714&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"5c7f7714\",\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VCard } from 'vuetify/lib/components/VCard';\nimport { VCardText } from 'vuetify/lib/components/VCard';\nimport { VCardTitle } from 'vuetify/lib/components/VCard';\nimport { VCol } from 'vuetify/lib/components/VGrid';\nimport { VRadio } from 'vuetify/lib/components/VRadioGroup';\nimport { VRadioGroup } from 'vuetify/lib/components/VRadioGroup';\nimport { VRow } from 'vuetify/lib/components/VGrid';\ninstallComponents(component, {VBtn,VCard,VCardText,VCardTitle,VCol,VRadio,VRadioGroup,VRow})\n","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SettingsBranding.vue?vue&type=style&index=0&id=822ca7d0&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SettingsBranding.vue?vue&type=style&index=0&id=822ca7d0&lang=scss&scoped=true&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SettingsBillingDetails.vue?vue&type=style&index=0&id=5c7f7714&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SettingsBillingDetails.vue?vue&type=style&index=0&id=5c7f7714&lang=scss&scoped=true&\""],"sourceRoot":""}