mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
1 line
57 KiB
JavaScript
Vendored
1 line
57 KiB
JavaScript
Vendored
(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{"/nGJ":function(t,e,a){"use strict";a("T0k5")},"0ezt":function(t,e,a){var r=a("x7z+");"string"==typeof r&&(r=[[t.i,r,""]]);var n={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(r,n);r.locals&&(t.exports=r.locals)},"1xrH":function(t,e,a){var r=a("T25u");"string"==typeof r&&(r=[[t.i,r,""]]);var n={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(r,n);r.locals&&(t.exports=r.locals)},"4X4q":function(t,e,a){(t.exports=a("I1BE")(!1)).push([t.i,"",""])},"6TPS":function(t,e,a){"use strict";var r=a("CjXH"),n={props:["data"],computed:{normalizedColumns:function(){return this.data.id&&delete this.data.id,Object.values(this.data)}}},s=(a("/nGJ"),a("KHd+")),i=Object(s.a)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("tr",{staticClass:"table-row"},t._l(t.normalizedColumns,(function(e,r){return a("td",{key:r,staticClass:"table-cell"},[a("span",[t._v(t._s(e))])])})),0)}),[],!1,null,"d6678dd0",null).exports,o=a("vDqi"),l=a.n(o),c={name:"DatatableWrapper",props:["columns","scope","paginator","api","tableData"],components:{ChevronRightIcon:r.k,ChevronLeftIcon:r.j,DatatableCell:i,ChevronUpIcon:r.l},computed:{hasData:function(){return this.data&&this.data.data&&this.data.data.length>0},floatPages:function(){return[this.pageIndex-1,this.pageIndex,this.pageIndex+1]}},data:function(){return{data:void 0,isLoading:!0,pageIndex:1,filter:{sort:"DESC",field:void 0}}},methods:{goToPage:function(t){t>this.data.meta.last_page||0===t||(this.pageIndex=t,this.getPage(t))},sort:function(t,e){e&&(this.filter.field=t,"DESC"===this.filter.sort?this.filter.sort="ASC":"ASC"===this.filter.sort&&(this.filter.sort="DESC"),this.getPage(this.pageIndex))},getPage:function(t){var e=this;this.URI=this.api,this.paginator&&(this.URI=this.URI+"?page="+t),this.filter.field&&(this.URI=this.URI+(this.paginator?"&":"?")+"sort="+this.filter.field+"&direction="+this.filter.sort),this.isLoading=!0,l.a.get(this.URI).then((function(t){e.data=t.data,e.$emit("data",t.data)})).catch((function(){return e.$isSomethingWrong()})).finally((function(){e.$emit("init",!0),e.isLoading=!1}))}},created:function(){this.api&&this.getPage(this.pageIndex),this.tableData&&(this.data=this.tableData,this.isLoading=!1)}},d=(a("jWOf"),Object(s.a)(c,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"w-full"},[t.hasData?a("table",{staticClass:"w-full"},[a("thead",{},[a("tr",t._l(t.columns,(function(e,r){return e.hidden?t._e():a("th",{key:r,staticClass:"text-left",class:{"sortable cursor-pointer":e.sortable,"text-right":Object.values(t.columns).length-1===r},on:{click:function(a){return t.sort(e.field,e.sortable)}}},[a("span",{staticClass:"dark:text-gray-500 text-gray-400 text-xs"},[t._v("\n\t\t\t\t\t\t\t"+t._s(e.label)+"\n\t\t\t\t\t\t")]),t._v(" "),e.sortable?a("chevron-up-icon",{staticClass:"inline-block vue-feather dark:text-gray-500 text-gray-300",class:{"arrow-down":"ASC"===t.filter.sort},attrs:{size:"12"}}):t._e()],1)})),0)]),t._v(" "),a("tbody",{staticClass:"table-body"},[t._l(t.data.data,(function(e){return t._t("default",(function(){return[a("DatatableCell",{key:e.id,attrs:{data:e}})]}),{row:e})}))],2)]):t._e(),t._v(" "),t.isLoading||t.hasData?t._e():t._t("empty-page"),t._v(" "),t.paginator&&t.hasData?a("div",{staticClass:"paginator-wrapper"},[t.data.meta.total>15&&t.data.meta.last_page<=6?a("ul",{staticClass:"pagination flex align-items"},[a("li",{staticClass:"page-item previous"},[a("a",{staticClass:"page-link",class:{disabled:0==t.pageIndex},on:{click:function(e){return t.goToPage(t.pageIndex-1)}}},[a("chevron-left-icon",{staticClass:"icon",attrs:{size:"14"}})],1)]),t._v(" "),t._l(t.data.meta.last_page,(function(e,r){return a("li",{key:r,staticClass:"page-item",on:{click:function(a){return t.goToPage(e)}}},[a("a",{staticClass:"page-link",class:{active:t.pageIndex===e}},[t._v("\n "+t._s(e)+"\n ")])])})),t._v(" "),a("li",{staticClass:"page-item next"},[a("a",{staticClass:"page-link",class:{disabled:t.pageIndex+1==t.data.meta.last_page},on:{click:function(e){return t.goToPage(t.pageIndex+1)}}},[a("chevron-right-icon",{staticClass:"icon",attrs:{size:"14"}})],1)])],2):t._e(),t._v(" "),t.data.meta.total>15&&t.data.meta.last_page>6?a("ul",{staticClass:"pagination"},[a("li",{staticClass:"page-item previous"},[a("a",{staticClass:"page-link",class:{disabled:0==t.pageIndex},on:{click:function(e){return t.goToPage(t.pageIndex-1)}}},[a("chevron-left-icon",{staticClass:"icon",attrs:{size:"14"}})],1)]),t._v(" "),t.pageIndex>=5?a("li",{staticClass:"page-item",on:{click:function(e){return t.goToPage(1)}}},[a("a",{staticClass:"page-link"},[t._v("\n 1\n ")])]):t._e(),t._v(" "),t._l(5,(function(e,r){return t.pageIndex<5?a("li",{key:r,staticClass:"page-item",on:{click:function(a){return t.goToPage(e)}}},[a("a",{staticClass:"page-link",class:{active:t.pageIndex===e}},[t._v("\n "+t._s(e)+"\n ")])]):t._e()})),t._v(" "),t.pageIndex>=5?a("li",{staticClass:"page-item"},[a("a",{staticClass:"page-link"},[t._v("...")])]):t._e(),t._v(" "),t._l(t.floatPages,(function(e,r){return t.pageIndex>=5&&t.pageIndex<t.data.meta.last_page-3?a("li",{key:r,staticClass:"page-item",on:{click:function(a){return t.goToPage(e)}}},[a("a",{staticClass:"page-link",class:{active:t.pageIndex===e}},[t._v("\n "+t._s(e)+"\n ")])]):t._e()})),t._v(" "),t.pageIndex<t.data.meta.last_page-3?a("li",{staticClass:"page-item"},[a("a",{staticClass:"page-link"},[t._v("...")])]):t._e(),t._v(" "),t._l(5,(function(e,r){return t.pageIndex>t.data.meta.last_page-4?a("li",{key:r,staticClass:"page-item",on:{click:function(e){t.goToPage(t.data.meta.last_page-(4-r))}}},[a("a",{staticClass:"page-link",class:{active:t.pageIndex===t.data.meta.last_page-(4-r)}},[t._v("\n "+t._s(t.data.meta.last_page-(4-r))+"\n ")])]):t._e()})),t._v(" "),t.pageIndex<t.data.meta.last_page-3?a("li",{staticClass:"page-item",on:{click:function(e){return t.goToPage(t.data.meta.last_page)}}},[a("a",{staticClass:"page-link"},[t._v("\n "+t._s(t.data.meta.last_page)+"\n ")])]):t._e(),t._v(" "),a("li",{staticClass:"page-item next"},[a("a",{staticClass:"page-link",class:{disabled:t.pageIndex+1==t.data.meta.last_page},on:{click:function(e){return t.goToPage(t.pageIndex+1)}}},[a("chevron-right-icon",{staticClass:"icon",attrs:{size:"14"}})],1)])],2):t._e(),t._v(" "),a("span",{staticClass:"mt-10 flex items-center justify-between text-xs text-gray-600"},[t._v("\n\t\t\t\tShowing "+t._s(t.data.meta.from)+" - "+t._s(t.data.meta.to)+" from "+t._s(t.data.meta.total)+" records\n\t\t\t")])]):t._e()],2)}),[],!1,null,"41f7bf1e",null));e.a=d.exports},KnjL:function(t,e,a){"use strict";var r={name:"InfoBox",props:["type"]},n=(a("LQoL"),a("KHd+")),s=Object(n.a)(r,(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"info-box",class:this.type},[this._t("default")],2)}),[],!1,null,"27ea1904",null);e.a=s.exports},LQoL:function(t,e,a){"use strict";a("0ezt")},Nvvg:function(t,e,a){"use strict";a("gJIj")},T0k5:function(t,e,a){var r=a("uv/y");"string"==typeof r&&(r=[[t.i,r,""]]);var n={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(r,n);r.locals&&(t.exports=r.locals)},T25u:function(t,e,a){(t.exports=a("I1BE")(!1)).push([t.i,".color-label.purple[data-v-e1e50194]{color:#9d66fe;background:rgba(157,102,254,.1)}.color-label.yellow[data-v-e1e50194]{color:#ffbd2d;background:rgba(255,189,45,.1)}.color-label.green[data-v-e1e50194]{color:#00bc7e;background:rgba(0,188,126,.1)}.color-label.red[data-v-e1e50194]{color:#fd397a;background:rgba(253,57,122,.1)}",""])},U4PJ:function(t,e,a){"use strict";a("1xrH")},UD3w:function(t,e,a){"use strict";var r={name:"AppInputText",props:["description","isLast","title","error"]},n=a("KHd+"),s=Object(n.a)(r,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{class:{"mb-7":!t.isLast}},[t.title?a("label",{staticClass:"text-sm font-bold dark:text-gray-200 text-gray-700 mb-1.5 block"},[t._v("\n\t\t"+t._s(t.title)+":\n\t")]):t._e(),t._v(" "),t._t("default"),t._v(" "),t.description?a("small",{staticClass:"text-xs text-gray-500 pt-2 leading-4 block",domProps:{innerHTML:t._s(t.description)}}):t._e(),t._v(" "),t.error?a("span",{staticClass:"text-red pt-2 text-xs"},[t._v("\n\t\t"+t._s(t.error)+"\n\t")]):t._e()],2)}),[],!1,null,null,null);e.a=s.exports},VYZZ:function(t,e,a){var r=a("XSq/");"string"==typeof r&&(r=[[t.i,r,""]]);var n={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(r,n);r.locals&&(t.exports=r.locals)},"XSq/":function(t,e,a){(t.exports=a("I1BE")(!1)).push([t.i,".page-item[data-v-41f7bf1e]{padding:3px;display:inline-block}.page-link[data-v-41f7bf1e]{width:30px;height:30px;display:block;color:#1b2539;border-radius:6px;text-align:center;line-height:2.4;font-weight:700;font-size:13px;cursor:pointer;transition:all .15s ease}.page-link .icon[data-v-41f7bf1e]{vertical-align:middle;margin-top:-2px}.page-link.active[data-v-41f7bf1e],.page-link[data-v-41f7bf1e]:hover:not(.disabled){background:#f4f5f6;color:#1b2539}.page-link.disabled[data-v-41f7bf1e]{background:transparent;cursor:default}.page-link.disabled svg path[data-v-41f7bf1e]{fill:rgba(27,37,57,.7)}",""])},cJdj:function(t,e,a){"use strict";a("kRqW")},eZ9V:function(t,e,a){"use strict";var r=a("CjXH"),n={name:"FormLabel",props:["icon"],components:{UsersIcon:r.zb,CreditCardIcon:r.t,DollarSignIcon:r.v,SmartphoneIcon:r.mb,HardDriveIcon:r.L,BarChartIcon:r.c,SettingsIcon:r.jb,FileTextIcon:r.D,ShieldIcon:r.lb,FrownIcon:r.H,Edit2Icon:r.y,BellIcon:r.d,KeyIcon:r.Q}},s=a("KHd+"),i=Object(s.a)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"flex items-center mb-8"},[t.icon?t._e():a("edit-2-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}),t._v(" "),"frown"===t.icon?a("frown-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"file-text"===t.icon?a("file-text-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"dollar"===t.icon?a("dollar-sign-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"credit-card"===t.icon?a("credit-card-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"bar-chart"===t.icon?a("bar-chart-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"settings"===t.icon?a("settings-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"hard-drive"===t.icon?a("hard-drive-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"smartphone"===t.icon?a("smartphone-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"shield"===t.icon?a("shield-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"bell"===t.icon?a("bell-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"key"===t.icon?a("key-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"users"===t.icon?a("users-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),a("b",{staticClass:"font-bold dark:text-gray-200 text-lg"},[t._t("default")],2)],1)}),[],!1,null,null,null);e.a=i.exports},gJIj:function(t,e,a){var r=a("lkHs");"string"==typeof r&&(r=[[t.i,r,""]]);var n={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(r,n);r.locals&&(t.exports=r.locals)},h6vl:function(t,e,a){"use strict";var r={name:"DotLabel",props:["color","title"]},n=(a("Nvvg"),a("KHd+")),s={name:"ProgressLine",props:["data"],components:{DotLabel:Object(n.a)(r,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"label"},[e("span",{class:["label-dot",this.color]}),this._v(" "),e("b",{staticClass:"label-title"},[this._v("\n "+this._s(this.title)+"\n ")])])}),[],!1,null,"65eb31b6",null).exports}},i=(a("kika"),Object(n.a)(s,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"flex items-center mb-4 rounded dark:bg-2x-dark-foreground bg-light-300 h-2.5"},t._l(t.data,(function(e,r){return a("div",{key:r,staticClass:"chart-wrapper",style:{width:(e.progress>1?e.progress:0)+"%"}},[1===t.data.length?a("span",{staticClass:"chart-progress w-full h-2.5 block",class:[{"border-r-2 dark:border-gray-800 border-white rounded-tl-lg rounded-bl-lg":e.progress<100,"border-none rounded-lg":e.progress>=100},e.color]}):t._e(),t._v(" "),t.data.length>1&&e.progress>0?a("span",{staticClass:"chart-progress w-full h-2.5 block",class:[{"rounded-tl-lg rounded-bl-lg border-r-2 dark:border-gray-800 border-white":0===r,"border-r-2 dark:border-gray-800 border-white":r<t.data.length-1,"rounded-tr-lg rounded-br-lg":r===t.data.length-1},e.color]}):t._e()])})),0),t._v(" "),a("footer",{staticClass:"flex items-center w-full overflow-x-auto"},t._l(t.data,(function(t,e){return a("DotLabel",{key:e,staticClass:"mr-5",attrs:{color:t.color,title:t.title}})})),1)])}),[],!1,null,"1996acd4",null));e.a=i.exports},jH4x:function(t,e,a){"use strict";var r={name:"AppInputSwitch",props:["description","isLast","title","error"]},n=a("KHd+"),s=Object(n.a)(r,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"flex items-center justify-between sm:space-x-8 space-x-2 w-full",class:{"mb-7":!t.isLast}},[a("div",{staticClass:"leading-5"},[a("label",{staticClass:"text-sm font-bold dark:text-gray-200 text-gray-700 mb-1.5 block"},[t._v("\n\t\t\t"+t._s(t.title)+":\n\t\t")]),t._v(" "),t.description?a("span",{staticClass:"text-xs text-gray-500 leading-4 block",domProps:{innerHTML:t._s(t.description)}}):t._e(),t._v(" "),t.error?a("span",{staticClass:"error-message"},[t._v("\n\t\t\t"+t._s(t.error)+"\n\t\t")]):t._e()]),t._v(" "),a("div",[t._t("default")],2)])}),[],!1,null,null,null);e.a=s.exports},jWOf:function(t,e,a){"use strict";a("VYZZ")},kPoH:function(t,e,a){"use strict";var r={name:"ColorLabel",props:["color"]},n=(a("U4PJ"),a("KHd+")),s=Object(n.a)(r,(function(){var t=this.$createElement;return(this._self._c||t)("b",{staticClass:"color-label capitalize inline-block text-xs font-bold rounded-lg py-1 px-2",class:this.color},[this._t("default")],2)}),[],!1,null,"e1e50194",null);e.a=s.exports},kRqW:function(t,e,a){var r=a("4X4q");"string"==typeof r&&(r=[[t.i,r,""]]);var n={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(r,n);r.locals&&(t.exports=r.locals)},kika:function(t,e,a){"use strict";a("oqEP")},lkHs:function(t,e,a){(t.exports=a("I1BE")(!1)).push([t.i,".label[data-v-65eb31b6]{display:flex;align-items:center}.label .label-dot[data-v-65eb31b6]{margin-right:10px;width:8px;height:8px;display:block;border-radius:8px;flex:none}.label .label-dot.success[data-v-65eb31b6]{background:#0abb87}.label .label-dot.danger[data-v-65eb31b6]{background:#fd397a}.label .label-dot.warning[data-v-65eb31b6]{background:#ffb822}.label .label-dot.info[data-v-65eb31b6]{background:#5578eb}.label .label-dot.primary[data-v-65eb31b6]{background:red}.label .label-dot.purple[data-v-65eb31b6]{background:#9d66fe}.label .label-dot.secondary[data-v-65eb31b6]{background:#e1e1ef}.label .label-title[data-v-65eb31b6]{font-size:16px;font-weight:700}",""])},oqEP:function(t,e,a){var r=a("vIjS");"string"==typeof r&&(r=[[t.i,r,""]]);var n={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(r,n);r.locals&&(t.exports=r.locals)},qefO:function(t,e,a){"use strict";var r={name:"PageTab",props:["isLoading"],components:{Spinner:a("zTYo").a}},n=(a("cJdj"),a("KHd+")),s=Object(n.a)(r,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"page-tab"},[e("div",{directives:[{name:"show",rawName:"v-show",value:this.isLoading,expression:"isLoading"}],attrs:{id:"loader"}},[e("Spinner")],1),this._v(" "),this._t("default")],2)}),[],!1,null,"3dead278",null);e.a=s.exports},"uv/y":function(t,e,a){(t.exports=a("I1BE")(!1)).push([t.i,".table-row[data-v-d6678dd0]{border-radius:8px}.table-row[data-v-d6678dd0]:hover{background:#f4f5f6}.table-row .table-cell[data-v-d6678dd0]{padding-top:15px;padding-bottom:15px}.table-row .table-cell[data-v-d6678dd0]:first-child{padding-left:15px}.table-row .table-cell[data-v-d6678dd0]:last-child{padding-right:15px;text-align:right}.table-row .table-cell span[data-v-d6678dd0]{font-size:1em;font-weight:700}",""])},vIjS:function(t,e,a){(t.exports=a("I1BE")(!1)).push([t.i,".chart-progress.success[data-v-1996acd4]{background:#0abb87;box-shadow:0 3px 10px rgba(10,187,135,.5)}.chart-progress.danger[data-v-1996acd4]{background:#fd397a;box-shadow:0 3px 10px rgba(253,57,122,.5)}.chart-progress.warning[data-v-1996acd4]{background:#ffb822;box-shadow:0 3px 10px rgba(255,184,34,.5)}.chart-progress.info[data-v-1996acd4]{background:#5578eb;box-shadow:0 3px 10px rgba(85,120,235,.5)}.chart-progress.purple[data-v-1996acd4]{background:#9d66fe;box-shadow:0 3px 10px rgba(157,102,254,.5)}.chart-progress.secondary[data-v-1996acd4]{background:#e1e1ef;box-shadow:0 3px 10px rgba(225,225,239,.5)}.dark .chart-progress.secondary[data-v-1996acd4]{background:#282a2f!important;box-shadow:0 3px 10px rgba(40,42,47,.5)!important}",""])},wgHF:function(t,e,a){"use strict";a.r(e);var r=a("jH4x"),n=a("Nv84"),s=a("eZ9V"),i=a("vDqi"),o=a.n(i),l=a("xCqy"),c={name:"UserUpdatePaymentMethodsExternally",components:{AppInputSwitch:r.a,ButtonBase:n.a,FormLabel:s.a},computed:{canShowForSubscription:function(){return this.hasSubscription&&!this.subscription.attributes.is_cancelled&&["paystack","paypal"].includes(this.subscription.attributes.driver)},subscription:function(){return this.$store.getters.user.data.relationships.subscription.data},hasSubscription:function(){return this.$store.getters.user.data.relationships.subscription}},data:function(){return{isGeneratedUpdateLink:!1}},methods:{updatePaymentMethod:function(){var t=this;this.isGeneratedUpdateLink=!0,o.a.post("/api/subscriptions/edit/".concat(this.subscription.id)).then((function(t){window.location=t.data.url})).catch((function(){l.a.$emit("toaster",{type:"danger",message:t.$t("popup_error.title")}),t.isGeneratedUpdateLink=!1}))}}},d=a("KHd+"),u=Object(d.a)(c,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.canShowForSubscription?a("div",{staticClass:"card shadow-card"},[a("FormLabel",[t._v("\n\t\t"+t._s(t.$t("Update Payments"))+"\n\t")]),t._v(" "),a("AppInputSwitch",{attrs:{title:t.$t("Update your Payment Method"),description:t.$t("You will be redirected to your payment provider to edit your payment method."),"is-last":!0}},[a("ButtonBase",{staticClass:"sm:w-auto w-full",attrs:{loading:t.isGeneratedUpdateLink,"button-style":"theme"},nativeOn:{click:function(e){return t.updatePaymentMethod.apply(null,arguments)}}},[t._v("\n\t\t\t"+t._s(t.$t("Update Payments"))+"\n\t\t")])],1)],1):t._e()}),[],!1,null,null,null).exports,p=a("kPoH"),b=a("6TPS"),f=a("KnjL"),m={name:"UserTransactionsForMeteredBilling",components:{ColorLabel:p.a,DatatableWrapper:b.a,FormLabel:s.a,InfoBox:f.a},data:function(){return{columns:[{label:this.$t("Note"),field:"note",sortable:!0},{label:this.$t("Status"),field:"status",sortable:!0},{label:this.$t("Type"),field:"status",sortable:!0},{label:this.$t("admin_page_invoices.table.total"),field:"amount",sortable:!0},{label:this.$t("Payed At"),field:"created_at",sortable:!0},{label:this.$t("Service"),field:"driver",sortable:!0}]}}},g=Object(d.a)(m,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card shadow-card"},[a("FormLabel",{attrs:{icon:"file-text"}},[t._v("\n\t\t"+t._s(t.$t("Transactions"))+"\n\t")]),t._v(" "),a("DatatableWrapper",{attrs:{api:"/api/subscriptions/transactions",paginator:!0,columns:t.columns},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[a("tr",{staticClass:"border-b dark:border-opacity-5 border-light border-dashed"},[a("td",{staticClass:"py-4"},[a("span",{staticClass:"text-sm font-bold"},[t._v("\n\t\t\t\t\t\t"+t._s(r.data.attributes.note)+"\n\t\t\t\t\t")])]),t._v(" "),a("td",[a("ColorLabel",{staticClass:"capitalize",attrs:{color:t.$getTransactionStatusColor(r.data.attributes.status)}},[t._v("\n\t\t\t\t\t\t"+t._s(r.data.attributes.status)+"\n\t\t\t\t\t")])],1),t._v(" "),a("td",{staticClass:"py-4"},[a("span",{staticClass:"text-sm font-bold capitalize"},[t._v("\n\t\t\t\t\t\t"+t._s(t.$t(r.data.attributes.type))+"\n\t\t\t\t\t")])]),t._v(" "),a("td",[a("span",{staticClass:"text-sm font-bold",class:t.$getTransactionTypeTextColor(r.data.attributes.type)},[t._v("\n\t\t\t\t\t\t"+t._s(t.$getTransactionMark(r.data.attributes.type)+r.data.attributes.price)+"\n\t\t\t\t\t")])]),t._v(" "),a("td",[a("span",{staticClass:"text-sm font-bold"},[t._v("\n\t\t\t\t\t\t"+t._s(r.data.attributes.created_at)+"\n\t\t\t\t\t")])]),t._v(" "),a("td",{staticClass:"text-right"},[a("img",{staticClass:"inline-block max-h-5",attrs:{src:t.$getPaymentLogo(r.data.attributes.driver),alt:r.data.attributes.driver}})])])]}},{key:"empty-page",fn:function(){return[a("InfoBox",{staticStyle:{"margin-bottom":"0"}},[a("p",[t._v(t._s(t.$t("user_invoices.empty")))])])]},proxy:!0}])})],1)}),[],!1,null,null,null).exports,v={name:"UserTransactionsForFixedBilling",components:{ColorLabel:p.a,DatatableWrapper:b.a,FormLabel:s.a,InfoBox:f.a},data:function(){return{columns:[{label:this.$t("Note"),field:"note",sortable:!0},{label:this.$t("Status"),field:"status",sortable:!0},{label:this.$t("admin_page_invoices.table.total"),field:"amount",sortable:!0},{label:this.$t("Payed At"),field:"created_at",sortable:!0},{label:this.$t("Service"),field:"driver",sortable:!0}]}}},h=Object(d.a)(v,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card shadow-card"},[a("FormLabel",{attrs:{icon:"file-text"}},[t._v("\n\t\t"+t._s(t.$t("Transactions"))+"\n\t")]),t._v(" "),a("DatatableWrapper",{attrs:{api:"/api/subscriptions/transactions",paginator:!0,columns:t.columns},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[a("tr",{staticClass:"border-b dark:border-opacity-5 border-light border-dashed"},[a("td",{staticClass:"py-4"},[a("span",{staticClass:"text-sm font-bold"},[t._v("\n\t\t\t\t\t\t"+t._s(r.data.attributes.note)+"\n\t\t\t\t\t")])]),t._v(" "),a("td",[a("ColorLabel",{attrs:{color:t.$getTransactionStatusColor(r.data.attributes.status)}},[t._v("\n\t\t\t\t\t\t"+t._s(r.data.attributes.status)+"\n\t\t\t\t\t")])],1),t._v(" "),a("td",[a("span",{staticClass:"text-sm font-bold",class:t.$getTransactionTypeTextColor(r.data.attributes.type)},[t._v("\n\t\t\t\t\t\t"+t._s(t.$getTransactionMark(r.data.attributes.type)+r.data.attributes.price)+"\n\t\t\t\t\t")])]),t._v(" "),a("td",[a("span",{staticClass:"text-sm font-bold"},[t._v("\n\t\t\t\t\t\t"+t._s(r.data.attributes.created_at)+"\n\t\t\t\t\t")])]),t._v(" "),a("td",{staticClass:"text-right"},[a("img",{staticClass:"inline-block max-h-5",attrs:{src:t.$getPaymentLogo(r.data.attributes.driver),alt:r.data.attributes.driver}})])])]}},{key:"empty-page",fn:function(){return[a("InfoBox",{staticStyle:{"margin-bottom":"0"}},[a("p",[t._v(t._s(t.$t("user_invoices.empty")))])])]},proxy:!0}])})],1)}),[],!1,null,null,null).exports,_=a("h6vl"),y=a("L2JU");function x(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var a=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==a)return;var r,n,s=[],i=!0,o=!1;try{for(a=a.call(t);!(i=(r=a.next()).done)&&(s.push(r.value),!e||s.length!==e);i=!0);}catch(t){o=!0,n=t}finally{try{i||null==a.return||a.return()}finally{if(o)throw n}}return s}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return w(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return w(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}function C(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function k(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?C(Object(a),!0).forEach((function(e){O(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):C(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function O(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var P={name:"UserFixedSubscriptionDetail",components:{ProgressLine:_.a,FormLabel:s.a},computed:k(k({},Object(y.b)(["user"])),{},{subscription:function(){return this.$store.getters.user.data.relationships.subscription},hasSubscription:function(){return this.$store.getters.user.data.relationships.subscription},limitations:function(){var t=[];return Object.entries(this.user.data.meta.limitations).map((function(e){var a=x(e,2),r=a[0],n=a[1],s={color:{max_storage_amount:"warning",max_team_members:"purple"},message:{max_storage_amount:"Total ".concat(n.use," of ").concat(n.total," Used"),max_team_members:"Total ".concat(n.use," of ").concat(n.total," Members")},title:{max_storage_amount:"Storage",max_team_members:"Team Members"}};t.push({message:s.message[r],distribution:[{progress:n.percentage,color:s.color[r],title:s.title[r]}]})})),t},status:function(){return{active:"Active until ".concat(this.subscription.data.attributes.renews_at),cancelled:"Ends at ".concat(this.subscription.data.attributes.ends_at)}[this.subscription.data.attributes.status]},price:function(){return{month:"".concat(this.subscription.data.relationships.plan.data.attributes.price," Per Month"),year:"".concat(this.subscription.data.relationships.plan.data.attributes.price," Per Year")}[this.subscription.data.relationships.plan.data.attributes.interval]}})},$=Object(d.a)(P,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.hasSubscription?a("div",{staticClass:"card shadow-card"},[a("FormLabel",[t._v("\n\t\t"+t._s(t.$t("Subscription"))+"\n\t")]),t._v(" "),a("b",{staticClass:"text-3xl font-extrabold -mt-3 block mb-0.5"},[t._v("\n\t\t"+t._s(t.status)+"\n\t")]),t._v(" "),a("b",{staticClass:"mb-3 block text-sm text-gray-400 mb-8"},[t._v("\n\t\t"+t._s(t.subscription.data.relationships.plan.data.attributes.name)+" / "+t._s(t.price)+"\n\t")]),t._v(" "),t._l(t.limitations,(function(e,r){return a("div",{key:r,class:{"mb-6":Object.keys(t.limitations).length-1!==r}},[a("b",{staticClass:"mb-3 block text-sm text-gray-400"},[t._v("\n\t\t\t"+t._s(e.message)+"\n\t\t")]),t._v(" "),a("ProgressLine",{attrs:{data:e.distribution}})],1)}))],2):t._e()}),[],!1,null,null,null).exports,j=a("o0o1"),S=a.n(j),A=a("CjXH"),B={name:"PaymentCard",components:{Trash2Icon:A.rb},props:["card"],methods:{deleteCreditCard:function(t){l.a.$emit("confirm:open",{title:this.$t("Are you sure you want to delete your credit card?"),message:this.$t("We will no longer settle your payments automatically and you will have to fund your account for the next payments."),action:{id:t,operation:"delete-credit-card"}})}},created:function(){var t=this;l.a.$on("action:confirmed",(function(e){"delete-credit-card"===e.operation&&o.a.delete("/api/stripe/credit-cards/".concat(e.id)).then((function(){t.$store.dispatch("getAppData"),l.a.$emit("toaster",{type:"success",message:t.$t("Your credit card was deleted.")})})).catch((function(){return t.$isSomethingWrong()}))}))},destroyed:function(){l.a.$off("action:confirmed")}},I=Object(d.a)(B,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"flex items-center justify-between py-3 px-4 input-dark"},[a("div",{staticClass:"flex items-center"},[a("img",{staticClass:"h-5 mr-3 rounded",attrs:{src:"/assets/gateways/"+t.card.data.attributes.brand+".svg",alt:""}}),t._v(" "),a("b",{staticClass:"text-sm font-bold leading-none capitalize"},[t._v("\n\t\t\t"+t._s(t.card.data.attributes.brand)+" •••• "+t._s(t.card.data.attributes.last4)+"\n\t\t")])]),t._v(" "),a("b",{staticClass:"text-sm font-bold leading-none"},[t._v("\n\t\t"+t._s(t.$t("Expires"))+" "+t._s(t.card.data.attributes.expiration)+"\n\t")]),t._v(" "),a("Trash2Icon",{staticClass:"cursor-pointer",attrs:{size:"15"},on:{click:function(e){return t.deleteCreditCard(t.card.data.id)}}})],1)}),[],!1,null,null,null).exports,E=a("zTYo"),T="https://js.stripe.com/v3",F=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,U="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",D=null,L=function(t){return null!==D?D:D=new Promise((function(e,a){if("undefined"!=typeof window)if(window.Stripe&&t&&console.warn(U),window.Stripe)e(window.Stripe);else try{var r=function(){for(var t=document.querySelectorAll('script[src^="'.concat(T,'"]')),e=0;e<t.length;e++){var a=t[e];if(F.test(a.src))return a}return null}();r&&t?console.warn(U):r||(r=function(t){var e=t&&!t.advancedFraudSignals?"?advancedFraudSignals=false":"",a=document.createElement("script");a.src="".concat(T).concat(e);var r=document.head||document.body;if(!r)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return r.appendChild(a),a}(t)),r.addEventListener("load",(function(){window.Stripe?e(window.Stripe):a(new Error("Stripe.js not available"))})),r.addEventListener("error",(function(){a(new Error("Failed to load Stripe.js"))}))}catch(t){return void a(t)}else e(null)}))},z=function(t,e,a){if(null===t)return null;var r=t.apply(void 0,e);return function(t,e){t&&t._registerWrapper&&t._registerWrapper({name:"stripe-js",version:"1.22.0",startTime:e})}(r,a),r},M=Promise.resolve().then((function(){return L(null)})),H=!1;M.catch((function(t){H||console.warn(t)}));var q=function(){for(var t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];H=!0;var r=Date.now();return M.then((function(t){return z(t,e,r)}))};function W(t,e,a,r,n,s,i){try{var o=t[s](i),l=o.value}catch(t){return void a(t)}o.done?e(l):Promise.resolve(l).then(r,n)}function Y(t){return function(){var e=this,a=arguments;return new Promise((function(r,n){var s=t.apply(e,a);function i(t){W(s,r,n,i,o,"next",t)}function o(t){W(s,r,n,i,o,"throw",t)}i(void 0)}))}}function V(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function K(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?V(Object(a),!0).forEach((function(e){N(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):V(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function N(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var R,J=void 0,G={name:"UserStoredPaymentMethods",components:{ButtonBase:n.a,FormLabel:s.a,PaymentCard:I,Spinner:E.a},computed:K(K({},Object(y.b)(["isDarkMode","config","user"])),{},{canShowForMeteredBilling:function(){return this.config.isStripe&&"metered"===this.config.subscriptionType},canShowForFixedBilling:function(){return this.config.isStripe&&"fixed"===this.config.subscriptionType&&this.$store.getters.user.data.relationships.subscription&&"stripe"===this.$store.getters.user.data.relationships.subscription.data.attributes.driver},hasPaymentMethod:function(){return this.user.data.relationships.creditCards&&this.user.data.relationships.creditCards.data.length>0}}),data:function(){return{isLoading:!1,isCreditCardForm:!1,stripe:{isInitialization:!0,storingStripePaymentMethod:!1}}},methods:{storeStripePaymentMethod:function(){var t=this;return Y(S.a.mark((function e(){var a,r;return S.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.stripe.storingStripePaymentMethod=!0,e.next=3,R.confirmSetup({elements:J,redirect:"if_required",confirmParams:{return_url:window.location.href}});case 3:a=e.sent,(r=a.error)?document.querySelector("#error-message").textContent=r.message:l.a.$emit("toaster",{type:"success",message:t.$t("Your credit card was stored successfully")}),t.stripe.storingStripePaymentMethod=!1;case 7:case"end":return e.stop()}}),e)})))()},stripeInit:function(){var t=this;return Y(S.a.mark((function e(){return S.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,q(t.config.stripe_public_key);case 2:return R=e.sent,e.next=5,o.a.get("/api/stripe/setup-intent").then((function(e){(J=R.elements({clientSecret:e.data.client_secret,appearance:{theme:"stripe",variables:{colorPrimary:t.config.app_color,fontFamily:"Nunito",borderRadius:"8px",colorText:t.isDarkMode?"#bec6cf":"#1B2539",colorBackground:t.isDarkMode?"#191b1e":"#fff",fontWeightNormal:"700",fontSizeSm:"0.875rem",colorSuccessText:"#0ABB87",colorSuccess:"#0ABB87",colorWarning:"#fd397a",colorWarningText:"#fd397a",colorDangerText:"#fd397a",colorTextSecondary:"#6b7280",spacingGridRow:"20px"}}})).create("payment").mount("#payment-element")})).catch((function(){l.a.$emit("toaster",{type:"danger",message:t.$t("popup_error.title")})}));case 5:t.stripe.isInitialization=!1;case 6:case"end":return e.stop()}}),e)})))()},showStoreCreditCardForm:function(){this.isCreditCardForm=!this.isCreditCardForm,this.stripeInit()}}},X=Object(d.a)(G,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.canShowForMeteredBilling||t.canShowForFixedBilling?a("div",{staticClass:"card shadow-card"},[a("FormLabel",{attrs:{icon:"credit-card"}},[t._v("\n\t\t"+t._s(t.$t("Payment Method"))+"\n\t")]),t._v(" "),t.hasPaymentMethod?a("div",["metered"===t.config.subscriptionType&&t.user.data.relationships.balance.data.attributes.balance>0?a("b",{staticClass:"mb-3 block text-sm mb-5"},[t._v("\n\t\t\t"+t._s(t.$t("credit_to_auto_withdraw",{credit:t.user.data.relationships.balance.data.attributes.formatted}))+"\n\t\t")]):t._e(),t._v(" "),t._l(t.user.data.relationships.creditCards.data,(function(t){return a("PaymentCard",{key:t.data.id,attrs:{card:t}})})),t._v(" "),a("small",{staticClass:"text-xs text-gray-500 pt-3 leading-none sm:block hidden"},[t._v("\n\t\t\t"+t._s(t.$t("We are settling your payment automatically via your saved credit card."))+"\n\t\t")])],2):t._e(),t._v(" "),t.hasPaymentMethod?t._e():a("div",[t.isCreditCardForm?t._e():a("ButtonBase",{staticClass:"w-full mt-4",attrs:{loading:t.stripe.storingStripePaymentMethod,type:"submit","button-style":"theme"},nativeOn:{click:function(e){return t.showStoreCreditCardForm.apply(null,arguments)}}},[t._v("\n\t\t\t"+t._s(t.$t("Add Payment Method"))+"\n\t\t")]),t._v(" "),t.isCreditCardForm?a("form",{staticClass:"mt-6",attrs:{id:"payment-form"},on:{submit:function(e){return e.preventDefault(),t.storeStripePaymentMethod.apply(null,arguments)}}},[t.stripe.isInitialization?a("div",{staticClass:"h-10 relative mb-6"},[a("Spinner")],1):t._e(),t._v(" "),a("div",{attrs:{id:"payment-element"}}),t._v(" "),a("ButtonBase",{staticClass:"w-full mt-4",attrs:{loading:t.stripe.storingStripePaymentMethod,type:"submit","button-style":"theme"}},[t._v("\n\t\t\t\t"+t._s(t.$t("Store My Credit Card"))+"\n\t\t\t")]),t._v(" "),a("div",{attrs:{id:"error-message"}})],1):t._e()],1)],1):t._e()}),[],!1,null,null,null).exports,Z={name:"UserEmptySubscription",components:{ButtonBase:n.a,FormLabel:s.a,InfoBox:f.a},computed:{hasSubscription:function(){return this.$store.getters.user.data.relationships.subscription}}},Q=Object(d.a)(Z,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.hasSubscription?t._e():a("div",{staticClass:"card shadow-card"},[a("FormLabel",[t._v("\n\t\t"+t._s(t.$t("Subscription"))+"\n\t")]),t._v(" "),a("b",{staticClass:"text-3xl font-extrabold -mt-3 block mb-0.5"},[t._v("\n\t\t"+t._s(t.$t("Free Plan"))+"\n\t")]),t._v(" "),a("b",{staticClass:"mb-3 block text-sm text-gray-400 mb-8"},[t._v("\n\t\t"+t._s(t.$t("1GB Free storage space with 5 Team members"))+"\n\t")]),t._v(" "),a("ButtonBase",{staticClass:"w-full mt-4",attrs:{type:"submit","button-style":"theme"},nativeOn:{click:function(e){return t.$openUpgradeOptions.apply(null,arguments)}}},[t._v("\n\t\t"+t._s(t.$t("Upgrade Your Account"))+"\n\t")])],1)}),[],!1,null,null,null).exports,tt={name:"UserEditSubscription",components:{AppInputSwitch:r.a,ButtonBase:n.a,FormLabel:s.a},computed:{subscription:function(){return this.$store.getters.user.data.relationships.subscription.data},hasSubscription:function(){return this.$store.getters.user.data.relationships.subscription}},data:function(){return{isCancelling:!1}},methods:{cancelSubscriptionConfirmation:function(){l.a.$emit("confirm:open",{title:this.$t("Are you sure you want to cancel subscription?"),message:this.$t("You'll continue to have access to the features you've paid for until the end of your billing cycle."),action:{operation:"cancel-subscription"}})}},created:function(){var t=this;l.a.$on("action:confirmed",(function(e){"cancel-subscription"===e.operation&&(t.isCancelling=!0,o.a.post("/api/subscriptions/cancel").then((function(){t.$store.dispatch("getAppData").then((function(){t.fetchSubscriptionDetail()})),l.a.$emit("toaster",{type:"success",message:t.$t("popup_subscription_cancel.title")})})).catch((function(){l.a.$emit("toaster",{type:"danger",message:t.$t("popup_error.title")})})).finally((function(){t.isCancelling=!1})))}))},destroyed:function(){l.a.$off("action:confirmed")}},et=Object(d.a)(tt,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.hasSubscription?a("div",{staticClass:"card shadow-card"},[a("FormLabel",[t._v("\n\t\t"+t._s(t.$t("Edit your Subscription"))+"\n\t")]),t._v(" "),"cancelled"!==t.subscription.attributes.status?a("AppInputSwitch",{attrs:{title:t.$t("Cancel Subscription"),description:t.$t("You can cancel your subscription now. You'll continue to have access to the features you've paid for until the end of your billing cycle.")}},[a("ButtonBase",{staticClass:"sm:w-auto w-full",attrs:{loading:t.isCancelling,"button-style":"secondary"},nativeOn:{click:function(e){return t.cancelSubscriptionConfirmation.apply(null,arguments)}}},[t._v("\n\t\t\t"+t._s(t.$t("Cancel Now"))+"\n\t\t")])],1):t._e(),t._v(" "),a("AppInputSwitch",{attrs:{title:t.$t("Upgrade or Downgrade Plan"),description:t.$t("You can upgrade your plan at any time you want."),"is-last":!0}},[a("ButtonBase",{staticClass:"sm:w-auto w-full",attrs:{"button-style":"secondary"},nativeOn:{click:function(e){return t.$openUpgradeOptions.apply(null,arguments)}}},[t._v("\n\t\t\t"+t._s(t.$t("Change Plan"))+"\n\t\t")])],1)],1):t._e()}),[],!1,null,null,null).exports;function at(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function rt(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var nt={name:"UserFailedPayments",components:{FormLabel:s.a,InfoBox:f.a},computed:function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?at(Object(a),!0).forEach((function(e){rt(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):at(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}({},Object(y.b)(["user"]))},st=Object(d.a)(nt,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.user.data.relationships.failedPayments&&t.user.data.relationships.failedPayments.data.length>0?a("div",{staticClass:"card shadow-card"},[a("FormLabel",{attrs:{icon:"frown"}},[t._v("\n\t\t"+t._s(t.$t("Failed Payments"))+"\n\t")]),t._v(" "),a("b",{staticClass:"text-3xl font-extrabold -mt-3 block mb-0.5"},[t._v("\n\t\t-"+t._s(t.user.data.meta.totalDebt)+"\n\t")]),t._v(" "),a("b",{staticClass:"mb-3 block text-sm text-gray-400 mb-5"},[t._v("\n\t\t"+t._s(t.$t("We are unable to charge your usage. Please register new credit card or fund your account with sufficient amount and we'll give it another try!"))+"\n\t")]),t._v(" "),t._l(t.user.data.relationships.failedPayments.data,(function(e){return a("div",{key:e.data.id,staticClass:"flex items-center justify-between py-2 border-b dark:border-opacity-5 border-light border-dashed"},[a("div",{staticClass:"w-2/4 leading-none"},[a("b",{staticClass:"text-sm font-bold leading-none"},[t._v("\n\t\t\t\t"+t._s(e.data.attributes.note)+"\n\t\t\t")])]),t._v(" "),a("div",{staticClass:"text-left w-1/4"},[a("span",{staticClass:"text-sm font-bold text-gray-560 capitalize"},[t._v("\n\t\t\t\t"+t._s(t.$t(e.data.attributes.source))+"\n\t\t\t")])]),t._v(" "),a("div",{staticClass:"text-right w-1/4"},[a("span",{staticClass:"text-sm font-bold"},[t._v("\n\t\t\t\t"+t._s(e.data.attributes.created_at)+"\n\t\t\t")])]),t._v(" "),a("div",{staticClass:"text-right w-1/4"},[a("span",{staticClass:"text-sm font-bold text-red"},[t._v("\n\t\t\t\t"+t._s(e.data.attributes.amount)+"\n\t\t\t")])])])}))],2):t._e()}),[],!1,null,null,null).exports;function it(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function ot(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var lt={name:"UserUsageEstimates",components:{FormLabel:s.a},computed:function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?it(Object(a),!0).forEach((function(e){ot(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):it(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}({},Object(y.b)(["user"]))},ct=Object(d.a)(lt,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card shadow-card"},[a("FormLabel",{attrs:{icon:"bar-chart"}},[t._v("\n\t\t"+t._s(t.$t("Usage Estimates"))+"\n\t")]),t._v(" "),a("b",{staticClass:"text-3xl font-extrabold -mt-3 block mb-0.5"},[t._v("\n\t\t"+t._s(t.user.data.meta.usages.costEstimate)+"\n\t")]),t._v(" "),a("b",{staticClass:"mb-3 block text-sm text-gray-400 mb-5"},[t._v("\n\t\t"+t._s(t.user.data.relationships.subscription.data.attributes.updated_at)+" "+t._s(t.$t("till now"))+"\n\t")]),t._v(" "),a("div",t._l(t.user.data.meta.usages.featureEstimates,(function(e,r){return a("div",{key:r,staticClass:"flex items-center justify-between py-2 border-b dark:border-opacity-5 border-light border-dashed"},[a("div",{staticClass:"w-2/4 leading-none"},[a("b",{staticClass:"text-sm font-bold leading-none"},[t._v("\n\t\t\t\t\t"+t._s(t.$t(e.feature))+"\n\t\t\t\t")]),t._v(" "),a("small",{staticClass:"text-xs text-gray-500 pt-2 leading-none sm:block hidden"},[t._v("\n\t\t\t\t\t"+t._s(t.$t("feature_usage_desc_"+e.feature))+"\n\t\t\t\t")])]),t._v(" "),a("div",{staticClass:"text-left w-1/4"},[a("span",{staticClass:"text-sm font-bold text-gray-560"},[t._v("\n\t\t\t\t\t"+t._s(e.usage)+"\n\t\t\t\t")])]),t._v(" "),a("div",{staticClass:"text-right w-1/4"},[a("span",{staticClass:"text-sm font-bold text-theme"},[t._v("\n\t\t\t\t\t"+t._s(e.cost)+"\n\t\t\t\t")])])])})),0),t._v(" "),a("small",{staticClass:"mt-6 block font-bold"},[t._v("\n\t\t"+t._s(t.$t("Records are updated on daily bases."))+"\n\t")])],1)}),[],!1,null,null,null).exports,dt=a("A5+z"),ut=a("UD3w");function pt(t,e,a,r,n,s,i){try{var o=t[s](i),l=o.value}catch(t){return void a(t)}o.done?e(l):Promise.resolve(l).then(r,n)}function bt(t){return function(){var e=this,a=arguments;return new Promise((function(r,n){var s=t.apply(e,a);function i(t){pt(s,r,n,i,o,"next",t)}function o(t){pt(s,r,n,i,o,"throw",t)}i(void 0)}))}}function ft(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function mt(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var gt={name:"UserBillingAlerts",components:{ValidationObserver:dt.ValidationObserver,ValidationProvider:dt.ValidationProvider,AppInputText:ut.a,ButtonBase:n.a,Trash2Icon:A.rb,Edit2Icon:A.y,FormLabel:s.a},computed:function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?ft(Object(a),!0).forEach((function(e){mt(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ft(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}({},Object(y.b)(["user"])),data:function(){return{billingAlertAmount:void 0,isSendingBillingAlert:!1,showUpdateBillingAlertForm:!1}},methods:{updateBillingAlert:function(){var t=this;return bt(S.a.mark((function e(){return S.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$refs.updatebillingAlertForm.validate();case 2:if(e.sent){e.next=5;break}return e.abrupt("return");case 5:t.isSendingBillingAlert=!0,o.a.patch("/api/subscriptions/billing-alerts/".concat(t.user.data.relationships.alert.data.id),{amount:t.billingAlertAmount}).then((function(){t.$store.dispatch("getAppData"),t.showUpdateBillingAlertForm=!1,l.a.$emit("toaster",{type:"success",message:t.$t("Your billing alert was updated successfully")})})).catch((function(){l.a.$emit("toaster",{type:"danger",message:t.$t("popup_error.title")})})).finally((function(){t.isSendingBillingAlert=!1}));case 7:case"end":return e.stop()}}),e)})))()},setBillingAlert:function(){var t=this;return bt(S.a.mark((function e(){return S.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$refs.billingAlertForm.validate();case 2:if(e.sent){e.next=5;break}return e.abrupt("return");case 5:t.isSendingBillingAlert=!0,o.a.post("/api/subscriptions/billing-alerts",{amount:t.billingAlertAmount}).then((function(){t.$store.dispatch("getAppData"),l.a.$emit("toaster",{type:"success",message:t.$t("Your billing alert was set successfully")})})).catch((function(){l.a.$emit("toaster",{type:"danger",message:t.$t("popup_error.title")})})).finally((function(){t.isSendingBillingAlert=!1}));case 7:case"end":return e.stop()}}),e)})))()},deleteBillingAlert:function(){l.a.$emit("confirm:open",{title:this.$t("Are you sure you want to delete your alert?"),message:this.$t("You will no longer receive any notifications that your billing limit has been exceeded."),action:{id:this.user.data.relationships.alert.data.id,operation:"delete-billing-alert"}})}},created:function(){var t=this;l.a.$on("action:confirmed",(function(e){"delete-billing-alert"===e.operation&&o.a.delete("/api/subscriptions/billing-alerts/".concat(t.user.data.relationships.alert.data.id)).then((function(){t.$store.dispatch("getAppData"),t.showUpdateBillingAlertForm=!1,t.billingAlertAmount=void 0,l.a.$emit("toaster",{type:"success",message:t.$t("Your billing alert was deleted.")})})).catch((function(){return t.$isSomethingWrong()}))}))},destroyed:function(){l.a.$off("action:confirmed")}},vt=Object(d.a)(gt,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card shadow-card"},[a("FormLabel",{attrs:{icon:"bell"}},[t._v("\n\t\t"+t._s(t.$t("Billing Alert"))+"\n\t")]),t._v(" "),t.user.data.relationships.alert?a("div",[a("b",{staticClass:"text-3xl font-extrabold -mt-3 block mb-0.5 flex items-center"},[t._v("\n\t\t\t"+t._s(t.user.data.relationships.alert.data.attributes.formatted)+"\n\t\t\t"),t.showUpdateBillingAlertForm?t._e():a("edit2-icon",{staticClass:"vue-feather cursor-pointer ml-2 transform -translate-y-0.5",attrs:{size:"12"},on:{click:function(e){t.showUpdateBillingAlertForm=!t.showUpdateBillingAlertForm}}}),t._v(" "),t.showUpdateBillingAlertForm?a("trash2-icon",{staticClass:"vue-feather cursor-pointer ml-2 transform -translate-y-0.5",attrs:{size:"12"},on:{click:t.deleteBillingAlert}}):t._e()],1),t._v(" "),a("b",{staticClass:"block text-sm text-gray-400"},[t._v("\n\t\t\t"+t._s(t.$t("Alert will be triggered after you reach the value above."))+"\n\t\t")])]):t._e(),t._v(" "),t.showUpdateBillingAlertForm?a("ValidationObserver",{ref:"updatebillingAlertForm",staticClass:"mt-6",attrs:{tag:"form"},on:{submit:function(e){return e.preventDefault(),t.updateBillingAlert.apply(null,arguments)}},scopedSlots:t._u([{key:"default",fn:function(e){e.invalid;return[a("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Billing Alert",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.errors;return[a("AppInputText",{attrs:{description:t.$t("You will receive an email whenever your monthly balance reaches the specified amount above."),error:r[0],"is-last":!0}},[a("div",{staticClass:"sm:flex sm:space-x-4 sm:space-y-0 space-y-4"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.billingAlertAmount,expression:"billingAlertAmount"}],staticClass:"focus-border-theme input-dark",class:{"border-red":r[0]},attrs:{placeholder:t.$t("Alert Amount..."),type:"number",min:"1",max:"999999999"},domProps:{value:t.billingAlertAmount},on:{input:function(e){e.target.composing||(t.billingAlertAmount=e.target.value)}}}),t._v(" "),a("ButtonBase",{staticClass:"sm:w-auto w-full",attrs:{loadint:t.isSendingBillingAlert,disabled:t.isSendingBillingAlert,type:"submit","button-style":"theme"}},[t._v("\n\t\t\t\t\t\t"+t._s(t.$t("Update Alert"))+"\n\t\t\t\t\t")])],1)])]}}],null,!0)})]}}],null,!1,1047455523)}):t._e(),t._v(" "),t.user.data.relationships.alert?t._e():a("ValidationObserver",{ref:"billingAlertForm",staticClass:"mt-6",attrs:{tag:"form"},on:{submit:function(e){return e.preventDefault(),t.setBillingAlert.apply(null,arguments)}},scopedSlots:t._u([{key:"default",fn:function(e){e.invalid;return[a("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Billing Alert",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.errors;return[a("AppInputText",{attrs:{description:t.$t("You will receive an email whenever your monthly balance reaches the specified amount above."),error:r[0],"is-last":!0}},[a("div",{staticClass:"sm:flex sm:space-x-4 sm:space-y-0 space-y-4"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.billingAlertAmount,expression:"billingAlertAmount"}],staticClass:"focus-border-theme input-dark",class:{"border-red":r[0]},attrs:{placeholder:t.$t("Alert Amount..."),type:"number",min:"1",max:"999999999"},domProps:{value:t.billingAlertAmount},on:{input:function(e){e.target.composing||(t.billingAlertAmount=e.target.value)}}}),t._v(" "),a("ButtonBase",{staticClass:"sm:w-auto w-full",attrs:{loadint:t.isSendingBillingAlert,disabled:t.isSendingBillingAlert,type:"submit","button-style":"theme"}},[t._v("\n\t\t\t\t\t\t"+t._s(t.$t("Set Alert"))+"\n\t\t\t\t\t")])],1)])]}}],null,!0)})]}}],null,!1,2180297872)})],1)}),[],!1,null,null,null).exports,ht=a("qefO");function _t(t,e,a,r,n,s,i){try{var o=t[s](i),l=o.value}catch(t){return void a(t)}o.done?e(l):Promise.resolve(l).then(r,n)}function yt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function xt(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?yt(Object(a),!0).forEach((function(e){wt(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):yt(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function wt(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var Ct={name:"UserBalance",components:{ValidationObserver:dt.ValidationObserver,ValidationProvider:dt.ValidationProvider,AppInputText:ut.a,ButtonBase:n.a,FormLabel:s.a},computed:xt(xt({},Object(y.b)(["user"])),{},{hasPaymentMethod:function(){return this.user.data.relationships.creditCards&&this.user.data.relationships.creditCards.data.length>0}}),data:function(){return{chargeAmount:void 0}},methods:{makePayment:function(){var t,e=this;return(t=S.a.mark((function t(){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$refs.fundAccount.validate();case 2:if(t.sent){t.next=5;break}return t.abrupt("return");case 5:e.$store.dispatch("callSingleChargeProcess",e.chargeAmount);case 6:case"end":return t.stop()}}),t)})),function(){var e=this,a=arguments;return new Promise((function(r,n){var s=t.apply(e,a);function i(t){_t(s,r,n,i,o,"next",t)}function o(t){_t(s,r,n,i,o,"throw",t)}i(void 0)}))})()}}};function kt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function Ot(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var Pt={name:"Billing",components:{UserUpdatePaymentMethodsExternally:u,UserTransactionsForMeteredBilling:g,UserTransactionsForFixedBilling:h,UserFixedSubscriptionDetail:$,UserStoredPaymentMethods:X,UserEmptySubscription:Q,UserEditSubscription:et,UserFailedPayments:st,UserUsageEstimates:ct,UserBillingAlerts:vt,UserBalance:Object(d.a)(Ct,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.hasPaymentMethod?t._e():a("div",{staticClass:"card shadow-card"},[a("FormLabel",{attrs:{icon:"dollar"}},[t._v("\n\t\t"+t._s(t.$t("Balance"))+"\n\t")]),t._v(" "),a("b",{staticClass:"text-3xl font-extrabold -mt-3 block mb-0.5"},[t._v("\n\t\t"+t._s(t.user.data.relationships.balance.data.attributes.formatted)+"\n\t")]),t._v(" "),a("ValidationObserver",{ref:"fundAccount",staticClass:"mt-6",attrs:{tag:"form"},on:{submit:function(e){return e.preventDefault(),t.makePayment.apply(null,arguments)}},scopedSlots:t._u([{key:"default",fn:function(e){e.invalid;return[a("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Capacity",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.errors;return[a("AppInputText",{attrs:{description:t.$t("The amount will be increased as soon as we register your charge from payment gateway."),error:r[0],"is-last":!0}},[a("div",{staticClass:"sm:flex sm:space-x-4 sm:space-y-0 space-y-4"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.chargeAmount,expression:"chargeAmount"}],staticClass:"focus-border-theme input-dark",class:{"border-red":r[0]},attrs:{placeholder:t.$t("Fund Your Account Balance..."),type:"number",min:"1",max:"999999999"},domProps:{value:t.chargeAmount},on:{input:function(e){e.target.composing||(t.chargeAmount=e.target.value)}}}),t._v(" "),a("ButtonBase",{staticClass:"sm:w-auto w-full",attrs:{type:"submit","button-style":"theme"}},[t._v("\n\t\t\t\t\t\t"+t._s(t.$t("Make a Payment"))+"\n\t\t\t\t\t")])],1)])]}}],null,!0)})]}}],null,!1,2421684637)})],1)}),[],!1,null,null,null).exports,PageTab:ht.a},computed:function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?kt(Object(a),!0).forEach((function(e){Ot(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):kt(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}({},Object(y.b)(["config"]))},$t=Object(d.a)(Pt,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("PageTab",["metered"===t.config.subscriptionType?a("div",[a("UserFailedPayments"),t._v(" "),a("UserBalance"),t._v(" "),a("UserUsageEstimates"),t._v(" "),a("UserBillingAlerts"),t._v(" "),a("UserStoredPaymentMethods"),t._v(" "),a("UserTransactionsForMeteredBilling")],1):t._e(),t._v(" "),"fixed"===t.config.subscriptionType?a("div",[a("UserEmptySubscription"),t._v(" "),a("UserFixedSubscriptionDetail"),t._v(" "),a("UserStoredPaymentMethods"),t._v(" "),a("UserUpdatePaymentMethodsExternally"),t._v(" "),a("UserEditSubscription"),t._v(" "),a("UserTransactionsForFixedBilling")],1):t._e()])}),[],!1,null,null,null);e.default=$t.exports},"x7z+":function(t,e,a){(t.exports=a("I1BE")(!1)).push([t.i,".info-box[data-v-27ea1904]{padding:20px;border-radius:10px;margin-bottom:32px;background:#f4f5f6;text-align:left}.info-box.error[data-v-27ea1904]{background:rgba(253,57,122,.1)}.info-box.error a[data-v-27ea1904],.info-box.error p[data-v-27ea1904]{color:#fd397a}.info-box.error a[data-v-27ea1904]{text-decoration:underline}.info-box p[data-v-27ea1904]{line-height:1.6;word-break:break-word;font-weight:600}.info-box p[data-v-27ea1904],.info-box p[data-v-27ea1904] a{font-size:15px}.info-box p[data-v-27ea1904] b{font-size:15px;font-weight:700}.info-box a[data-v-27ea1904],.info-box b[data-v-27ea1904]{font-weight:700}.info-box a[data-v-27ea1904]{font-size:.9375em;line-height:1.6}.info-box ul[data-v-27ea1904]{margin-top:15px}.info-box ul[data-v-27ea1904],.info-box ul li[data-v-27ea1904],.info-box ul li a[data-v-27ea1904]{display:block}@media only screen and (max-width:690px){.info-box[data-v-27ea1904]{padding:15px}}.dark .info-box[data-v-27ea1904]{background:#1e2024}.dark .info-box.error[data-v-27ea1904]{background:rgba(253,57,122,.1)}.dark .info-box.error a[data-v-27ea1904],.dark .info-box.error p[data-v-27ea1904]{color:#fd397a}.dark .info-box.error a[data-v-27ea1904]{text-decoration:underline}.dark .info-box p[data-v-27ea1904],.dark .info-box ul li[data-v-27ea1904]{color:#bec6cf}",""])}}]); |