From 8123dfdeb9201780a0da266d67207f83ce7b97b4 Mon Sep 17 00:00:00 2001 From: blair2004 Date: Tue, 10 Jan 2023 22:24:40 +0100 Subject: [PATCH] Update --- public/js/app.min.js | 2 +- public/js/auth.min.js | 2 +- public/js/bootstrap.min/bootstrap.js | 2 +- public/js/cashier.min.js | 2 +- public/js/dashboard.min.js | 2 +- public/js/popups.min.js | 2 +- public/js/pos-init.min.js | 2 +- public/js/pos.min.js | 2 +- public/js/setup.min.js | 2 +- public/js/update.min.js | 2 +- public/mix-manifest.json | 20 ++++++++++---------- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/public/js/app.min.js b/public/js/app.min.js index ec8fbee21..cf663e145 100644 --- a/public/js/app.min.js +++ b/public/js/app.min.js @@ -1 +1 @@ -(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[219,198],{4297:(e,t,n)=>{"use strict";var s=n(538),i=n(7975),r=(n(824),n(7166)),a=n.n(r),o=n(5675),l=n(6781),c=window.nsState,d=window.nsScreen,u=window.ns.cssFiles,f=window.nsExtraComponents,p={name:"_blank",specs:["fullscreen=yes","titlebar=yes","scrollbars=yes"],styles:["/css/".concat(u["app.css"]),"/css/".concat(u["light.css"]),"/css/".concat(u["grid.css"]),"/css/".concat(u["typography.css"])]};window.nsHotPress=new l.e,s.default.use(o.Z,p);var h=s.default.component("vue-apex-charts",a()),m=Object.assign(Object.assign({nsModules:function(){return n.e(82).then(n.bind(n,1082))},nsRewardsSystem:function(){return n.e(896).then(n.bind(n,2896))},nsCreateCoupons:function(){return n.e(225).then(n.bind(n,3225))},nsManageProducts:function(){return n.e(852).then(n.bind(n,9852))},nsSettings:function(){return n.e(677).then(n.bind(n,5724))},nsReset:function(){return n.e(800).then(n.bind(n,800))},nsPermissions:function(){return n.e(418).then(n.bind(n,2418))},nsProcurement:function(){return n.e(95).then(n.bind(n,5095))},nsProcurementInvoice:function(){return n.e(531).then(n.bind(n,2531))},nsMedia:function(){return Promise.resolve().then(n.bind(n,4255))},nsDashboardCards:function(){return n.e(251).then(n.bind(n,251))},nsCashierDashboard:function(){return n.e(805).then(n.bind(n,805))},nsBestCustomers:function(){return n.e(336).then(n.bind(n,336))},nsBestCashiers:function(){return n.e(226).then(n.bind(n,2226))},nsOrdersSummary:function(){return n.e(880).then(n.bind(n,2880))},nsOrdersChart:function(){return n.e(417).then(n.bind(n,417))},nsNotifications:function(){return n.e(724).then(n.bind(n,3724))},nsSaleReport:function(){return n.e(978).then(n.bind(n,978))},nsSoldStockReport:function(){return n.e(15).then(n.bind(n,9015))},nsProfitReport:function(){return n.e(523).then(n.bind(n,523))},nsCashFlowReport:function(){return n.e(317).then(n.bind(n,6317))},nsYearlyReport:function(){return n.e(232).then(n.bind(n,5232))},nsPaymentTypesReport:function(){return n.e(759).then(n.bind(n,8759))},nsBestProductsReport:function(){return n.e(441).then(n.bind(n,6441))},nsLowStockReport:function(){return n.e(348).then(n.bind(n,6348))},nsStockAdjustment:function(){return n.e(163).then(n.bind(n,163))},nsPromptPopup:function(){return n.e(89).then(n.bind(n,9089))},nsAlertPopup:function(){return n.e(110).then(n.bind(n,9110))},nsConfirmPopup:function(){return Promise.resolve().then(n.bind(n,3601))},nsPOSLoadingPopup:function(){return n.e(4).then(n.bind(n,2004))},nsOrderInvoice:function(){return n.e(185).then(n.bind(n,2407))},VueApexCharts:h},i),f);for(var v in m)void 0!==m[v].name&&"VueComponent"!==m[v].name&&s.default.component(m[v].name,m[v]);var b=new s.default({el:"#dashboard-aside",data:{sidebar:"visible"},components:m,mounted:function(){var e=this;c.behaviorState.subscribe((function(t){var n=t.object;e.sidebar=n.sidebar}))}});window.nsDashboardAside=b,window.nsDashboardOverlay=new s.default({el:"#dashboard-overlay",data:{sidebar:null},components:m,mounted:function(){var e=this;c.behaviorState.subscribe((function(t){var n=t.object;e.sidebar=n.sidebar}))},methods:{closeMenu:function(){c.setState({sidebar:"hidden"===this.sidebar?"visible":"hidden"})}}}),window.nsDashboardHeader=new s.default({el:"#dashboard-header",data:{menuToggled:!1,sidebar:"visible"},components:m,methods:{toggleMenu:function(){this.menuToggled=!this.menuToggled},toggleSideMenu:function(){["lg","xl"].includes(d.breakpoint),c.setState({sidebar:"hidden"===this.sidebar?"visible":"hidden"})}},mounted:function(){var e=this;c.behaviorState.subscribe((function(t){var n=t.object;e.sidebar=n.sidebar}))}}),window.nsComponents=Object.assign(m,i),window.nsDashboardContent=new s.default({el:"#dashboard-content",components:m})},9671:(e,t,n)=>{"use strict";n.d(t,{l:()=>Y,kq:()=>Z,ih:()=>z,kX:()=>H});var s=n(6486),i=n(9669),r=n(6300),a=n(8345),o=n(9624),l=n(9248),c=n(230);function d(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=Z.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:s}),new c.y((function(r){n._client[e](t,s,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,r.next(e.data),r.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;r.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&d(t.prototype,n),s&&d(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=n(3);function p(e,t){for(var n=0;n=1e3){for(var n,s=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=s?e/Math.pow(1e3,s):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][s]}return t})),S=n(1356),E=n(9698);function P(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&q(t.prototype,n),s&&q(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()),N=new b({sidebar:["xs","sm","md"].includes(I.breakpoint)?"hidden":"visible"});z.defineClient(i),window.nsEvent=Y,window.nsHttpClient=z,window.nsSnackBar=H,window.nsCurrency=S.W,window.nsTruncate=E.b,window.nsRawCurrency=S.f,window.nsAbbreviate=$,window.nsState=N,window.nsUrl=L,window.nsScreen=I,window.ChartJS=r,window.EventEmitter=h,window.Popup=x.G,window.RxJS=y,window.FormValidation=k.Z,window.nsCrudHandler=R},7975:(e,t,n)=>{"use strict";n.r(t),n.d(t,{nsAvatar:()=>Q,nsButton:()=>o,nsCheckbox:()=>p,nsCkeditor:()=>O,nsCloseButton:()=>j,nsCrud:()=>U,nsCrudForm:()=>g,nsDate:()=>w,nsDateRangePicker:()=>K.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>_.P,nsIconButton:()=>$,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>C,nsMenu:()=>r,nsMultiselect:()=>x,nsNotice:()=>J.Z,nsNumpad:()=>W.Z,nsPaginate:()=>te.Z,nsSearch:()=>se,nsSelect:()=>u,nsSelectAudio:()=>f,nsSpinner:()=>v,nsSubmenu:()=>a,nsSwitch:()=>M.Z,nsTableRow:()=>m,nsTabs:()=>T,nsTabsItem:()=>F,nsTextarea:()=>y});var s=n(538),i=n(9671),r=s.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n
\n \n \n \n {{ label }}\n \n {{ notification }}\n \n \n
\n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,i.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&i.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,n){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),a=s.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
\n
  • \n \n \n \n
  • \n
    \n '}),o=s.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=s.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=s.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),d=n(7389),u=s.default.component("ns-select",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},mounted:function(){},methods:{__:d.__},template:'\n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),f=s.default.component("ns-select-audio",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__:d.__,playSelectedSound:function(){this.field.value.length>0&&new Audio(this.field.value).play()}},template:'\n
    \n \n
    \n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),p=s.default.component("ns-checkbox",{data:function(){return{}},props:["checked","field","label"],template:'\n
    \n
    \n \n
    \n {{ label }}\n {{ field.label }}\n
    \n ',computed:{isChecked:function(){return this.field?this.field.value:this.checked}},methods:{toggleIt:function(){void 0!==this.field&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}}),h=n(2242),m=s.default.component("ns-table-row",{props:["options","row","columns","prependOptions","showOptions"],data:function(){return{optionsToggled:!1}},mounted:function(){},methods:{__:d.__,sanitizeHTML:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.getElementsByTagName("script"),s=n.length;s--;)n[s].parentNode.removeChild(n[s]);return t.innerHTML},getElementOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu:function(e){var t=this;if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout((function(){var e=t.$el.querySelectorAll(".relative > .absolute")[0],n=t.$el.querySelectorAll(".relative")[0],s=t.getElementOffset(n);e.style.top=s.top+"px",e.style.left=s.left+"px",n.classList.remove("relative"),n.classList.add("dropdown-holder")}),100);else{var n=this.$el.querySelectorAll(".dropdown-holder")[0];n.classList.remove("dropdown-holder"),n.classList.add("relative")}},handleChanged:function(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync:function(e){var t=this;e.confirm?confirm(e.confirm.message)&&i.ih[e.type.toLowerCase()](e.url).subscribe((function(e){i.kX.success(e.message).subscribe(),t.$emit("reload",t.row)}),(function(e){t.toggleMenu(),i.kX.error(e.message).subscribe()})):(i.l.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup:function(e,t){var n=window.nsExtraComponents[e.component];if(e.component)return n?new Promise((function(s,i){h.G.show(n,{resolve:s,reject:i,row:t,action:e})})):i.kX.error((0,d.__)('Unable to load the component "'.concat(e.component,'". Make sure the component is registered to "nsExtraComponents".'))).subscribe();this.triggerAsync(e)}},template:'\n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n '}),v=s.default.component("ns-spinner",{data:function(){return{}},mounted:function(){},computed:{validatedSize:function(){return this.size||24},validatedBorder:function(){return this.border||8},validatedAnimation:function(){return this.animation||"fast"}},props:["color","size","border"],template:"\n
    \n
    \n
    \n "}),b=n(7266),g=s.default.component("ns-crud-form",{data:function(){return{form:{},globallyChecked:!1,formValidation:new b.Z,rows:[]}},mounted:function(){this.loadForm()},props:["src","create-url","field-class","return-url","submit-url","submit-method","disable-tabs"],computed:{activeTabFields:function(){for(var e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]}},methods:{__:d.__,toggle:function(e){for(var t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},handleShowOptions:function(e){this.rows.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},submit:function(){var e=this;return this.formValidation.validateForm(this.form).length>0?i.kX.error(this.$slots["error-invalid"]?this.$slots["error-invalid"][0].text:"No error message provided for having an invalid form.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():(this.formValidation.disableForm(this.form),void 0===this.submitUrl?i.kX.error(this.$slots["error-no-submit-url"]?this.$slots["error-no-submit-url"][0].text:"No error message provided for not having a valid submit url.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():void i.ih[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,this.formValidation.extractForm(this.form)).subscribe((function(t){if("success"===t.status){if(e.submitMethod&&"post"===e.submitMethod.toLowerCase()&&!1!==e.returnUrl)return document.location=t.data.editUrl||e.returnUrl;i.kX.info(t.message,(0,d.__)("Okay"),{duration:3e3}).subscribe(),e.$emit("save",t)}e.formValidation.enableForm(e.form)}),(function(t){i.kX.error(t.message,void 0,{duration:5e3}).subscribe(),void 0!==t.data&&e.formValidation.triggerError(e.form,t.data),e.formValidation.enableForm(e.form)})))},handleGlobalChange:function(e){this.globallyChecked=e,this.rows.forEach((function(t){return t.$checked=e}))},loadForm:function(){var e=this;i.ih.get("".concat(this.src)).subscribe({next:function(t){e.form=e.parseForm(t.form),i.kq.doAction("ns-crud-form-loaded",e),e.$emit("updated",e.form)},error:function(e){i.kX.error(e.message,"OKAY",{duration:0}).subscribe()}})},parseForm:function(e){e.main.value=void 0===e.main.value?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];var t=0;for(var n in e.tabs)0===t&&(e.tabs[n].active=!0),e.tabs[n].active=void 0!==e.tabs[n].active&&e.tabs[n].active,e.tabs[n].fields=this.formValidation.createFields(e.tabs[n].fields),t++;return e}},template:'\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n
    {{ tab.label }}
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n '}),y=s.default.component("ns-textarea",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),_=n(8737),x=s.default.component("ns-multiselect",{data:function(){return{showPanel:!1,search:""}},props:["field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=void 0!==t.selected&&t.selected,e.field.value&&e.field.value.includes(t.value)&&(t.selected=!0),t}))}},methods:{__:d.__,addOption:function(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout((function(){}),100))},removeOption:function(e,t){var n=this;if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout((function(){n.search=""}),100),!1}},mounted:function(){var e=this;this.field.value&&this.field.value.reverse().forEach((function(t){var n=e.field.options.filter((function(e){return e.value===t}));n.length>=0&&e.addOption(n[0])}))},template:'\n
    \n \n
    \n
    \n
    \n
    \n
    \n {{ option.label }}\n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n
    \n '}),w=s.default.component("ns-date",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),k=n(4255),C=s.default.component("ns-media-input",{template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n ',computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},data:function(){return{}},props:["placeholder","leading","type","field"],mounted:function(){},methods:{toggleMedia:function(){var e=this;new Promise((function(t,n){h.G.show(k.default,Object.assign({resolve:t,reject:n},e.field.data||{}))})).then((function(t){"use-selected"===t.event&&(e.field.data&&"url"!==e.field.data.type?e.field.data&&"model"!==e.field.data.type||(e.field.value=t.value[0]):e.field.value=t.value[0].sizes.original,e.$forceUpdate())}))}}}),j=s.default.component("ns-close-button",{template:'\n \n ',methods:{clicked:function(e){this.$emit("click",e)}}}),$=s.default.component("ns-icon-button",{template:'\n \n ',props:["className","buttonClass","type"],methods:{clicked:function(e){this.$emit("click",e)}}}),S=n(1272),E=n.n(S),P=n(5234),D=n.n(P),O=s.default.component("ns-ckeditor",{data:function(){return{editor:D()}},components:{ckeditor:E().component},mounted:function(){},methods:{__:d.__},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),T=s.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),F=s.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),M=n(9408),A=n(2744),q=n(7757),V=n.n(q),Y=n(3601),z=n(8603),H=n(6386);const L={data:function(){return{fields:[],validation:new b.Z}},methods:{__:d.__,popupCloser:z.Z,popupResolver:H.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var R=n(1900);const Z=(0,R.Z)(L,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[n("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[n("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),n("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return n("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),n("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[n("div",[n("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),n("div",[n("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var I=function(e,t,n,s){return new(n||(n=Promise))((function(i,r){function a(e){try{l(s.next(e))}catch(e){r(e)}}function o(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((s=s.apply(e,t||[])).next())}))};const N={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,d.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:d.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),i.kX.success((0,d.__)("The document has been generated.")).subscribe()}),(function(e){i.kX.error(e.message||(0,d.__)("Unexpected error occured.")).subscribe()}))},clearSelectedEntries:function(){var e=this;h.G.show(Y.default,{title:(0,d.__)("Clear Selected Entries ?"),message:(0,d.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var n=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(n,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(n){n.$checked=e,t.refreshRow(n)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){i.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,d.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){i.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){i.kX.error(e.message).subscribe()}}):void 0:i.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,d.__)("No selection has been made.")).subscribe():i.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,d.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return I(this,void 0,void 0,V().mark((function e(){var t,n=this;return V().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(Z),e.next=4,new Promise((function(e,t){h.G.show(Z,{resolve:e,reject:t,queryFilters:n.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,i.kX.error(t.message).subscribe()}))}}};const U=(0,R.Z)(N,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?n("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[n("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?n("div",{staticClass:"px-2 flex items-center justify-center"},[n("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[n("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),n("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[n("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?n("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[n("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2 flex items-center justify-center"},[n("button",{staticClass:"rounded-full\n text-sm\n h-10\n px-3\n outline-none\n border\n ns-crud-button\n ",on:{click:function(t){return e.refresh()}}},[n("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?n("div",{staticClass:"px-2 flex items-center"},[n("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none ",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():n("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?n("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():n("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?n("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),n("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[n("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[n("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?n("table",{staticClass:"table ns-table w-full"},[n("thead",[n("tr",[n("th",{staticClass:"text-center px-2 border w-16 py-2"},[n("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,s){return n("th",{key:s,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(s)}}},[n("div",{staticClass:"w-full flex justify-between items-center"},[n("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),n("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?n("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?n("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),n("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,s){return n("ns-table-row",{key:s,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():n("tr",[n("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?n("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?n:n[0]}}},[n("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,s){return n("option",{key:s,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),n("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),n("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var W=n(4864),B=n(1726),X=n(7259);const G=s.default.extend({methods:{__:d.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,B.createAvatar)(X,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const Q=(0,R.Z)(G,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[n("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),n("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?n("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?n("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var K=n(4806),J=n(1828),ee=n(1544),te=n(3506);const ne={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:d.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,n,s;e.searchText.length>0&&i.ih[e.method||"post"](e.url,(t={},n=e.searchArgument||"search",s=e.searchText,n in t?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,t)).subscribe({next:function(t){e.results=t},error:function(e){i.kX.error(e.message||(0,d.__)("An unexpected error occured.")).subscribe()}})}),1e3)}},mounted:function(){}};const se=(0,R.Z)(ne,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-search"},[n("div",{staticClass:"input-group info border-2"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),n("div",{staticClass:"relative"},[n("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?n("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,s){return n("li",{key:s,staticClass:"border-b p-2 cursor-pointer",on:{click:function(n){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},8737:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var s=n(538),i=n(4806),r=n(2744),a=n(9408),o=s.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:i.Z,nsDateTimePicker:r.Z,nsSwitch:a.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\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 '})},1356:(e,t,n)=>{"use strict";n.d(t,{W:()=>c,f:()=>d});var s=n(2077),i=n.n(s),r=n(538),a=n(6740),o=n.n(a),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=r.default.filter("currency",(function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===s){var r={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=o()(e,r).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),d=function(e){var t="0.".concat(l);return parseFloat(i()(e).format(t))}},9698:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var s=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,n)=>{"use strict";function s(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var s=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&s.push(i),e.tabs[n].errors=s.flat(),t.push(s.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var s=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===s.length&&e.tabs[s[0]].fields.forEach((function(e){e.name===s[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var s in t.errors)n(s)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var s in t.errors)n(s)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(s,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){!0===n[t.identifier]&&e.errors.splice(s,1)}))}return e}}],n&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,n)=>{"use strict";n.d(t,{__:()=>s,c:()=>i});var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},6781:(e,t,n)=>{"use strict";function s(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);nc});var c=function(){function e(){var t=this;a(this,e),this.listeners=new Object,document.addEventListener("keydown",(function(e){return t.processEvent(e)}))}return l(e,[{key:"processEvent",value:function(e){var t=this;for(var n in this.listeners){var s=this.listeners[n].getConfig();if(s.hidden.length>0)if(s.hidden.filter((function(e){return e instanceof HTMLElement==!1&&null===document.querySelector(e)})).length!==s.hidden.length)continue;if(s.visible.length>0)if(!(s.visible.filter((function(e){return e instanceof HTMLElement==!0||null!==document.querySelector(e)})).length===s.visible.length))continue;s.callbacks.forEach((function(e){"string"==typeof e.action?t.processSingleAction({action:e.action.trim(),callback:e.callback}):"object"===r(e.action)&&null!==e.action&&e.action.length>0&&e.action.forEach((function(n){t.processSingleAction({action:n.toString().trim(),callback:e.callback})}))}))}}},{key:"processSingleAction",value:function(e){var t=e.action,n=e.callback,s=t.split("+"),i={ctrlKey:!1,altKey:!1,shiftKey:!1};s.forEach((function(e){switch(e){case"ctrl":i.ctrlKey=!0;break;case"alt":i.altKey=!0;break;case"shift":i.shiftKey=!0}}));var r=s.filter((function(e){return!["ctrl","alt","shift"].includes(e)}));this.executeCallback({event,combinableKeys:i,callback:n,key:r[0]})}},{key:"executeCallback",value:function(e){var t=e.event,n=e.callback,s=e.combinableKeys,i=e.key;if(void 0!==t.key&&t.key.toLowerCase()===i.toLowerCase()){var r=!0;for(var a in s)t[a]!==s[a]&&(r=!1);r&&n(t,i)}}},{key:"create",value:function(e){return this.listeners[e]=new d}},{key:"destroy",value:function(e){delete this.listeners[e]}}]),e}(),d=function(){function e(){a(this,e),this.visible=[],this.hidden=[],this.callbacks=[]}return l(e,[{key:"whenVisible",value:function(e){var t;"object"===r(e)?(t=this.visible).push.apply(t,s(e)):this.visible.push(e);return this}},{key:"clearVisible",value:function(){return this.visible=[],this}},{key:"whenNotVisible",value:function(e){var t;e.length>0?(t=this.hidden).push.apply(t,s(e)):this.hidden.push(e);return this}},{key:"clearHidden",value:function(){return this.hidden=[],this}},{key:"whenPressed",value:function(e,t){this.callbacks.push({action:e,callback:t})}},{key:"clearCallbacks",value:function(){return this.callbacks=[],this}},{key:"getConfig",value:function(){return{callbacks:this.callbacks,hidden:this.hidden,visible:this.visible}}}]),e}()},8603:(e,t,n)=>{"use strict";function s(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>s})},6386:(e,t,n)=>{"use strict";function s(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>s})},2242:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var s=n(7757),i=n.n(s),r=n(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new r.x}var t,n,s;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,s,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,i().mark((function a(){var o,l,c,d=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){d.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=r,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],s=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(s);return i.open(t,n),i}}],n&&o(t.prototype,n),s&&o(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var s=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return s.Observable.create((function(s){var r=n.__createSnack({message:e,label:t,type:i.type}),a=r.buttonNode,o=(r.textNode,r.snackWrapper,r.sampleSnack);a.addEventListener("click",(function(e){s.onNext(a),s.onCompleted(),o.remove()})),n.__startTimer(i.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,s=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){s()})),s()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,s=e.type,i=void 0===s?"info":s,r=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),d="",u="";switch(i){case"info":d="",u="info";break;case"error":d="",u="error";break;case"success":d="",u="success"}return o.textContent=t,o.setAttribute("class","pr-2"),n&&(l.setAttribute("class","ns-button default"),c.textContent=n,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(d)),l.appendChild(c)),a.appendChild(o),a.appendChild(l),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(u)),r.appendChild(a),null===document.getElementById("snack-wrapper")&&(r.setAttribute("id","snack-wrapper"),r.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(r)),{snackWrapper:r,sampleSnack:a,buttonsWrapper:l,buttonNode:c,textNode:o}}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},824:(e,t,n)=>{"use strict";var s=n(381),i=n.n(s);ns.date.moment=i()(ns.date.current),ns.date.interval=setInterval((function(){ns.date.moment.add(1,"seconds"),ns.date.current=i()(ns.date.current).add(1,"seconds").format("YYYY-MM-DD HH:mm:ss")}),1e3),ns.date.getNowString=function(){var e=Date.parse((new Date).toLocaleString("en-US",{timeZone:ns.date.timeZone}));return i()(e).format("YYYY-MM-DD HH:mm:ss")},ns.date.getMoment=function(){var e=Date.parse((new Date).toLocaleString("en-US",{timeZone:ns.date.timeZone}));return i()(e)}},6700:(e,t,n)=>{var s={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=r(e);return n(t)}function r(e){if(!n.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}i.keys=function(){return Object.keys(s)},i.resolve=r,e.exports=i,i.id=6700},4806:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var s=n(538),i=n(381),r=n.n(i),a=n(7144),o=n.n(a),l=(n(9095),n(7389));const c=s.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:o()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:r()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:r()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?r()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const d=(0,n(1900).Z)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?n("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[n("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),n("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[n("i",{staticClass:"las la-times"})]),e._v(" "),n("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[n("div",{staticClass:"flex justify-between items-center w-full py-2"},[n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},2744:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:i(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return i()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?i()():i()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?i()():i()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:n(7389).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker mb-2"},[e.field?n("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),n("div",{staticClass:"ns-button"},[n("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?n("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?n("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?n("span",{staticClass:"mx-1 text-sm"},[null!==e.date?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?n("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?n("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?n("div",{staticClass:"relative z-10 h-0 w-0"},[n("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[n("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[n("i",{staticClass:"las la-minus"})]),e._v(" "),n("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[n("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,s){return n("div",{key:s,staticClass:"h-8 flex justify-center items-center text-sm"},[[n("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),n("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[n("div",{staticClass:"-mx-1 flex justify-between"},[n("div",{staticClass:"px-1"},[n("div",{staticClass:"-mx-1 flex"},[e.field?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[n("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[n("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),n("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},1544:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?i()():i()(this.date),this.build()},methods:{__:n(7389).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker"},[n("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),n("span",{staticClass:"mx-1 text-sm"},[n("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?n("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?n("div",{staticClass:"relative h-0 w-0 -mb-2"},[n("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),n("div")])]):e._e()])}),[],!1,null,null,null).exports},1828:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[n("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),n("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},4864:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var s=n(7389);function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,n){e.inputValue({value:n})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var n=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",n)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,s){return n("div",{key:s,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(n){return e.inputValue(t)}}},[void 0!==t.value?n("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?n("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3506:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},9408:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"mb-2 ns-switch"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,s){return n("button",{key:s,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(n){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},4255:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var s=n(7757),i=n.n(s),r=n(9671),a=n(8603),o=n(7389),l=n(3601);function c(e,t,n,s,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(s,i)}const d={name:"ns-media",props:["popup"],components:{VueUpload:n(2948)},data:function(){return{pages:[{label:(0,o.__)("Upload"),name:"upload",selected:!1},{label:(0,o.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return r.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:a.Z,__:o.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,o.__)("Confirm Your Action"),message:(0,o.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){r.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=i().mark((function e(){var n,s,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),s=i().mark((function e(t){var s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n[t],e.prev=1,s.progress=1,e.next=5,new Promise((function(e,t){var n=new FormData;n.append("file",s.file),r.ih.post("/api/nexopos/v4/medias",n,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){s.uploaded=!0,s.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),s.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),a=0;case 3:if(!(a0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,r.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(n,s){s!==t.response.data.indexOf(e)&&(n.selected=!1)})),e.selected=!e.selected}}};const u=(0,n(1900).Z)(d,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[n("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[n("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),n("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,s){return n("li",{key:s,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(n){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?n("div",{staticClass:"content w-full overflow-hidden flex"},[n("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[n("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),n("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),n("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[n("ul",e._l(e.files,(function(t,s){return n("li",{key:s,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[n("span",[e._v(e._s(t.file.name))]),e._v(" "),n("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?n("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?n("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[n("div"),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),n("div",{staticClass:"flex flex-auto overflow-hidden"},[n("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[n("div",{staticClass:"flex flex-auto"},[n("div",{staticClass:"p-2 overflow-x-auto"},[n("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,s){return n("div",{key:s},[n("div",{staticClass:"p-2"},[n("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(n){return e.selectResource(t)}}},[n("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?n("div",{staticClass:"flex flex-auto items-center justify-center"},[n("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),n("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0 ",attrs:{id:"preview"}},[n("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?n("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?n("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),n("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),n("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),n("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[n("div",{staticClass:"flex -mx-2 flex-shrink-0"},[n("div",{staticClass:"px-2 flex-shrink-0 flex"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[n("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[n("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?n("div",{staticClass:"ns-button error"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[n("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),n("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[n("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),n("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),n("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?n("div",{staticClass:"px-2"},[n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},3601:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var s=n(7389),i=n(6386),r=n(8603);const a={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:s.__,popupResolver:i.Z,popupCloser:r.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[n("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[n("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),n("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),n("div",{staticClass:"action-buttons flex border-t"},[n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),n("hr",{staticClass:"border-r h-16"}),e._v(" "),n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=4297,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[219,198],{4297:(e,t,n)=>{"use strict";var s=n(538),i=n(7975),r=(n(824),n(7166)),a=n.n(r),o=n(5675),l=n(6781),c=window.nsState,d=window.nsScreen,u=window.ns.cssFiles,f=window.nsExtraComponents,p={name:"_blank",specs:["fullscreen=yes","titlebar=yes","scrollbars=yes"],styles:["/css/".concat(u["app.css"]),"/css/".concat(u["light.css"]),"/css/".concat(u["grid.css"]),"/css/".concat(u["typography.css"])]};window.nsHotPress=new l.e,s.default.use(o.Z,p);var h=s.default.component("vue-apex-charts",a()),m=Object.assign(Object.assign({nsModules:function(){return n.e(82).then(n.bind(n,1082))},nsRewardsSystem:function(){return n.e(896).then(n.bind(n,2896))},nsCreateCoupons:function(){return n.e(225).then(n.bind(n,3225))},nsManageProducts:function(){return n.e(852).then(n.bind(n,9852))},nsSettings:function(){return n.e(677).then(n.bind(n,5724))},nsReset:function(){return n.e(800).then(n.bind(n,800))},nsPermissions:function(){return n.e(418).then(n.bind(n,2418))},nsProcurement:function(){return n.e(95).then(n.bind(n,5095))},nsProcurementInvoice:function(){return n.e(531).then(n.bind(n,2531))},nsMedia:function(){return Promise.resolve().then(n.bind(n,4255))},nsDashboardCards:function(){return n.e(251).then(n.bind(n,251))},nsCashierDashboard:function(){return n.e(805).then(n.bind(n,805))},nsBestCustomers:function(){return n.e(336).then(n.bind(n,336))},nsBestCashiers:function(){return n.e(226).then(n.bind(n,2226))},nsOrdersSummary:function(){return n.e(880).then(n.bind(n,2880))},nsOrdersChart:function(){return n.e(417).then(n.bind(n,417))},nsNotifications:function(){return n.e(724).then(n.bind(n,3724))},nsSaleReport:function(){return n.e(978).then(n.bind(n,978))},nsSoldStockReport:function(){return n.e(15).then(n.bind(n,9015))},nsProfitReport:function(){return n.e(523).then(n.bind(n,523))},nsCashFlowReport:function(){return n.e(317).then(n.bind(n,6317))},nsYearlyReport:function(){return n.e(232).then(n.bind(n,5232))},nsPaymentTypesReport:function(){return n.e(759).then(n.bind(n,8759))},nsBestProductsReport:function(){return n.e(441).then(n.bind(n,6441))},nsLowStockReport:function(){return n.e(348).then(n.bind(n,6348))},nsStockAdjustment:function(){return n.e(163).then(n.bind(n,163))},nsPromptPopup:function(){return n.e(89).then(n.bind(n,9089))},nsAlertPopup:function(){return n.e(110).then(n.bind(n,9110))},nsConfirmPopup:function(){return Promise.resolve().then(n.bind(n,3601))},nsPOSLoadingPopup:function(){return n.e(4).then(n.bind(n,2004))},nsOrderInvoice:function(){return n.e(185).then(n.bind(n,2407))},VueApexCharts:h},i),f);for(var v in m)void 0!==m[v].name&&"VueComponent"!==m[v].name&&s.default.component(m[v].name,m[v]);var b=new s.default({el:"#dashboard-aside",data:{sidebar:"visible"},components:m,mounted:function(){var e=this;c.behaviorState.subscribe((function(t){var n=t.object;e.sidebar=n.sidebar}))}});window.nsDashboardAside=b,window.nsDashboardOverlay=new s.default({el:"#dashboard-overlay",data:{sidebar:null},components:m,mounted:function(){var e=this;c.behaviorState.subscribe((function(t){var n=t.object;e.sidebar=n.sidebar}))},methods:{closeMenu:function(){c.setState({sidebar:"hidden"===this.sidebar?"visible":"hidden"})}}}),window.nsDashboardHeader=new s.default({el:"#dashboard-header",data:{menuToggled:!1,sidebar:"visible"},components:m,methods:{toggleMenu:function(){this.menuToggled=!this.menuToggled},toggleSideMenu:function(){["lg","xl"].includes(d.breakpoint),c.setState({sidebar:"hidden"===this.sidebar?"visible":"hidden"})}},mounted:function(){var e=this;c.behaviorState.subscribe((function(t){var n=t.object;e.sidebar=n.sidebar}))}}),window.nsComponents=Object.assign(m,i),window.nsDashboardContent=new s.default({el:"#dashboard-content",components:m})},9671:(e,t,n)=>{"use strict";n.d(t,{l:()=>Y,kq:()=>Z,ih:()=>z,kX:()=>H});var s=n(6486),i=n(9669),r=n(6300),a=n(8345),o=n(9624),l=n(9248),c=n(230);function d(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=Z.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:s}),new c.y((function(r){n._client[e](t,s,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,r.next(e.data),r.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;r.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&d(t.prototype,n),s&&d(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=n(3);function p(e,t){for(var n=0;n=1e3){for(var n,s=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=s?e/Math.pow(1e3,s):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][s]}return t})),S=n(1356),E=n(9698);function P(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&q(t.prototype,n),s&&q(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()),N=new b({sidebar:["xs","sm","md"].includes(I.breakpoint)?"hidden":"visible"});z.defineClient(i),window.nsEvent=Y,window.nsHttpClient=z,window.nsSnackBar=H,window.nsCurrency=S.W,window.nsTruncate=E.b,window.nsRawCurrency=S.f,window.nsAbbreviate=$,window.nsState=N,window.nsUrl=L,window.nsScreen=I,window.ChartJS=r,window.EventEmitter=h,window.Popup=x.G,window.RxJS=y,window.FormValidation=k.Z,window.nsCrudHandler=R},7975:(e,t,n)=>{"use strict";n.r(t),n.d(t,{nsAvatar:()=>Q,nsButton:()=>o,nsCheckbox:()=>p,nsCkeditor:()=>O,nsCloseButton:()=>j,nsCrud:()=>U,nsCrudForm:()=>g,nsDate:()=>w,nsDateRangePicker:()=>K.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>_.P,nsIconButton:()=>$,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>C,nsMenu:()=>r,nsMultiselect:()=>x,nsNotice:()=>J.Z,nsNumpad:()=>W.Z,nsPaginate:()=>te.Z,nsSearch:()=>se,nsSelect:()=>u,nsSelectAudio:()=>f,nsSpinner:()=>v,nsSubmenu:()=>a,nsSwitch:()=>M.Z,nsTableRow:()=>m,nsTabs:()=>T,nsTabsItem:()=>F,nsTextarea:()=>y});var s=n(538),i=n(9671),r=s.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,i.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&i.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,n){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),a=s.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),o=s.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=s.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=s.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),d=n(7389),u=s.default.component("ns-select",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},mounted:function(){},methods:{__:d.__},template:'\n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),f=s.default.component("ns-select-audio",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__:d.__,playSelectedSound:function(){this.field.value.length>0&&new Audio(this.field.value).play()}},template:'\n
    \n \n
    \n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),p=s.default.component("ns-checkbox",{data:function(){return{}},props:["checked","field","label"],template:'\n
    \n
    \n \n
    \n {{ label }}\n {{ field.label }}\n
    \n ',computed:{isChecked:function(){return this.field?this.field.value:this.checked}},methods:{toggleIt:function(){void 0!==this.field&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}}),h=n(2242),m=s.default.component("ns-table-row",{props:["options","row","columns","prependOptions","showOptions"],data:function(){return{optionsToggled:!1}},mounted:function(){},methods:{__:d.__,sanitizeHTML:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.getElementsByTagName("script"),s=n.length;s--;)n[s].parentNode.removeChild(n[s]);return t.innerHTML},getElementOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu:function(e){var t=this;if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout((function(){var e=t.$el.querySelectorAll(".relative > .absolute")[0],n=t.$el.querySelectorAll(".relative")[0],s=t.getElementOffset(n);e.style.top=s.top+"px",e.style.left=s.left+"px",n.classList.remove("relative"),n.classList.add("dropdown-holder")}),100);else{var n=this.$el.querySelectorAll(".dropdown-holder")[0];n.classList.remove("dropdown-holder"),n.classList.add("relative")}},handleChanged:function(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync:function(e){var t=this;e.confirm?confirm(e.confirm.message)&&i.ih[e.type.toLowerCase()](e.url).subscribe((function(e){i.kX.success(e.message).subscribe(),t.$emit("reload",t.row)}),(function(e){t.toggleMenu(),i.kX.error(e.message).subscribe()})):(i.l.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup:function(e,t){var n=window.nsExtraComponents[e.component];if(e.component)return n?new Promise((function(s,i){h.G.show(n,{resolve:s,reject:i,row:t,action:e})})):i.kX.error((0,d.__)('Unable to load the component "'.concat(e.component,'". Make sure the component is registered to "nsExtraComponents".'))).subscribe();this.triggerAsync(e)}},template:'\n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n '}),v=s.default.component("ns-spinner",{data:function(){return{}},mounted:function(){},computed:{validatedSize:function(){return this.size||24},validatedBorder:function(){return this.border||8},validatedAnimation:function(){return this.animation||"fast"}},props:["color","size","border"],template:"\n
    \n
    \n
    \n "}),b=n(7266),g=s.default.component("ns-crud-form",{data:function(){return{form:{},globallyChecked:!1,formValidation:new b.Z,rows:[]}},mounted:function(){this.loadForm()},props:["src","create-url","field-class","return-url","submit-url","submit-method","disable-tabs"],computed:{activeTabFields:function(){for(var e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]}},methods:{__:d.__,toggle:function(e){for(var t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},handleShowOptions:function(e){this.rows.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},submit:function(){var e=this;return this.formValidation.validateForm(this.form).length>0?i.kX.error(this.$slots["error-invalid"]?this.$slots["error-invalid"][0].text:"No error message provided for having an invalid form.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():(this.formValidation.disableForm(this.form),void 0===this.submitUrl?i.kX.error(this.$slots["error-no-submit-url"]?this.$slots["error-no-submit-url"][0].text:"No error message provided for not having a valid submit url.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():void i.ih[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,this.formValidation.extractForm(this.form)).subscribe((function(t){if("success"===t.status){if(e.submitMethod&&"post"===e.submitMethod.toLowerCase()&&!1!==e.returnUrl)return document.location=t.data.editUrl||e.returnUrl;i.kX.info(t.message,(0,d.__)("Okay"),{duration:3e3}).subscribe(),e.$emit("save",t)}e.formValidation.enableForm(e.form)}),(function(t){i.kX.error(t.message,void 0,{duration:5e3}).subscribe(),void 0!==t.data&&e.formValidation.triggerError(e.form,t.data),e.formValidation.enableForm(e.form)})))},handleGlobalChange:function(e){this.globallyChecked=e,this.rows.forEach((function(t){return t.$checked=e}))},loadForm:function(){var e=this;i.ih.get("".concat(this.src)).subscribe({next:function(t){e.form=e.parseForm(t.form),i.kq.doAction("ns-crud-form-loaded",e),e.$emit("updated",e.form)},error:function(e){i.kX.error(e.message,"OKAY",{duration:0}).subscribe()}})},parseForm:function(e){e.main.value=void 0===e.main.value?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];var t=0;for(var n in e.tabs)0===t&&(e.tabs[n].active=!0),e.tabs[n].active=void 0!==e.tabs[n].active&&e.tabs[n].active,e.tabs[n].fields=this.formValidation.createFields(e.tabs[n].fields),t++;return e}},template:'\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n
    {{ tab.label }}
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n '}),y=s.default.component("ns-textarea",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),_=n(8737),x=s.default.component("ns-multiselect",{data:function(){return{showPanel:!1,search:""}},props:["field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=void 0!==t.selected&&t.selected,e.field.value&&e.field.value.includes(t.value)&&(t.selected=!0),t}))}},methods:{__:d.__,addOption:function(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout((function(){}),100))},removeOption:function(e,t){var n=this;if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout((function(){n.search=""}),100),!1}},mounted:function(){var e=this;this.field.value&&this.field.value.reverse().forEach((function(t){var n=e.field.options.filter((function(e){return e.value===t}));n.length>=0&&e.addOption(n[0])}))},template:'\n
    \n \n
    \n
    \n
    \n
    \n
    \n {{ option.label }}\n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n
    \n '}),w=s.default.component("ns-date",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),k=n(4255),C=s.default.component("ns-media-input",{template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n ',computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},data:function(){return{}},props:["placeholder","leading","type","field"],mounted:function(){},methods:{toggleMedia:function(){var e=this;new Promise((function(t,n){h.G.show(k.default,Object.assign({resolve:t,reject:n},e.field.data||{}))})).then((function(t){"use-selected"===t.event&&(e.field.data&&"url"!==e.field.data.type?e.field.data&&"model"!==e.field.data.type||(e.field.value=t.value[0]):e.field.value=t.value[0].sizes.original,e.$forceUpdate())}))}}}),j=s.default.component("ns-close-button",{template:'\n \n ',methods:{clicked:function(e){this.$emit("click",e)}}}),$=s.default.component("ns-icon-button",{template:'\n \n ',props:["className","buttonClass","type"],methods:{clicked:function(e){this.$emit("click",e)}}}),S=n(1272),E=n.n(S),P=n(5234),D=n.n(P),O=s.default.component("ns-ckeditor",{data:function(){return{editor:D()}},components:{ckeditor:E().component},mounted:function(){},methods:{__:d.__},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),T=s.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),F=s.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),M=n(9408),A=n(2744),q=n(7757),V=n.n(q),Y=n(3601),z=n(8603),H=n(6386);const L={data:function(){return{fields:[],validation:new b.Z}},methods:{__:d.__,popupCloser:z.Z,popupResolver:H.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var R=n(1900);const Z=(0,R.Z)(L,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[n("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[n("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),n("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return n("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),n("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[n("div",[n("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),n("div",[n("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var I=function(e,t,n,s){return new(n||(n=Promise))((function(i,r){function a(e){try{l(s.next(e))}catch(e){r(e)}}function o(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((s=s.apply(e,t||[])).next())}))};const N={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,d.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:d.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),i.kX.success((0,d.__)("The document has been generated.")).subscribe()}),(function(e){i.kX.error(e.message||(0,d.__)("Unexpected error occured.")).subscribe()}))},clearSelectedEntries:function(){var e=this;h.G.show(Y.default,{title:(0,d.__)("Clear Selected Entries ?"),message:(0,d.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var n=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(n,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(n){n.$checked=e,t.refreshRow(n)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){i.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,d.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){i.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){i.kX.error(e.message).subscribe()}}):void 0:i.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,d.__)("No selection has been made.")).subscribe():i.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,d.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return I(this,void 0,void 0,V().mark((function e(){var t,n=this;return V().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(Z),e.next=4,new Promise((function(e,t){h.G.show(Z,{resolve:e,reject:t,queryFilters:n.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,i.kX.error(t.message).subscribe()}))}}};const U=(0,R.Z)(N,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?n("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[n("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?n("div",{staticClass:"px-2 flex items-center justify-center"},[n("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[n("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),n("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[n("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?n("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[n("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2 flex items-center justify-center"},[n("button",{staticClass:"rounded-full\n text-sm\n h-10\n px-3\n outline-none\n border\n ns-crud-button\n ",on:{click:function(t){return e.refresh()}}},[n("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?n("div",{staticClass:"px-2 flex items-center"},[n("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none ",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():n("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?n("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():n("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?n("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),n("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[n("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[n("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?n("table",{staticClass:"table ns-table w-full"},[n("thead",[n("tr",[n("th",{staticClass:"text-center px-2 border w-16 py-2"},[n("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,s){return n("th",{key:s,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(s)}}},[n("div",{staticClass:"w-full flex justify-between items-center"},[n("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),n("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?n("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?n("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),n("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,s){return n("ns-table-row",{key:s,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():n("tr",[n("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?n("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?n:n[0]}}},[n("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,s){return n("option",{key:s,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),n("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),n("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var W=n(4864),B=n(1726),X=n(7259);const G=s.default.extend({methods:{__:d.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,B.createAvatar)(X,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const Q=(0,R.Z)(G,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[n("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),n("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?n("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?n("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var K=n(4806),J=n(1828),ee=n(1544),te=n(3506);const ne={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:d.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,n,s;e.searchText.length>0&&i.ih[e.method||"post"](e.url,(t={},n=e.searchArgument||"search",s=e.searchText,n in t?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,t)).subscribe({next:function(t){e.results=t},error:function(e){i.kX.error(e.message||(0,d.__)("An unexpected error occured.")).subscribe()}})}),1e3)}},mounted:function(){}};const se=(0,R.Z)(ne,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-search"},[n("div",{staticClass:"input-group info border-2"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),n("div",{staticClass:"relative"},[n("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?n("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,s){return n("li",{key:s,staticClass:"border-b p-2 cursor-pointer",on:{click:function(n){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},8737:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var s=n(538),i=n(4806),r=n(2744),a=n(9408),o=s.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:i.Z,nsDateTimePicker:r.Z,nsSwitch:a.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\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 '})},1356:(e,t,n)=>{"use strict";n.d(t,{W:()=>c,f:()=>d});var s=n(2077),i=n.n(s),r=n(538),a=n(6740),o=n.n(a),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=r.default.filter("currency",(function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===s){var r={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=o()(e,r).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),d=function(e){var t="0.".concat(l);return parseFloat(i()(e).format(t))}},9698:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var s=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,n)=>{"use strict";function s(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var s=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&s.push(i),e.tabs[n].errors=s.flat(),t.push(s.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var s=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===s.length&&e.tabs[s[0]].fields.forEach((function(e){e.name===s[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var s in t.errors)n(s)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var s in t.errors)n(s)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(s,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){!0===n[t.identifier]&&e.errors.splice(s,1)}))}return e}}],n&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,n)=>{"use strict";n.d(t,{__:()=>s,c:()=>i});var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},6781:(e,t,n)=>{"use strict";function s(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);nc});var c=function(){function e(){var t=this;a(this,e),this.listeners=new Object,document.addEventListener("keydown",(function(e){return t.processEvent(e)}))}return l(e,[{key:"processEvent",value:function(e){var t=this;for(var n in this.listeners){var s=this.listeners[n].getConfig();if(s.hidden.length>0)if(s.hidden.filter((function(e){return e instanceof HTMLElement==!1&&null===document.querySelector(e)})).length!==s.hidden.length)continue;if(s.visible.length>0)if(!(s.visible.filter((function(e){return e instanceof HTMLElement==!0||null!==document.querySelector(e)})).length===s.visible.length))continue;s.callbacks.forEach((function(e){"string"==typeof e.action?t.processSingleAction({action:e.action.trim(),callback:e.callback}):"object"===r(e.action)&&null!==e.action&&e.action.length>0&&e.action.forEach((function(n){t.processSingleAction({action:n.toString().trim(),callback:e.callback})}))}))}}},{key:"processSingleAction",value:function(e){var t=e.action,n=e.callback,s=t.split("+"),i={ctrlKey:!1,altKey:!1,shiftKey:!1};s.forEach((function(e){switch(e){case"ctrl":i.ctrlKey=!0;break;case"alt":i.altKey=!0;break;case"shift":i.shiftKey=!0}}));var r=s.filter((function(e){return!["ctrl","alt","shift"].includes(e)}));this.executeCallback({event,combinableKeys:i,callback:n,key:r[0]})}},{key:"executeCallback",value:function(e){var t=e.event,n=e.callback,s=e.combinableKeys,i=e.key;if(void 0!==t.key&&t.key.toLowerCase()===i.toLowerCase()){var r=!0;for(var a in s)t[a]!==s[a]&&(r=!1);r&&n(t,i)}}},{key:"create",value:function(e){return this.listeners[e]=new d}},{key:"destroy",value:function(e){delete this.listeners[e]}}]),e}(),d=function(){function e(){a(this,e),this.visible=[],this.hidden=[],this.callbacks=[]}return l(e,[{key:"whenVisible",value:function(e){var t;"object"===r(e)?(t=this.visible).push.apply(t,s(e)):this.visible.push(e);return this}},{key:"clearVisible",value:function(){return this.visible=[],this}},{key:"whenNotVisible",value:function(e){var t;e.length>0?(t=this.hidden).push.apply(t,s(e)):this.hidden.push(e);return this}},{key:"clearHidden",value:function(){return this.hidden=[],this}},{key:"whenPressed",value:function(e,t){this.callbacks.push({action:e,callback:t})}},{key:"clearCallbacks",value:function(){return this.callbacks=[],this}},{key:"getConfig",value:function(){return{callbacks:this.callbacks,hidden:this.hidden,visible:this.visible}}}]),e}()},8603:(e,t,n)=>{"use strict";function s(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>s})},6386:(e,t,n)=>{"use strict";function s(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>s})},2242:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var s=n(7757),i=n.n(s),r=n(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new r.x}var t,n,s;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,s,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,i().mark((function a(){var o,l,c,d=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){d.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=r,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],s=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(s);return i.open(t,n),i}}],n&&o(t.prototype,n),s&&o(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var s=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return s.Observable.create((function(s){var r=n.__createSnack({message:e,label:t,type:i.type}),a=r.buttonNode,o=(r.textNode,r.snackWrapper,r.sampleSnack);a.addEventListener("click",(function(e){s.onNext(a),s.onCompleted(),o.remove()})),n.__startTimer(i.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,s=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){s()})),s()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,s=e.type,i=void 0===s?"info":s,r=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),d="",u="";switch(i){case"info":d="",u="info";break;case"error":d="",u="error";break;case"success":d="",u="success"}return o.textContent=t,o.setAttribute("class","pr-2"),n&&(l.setAttribute("class","ns-button default"),c.textContent=n,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(d)),l.appendChild(c)),a.appendChild(o),a.appendChild(l),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(u)),r.appendChild(a),null===document.getElementById("snack-wrapper")&&(r.setAttribute("id","snack-wrapper"),r.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(r)),{snackWrapper:r,sampleSnack:a,buttonsWrapper:l,buttonNode:c,textNode:o}}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},824:(e,t,n)=>{"use strict";var s=n(381),i=n.n(s);ns.date.moment=i()(ns.date.current),ns.date.interval=setInterval((function(){ns.date.moment.add(1,"seconds"),ns.date.current=i()(ns.date.current).add(1,"seconds").format("YYYY-MM-DD HH:mm:ss")}),1e3),ns.date.getNowString=function(){var e=Date.parse((new Date).toLocaleString("en-US",{timeZone:ns.date.timeZone}));return i()(e).format("YYYY-MM-DD HH:mm:ss")},ns.date.getMoment=function(){var e=Date.parse((new Date).toLocaleString("en-US",{timeZone:ns.date.timeZone}));return i()(e)}},6700:(e,t,n)=>{var s={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=r(e);return n(t)}function r(e){if(!n.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}i.keys=function(){return Object.keys(s)},i.resolve=r,e.exports=i,i.id=6700},4806:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var s=n(538),i=n(381),r=n.n(i),a=n(7144),o=n.n(a),l=(n(9095),n(7389));const c=s.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:o()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:r()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:r()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?r()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const d=(0,n(1900).Z)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?n("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[n("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),n("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[n("i",{staticClass:"las la-times"})]),e._v(" "),n("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[n("div",{staticClass:"flex justify-between items-center w-full py-2"},[n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},2744:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:i(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return i()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?i()():i()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?i()():i()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:n(7389).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker mb-2"},[e.field?n("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),n("div",{staticClass:"ns-button"},[n("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?n("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?n("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?n("span",{staticClass:"mx-1 text-sm"},[null!==e.date?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?n("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?n("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?n("div",{staticClass:"relative z-10 h-0 w-0"},[n("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[n("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[n("i",{staticClass:"las la-minus"})]),e._v(" "),n("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[n("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,s){return n("div",{key:s,staticClass:"h-8 flex justify-center items-center text-sm"},[[n("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),n("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[n("div",{staticClass:"-mx-1 flex justify-between"},[n("div",{staticClass:"px-1"},[n("div",{staticClass:"-mx-1 flex"},[e.field?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[n("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[n("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),n("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},1544:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?i()():i()(this.date),this.build()},methods:{__:n(7389).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker"},[n("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),n("span",{staticClass:"mx-1 text-sm"},[n("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?n("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?n("div",{staticClass:"relative h-0 w-0 -mb-2"},[n("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),n("div")])]):e._e()])}),[],!1,null,null,null).exports},1828:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[n("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),n("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},4864:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var s=n(7389);function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,n){e.inputValue({value:n})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var n=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",n)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,s){return n("div",{key:s,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(n){return e.inputValue(t)}}},[void 0!==t.value?n("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?n("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3506:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},9408:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"mb-2 ns-switch"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,s){return n("button",{key:s,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(n){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},4255:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var s=n(7757),i=n.n(s),r=n(9671),a=n(8603),o=n(7389),l=n(3601);function c(e,t,n,s,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(s,i)}const d={name:"ns-media",props:["popup"],components:{VueUpload:n(2948)},data:function(){return{pages:[{label:(0,o.__)("Upload"),name:"upload",selected:!1},{label:(0,o.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return r.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:a.Z,__:o.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,o.__)("Confirm Your Action"),message:(0,o.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){r.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=i().mark((function e(){var n,s,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),s=i().mark((function e(t){var s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n[t],e.prev=1,s.progress=1,e.next=5,new Promise((function(e,t){var n=new FormData;n.append("file",s.file),r.ih.post("/api/nexopos/v4/medias",n,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){s.uploaded=!0,s.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),s.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),a=0;case 3:if(!(a0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,r.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(n,s){s!==t.response.data.indexOf(e)&&(n.selected=!1)})),e.selected=!e.selected}}};const u=(0,n(1900).Z)(d,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[n("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[n("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),n("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,s){return n("li",{key:s,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(n){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?n("div",{staticClass:"content w-full overflow-hidden flex"},[n("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[n("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),n("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),n("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[n("ul",e._l(e.files,(function(t,s){return n("li",{key:s,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[n("span",[e._v(e._s(t.file.name))]),e._v(" "),n("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?n("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?n("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[n("div"),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),n("div",{staticClass:"flex flex-auto overflow-hidden"},[n("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[n("div",{staticClass:"flex flex-auto"},[n("div",{staticClass:"p-2 overflow-x-auto"},[n("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,s){return n("div",{key:s},[n("div",{staticClass:"p-2"},[n("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(n){return e.selectResource(t)}}},[n("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?n("div",{staticClass:"flex flex-auto items-center justify-center"},[n("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),n("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0 ",attrs:{id:"preview"}},[n("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?n("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?n("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),n("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),n("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),n("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[n("div",{staticClass:"flex -mx-2 flex-shrink-0"},[n("div",{staticClass:"px-2 flex-shrink-0 flex"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[n("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[n("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?n("div",{staticClass:"ns-button error"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[n("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),n("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[n("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),n("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),n("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?n("div",{staticClass:"px-2"},[n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},3601:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var s=n(7389),i=n(6386),r=n(8603);const a={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:s.__,popupResolver:i.Z,popupCloser:r.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[n("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[n("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),n("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),n("div",{staticClass:"action-buttons flex border-t"},[n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),n("hr",{staticClass:"border-r h-16"}),e._v(" "),n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=4297,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/public/js/auth.min.js b/public/js/auth.min.js index ea2c763c5..3e90ba41d 100644 --- a/public/js/auth.min.js +++ b/public/js/auth.min.js @@ -1 +1 @@ -(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[743,198],{8108:(e,t,n)=>{"use strict";var s=n(538),i=n(7975),r=function(){return n.e(781).then(n.bind(n,8781))},a=function(){return n.e(331).then(n.bind(n,3331))},o=function(){return n.e(179).then(n.bind(n,6179))},l=function(){return n.e(669).then(n.bind(n,3669))},c=(window.nsState,window.nsScreen,window.nsExtraComponents);window.nsComponents=Object.assign(i,c,{nsRegister:r,nsLogin:a,nsPasswordLost:o,nsNewPassword:l}),window.authVueComponent=new s.default({el:"#page-container",components:Object.assign(Object.assign({nsLogin:a,nsRegister:r,nsPasswordLost:o,nsNewPassword:l},c),i)})},9671:(e,t,n)=>{"use strict";n.d(t,{l:()=>V,kq:()=>Z,ih:()=>Y,kX:()=>H});var s=n(6486),i=n(9669),r=n(6300),a=n(8345),o=n(9624),l=n(9248),c=n(230);function d(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=Z.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:s}),new c.y((function(r){n._client[e](t,s,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,r.next(e.data),r.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;r.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&d(t.prototype,n),s&&d(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=n(3);function p(e,t){for(var n=0;n=1e3){for(var n,s=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=s?e/Math.pow(1e3,s):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][s]}return t})),E=n(1356),S=n(9698);function P(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&q(t.prototype,n),s&&q(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()),I=new b({sidebar:["xs","sm","md"].includes(N.breakpoint)?"hidden":"visible"});Y.defineClient(i),window.nsEvent=V,window.nsHttpClient=Y,window.nsSnackBar=H,window.nsCurrency=E.W,window.nsTruncate=S.b,window.nsRawCurrency=E.f,window.nsAbbreviate=$,window.nsState=I,window.nsUrl=L,window.nsScreen=N,window.ChartJS=r,window.EventEmitter=h,window.Popup=x.G,window.RxJS=y,window.FormValidation=k.Z,window.nsCrudHandler=R},7975:(e,t,n)=>{"use strict";n.r(t),n.d(t,{nsAvatar:()=>Q,nsButton:()=>o,nsCheckbox:()=>p,nsCkeditor:()=>O,nsCloseButton:()=>j,nsCrud:()=>U,nsCrudForm:()=>g,nsDate:()=>w,nsDateRangePicker:()=>J.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>_.P,nsIconButton:()=>$,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>C,nsMenu:()=>r,nsMultiselect:()=>x,nsNotice:()=>K.Z,nsNumpad:()=>W.Z,nsPaginate:()=>te.Z,nsSearch:()=>se,nsSelect:()=>u,nsSelectAudio:()=>f,nsSpinner:()=>v,nsSubmenu:()=>a,nsSwitch:()=>M.Z,nsTableRow:()=>m,nsTabs:()=>T,nsTabsItem:()=>F,nsTextarea:()=>y});var s=n(538),i=n(9671),r=s.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,i.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&i.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,n){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),a=s.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),o=s.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=s.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=s.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),d=n(7389),u=s.default.component("ns-select",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},mounted:function(){},methods:{__:d.__},template:'\n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),f=s.default.component("ns-select-audio",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__:d.__,playSelectedSound:function(){this.field.value.length>0&&new Audio(this.field.value).play()}},template:'\n
    \n \n
    \n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),p=s.default.component("ns-checkbox",{data:function(){return{}},props:["checked","field","label"],template:'\n
    \n
    \n \n
    \n {{ label }}\n {{ field.label }}\n
    \n ',computed:{isChecked:function(){return this.field?this.field.value:this.checked}},methods:{toggleIt:function(){void 0!==this.field&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}}),h=n(2242),m=s.default.component("ns-table-row",{props:["options","row","columns","prependOptions","showOptions"],data:function(){return{optionsToggled:!1}},mounted:function(){},methods:{__:d.__,sanitizeHTML:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.getElementsByTagName("script"),s=n.length;s--;)n[s].parentNode.removeChild(n[s]);return t.innerHTML},getElementOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu:function(e){var t=this;if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout((function(){var e=t.$el.querySelectorAll(".relative > .absolute")[0],n=t.$el.querySelectorAll(".relative")[0],s=t.getElementOffset(n);e.style.top=s.top+"px",e.style.left=s.left+"px",n.classList.remove("relative"),n.classList.add("dropdown-holder")}),100);else{var n=this.$el.querySelectorAll(".dropdown-holder")[0];n.classList.remove("dropdown-holder"),n.classList.add("relative")}},handleChanged:function(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync:function(e){var t=this;e.confirm?confirm(e.confirm.message)&&i.ih[e.type.toLowerCase()](e.url).subscribe((function(e){i.kX.success(e.message).subscribe(),t.$emit("reload",t.row)}),(function(e){t.toggleMenu(),i.kX.error(e.message).subscribe()})):(i.l.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup:function(e,t){var n=window.nsExtraComponents[e.component];if(e.component)return n?new Promise((function(s,i){h.G.show(n,{resolve:s,reject:i,row:t,action:e})})):i.kX.error((0,d.__)('Unable to load the component "'.concat(e.component,'". Make sure the component is registered to "nsExtraComponents".'))).subscribe();this.triggerAsync(e)}},template:'\n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n '}),v=s.default.component("ns-spinner",{data:function(){return{}},mounted:function(){},computed:{validatedSize:function(){return this.size||24},validatedBorder:function(){return this.border||8},validatedAnimation:function(){return this.animation||"fast"}},props:["color","size","border"],template:"\n
    \n
    \n
    \n "}),b=n(7266),g=s.default.component("ns-crud-form",{data:function(){return{form:{},globallyChecked:!1,formValidation:new b.Z,rows:[]}},mounted:function(){this.loadForm()},props:["src","create-url","field-class","return-url","submit-url","submit-method","disable-tabs"],computed:{activeTabFields:function(){for(var e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]}},methods:{__:d.__,toggle:function(e){for(var t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},handleShowOptions:function(e){this.rows.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},submit:function(){var e=this;return this.formValidation.validateForm(this.form).length>0?i.kX.error(this.$slots["error-invalid"]?this.$slots["error-invalid"][0].text:"No error message provided for having an invalid form.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():(this.formValidation.disableForm(this.form),void 0===this.submitUrl?i.kX.error(this.$slots["error-no-submit-url"]?this.$slots["error-no-submit-url"][0].text:"No error message provided for not having a valid submit url.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():void i.ih[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,this.formValidation.extractForm(this.form)).subscribe((function(t){if("success"===t.status){if(e.submitMethod&&"post"===e.submitMethod.toLowerCase()&&!1!==e.returnUrl)return document.location=t.data.editUrl||e.returnUrl;i.kX.info(t.message,(0,d.__)("Okay"),{duration:3e3}).subscribe(),e.$emit("save",t)}e.formValidation.enableForm(e.form)}),(function(t){i.kX.error(t.message,void 0,{duration:5e3}).subscribe(),void 0!==t.data&&e.formValidation.triggerError(e.form,t.data),e.formValidation.enableForm(e.form)})))},handleGlobalChange:function(e){this.globallyChecked=e,this.rows.forEach((function(t){return t.$checked=e}))},loadForm:function(){var e=this;i.ih.get("".concat(this.src)).subscribe({next:function(t){e.form=e.parseForm(t.form),i.kq.doAction("ns-crud-form-loaded",e),e.$emit("updated",e.form)},error:function(e){i.kX.error(e.message,"OKAY",{duration:0}).subscribe()}})},parseForm:function(e){e.main.value=void 0===e.main.value?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];var t=0;for(var n in e.tabs)0===t&&(e.tabs[n].active=!0),e.tabs[n].active=void 0!==e.tabs[n].active&&e.tabs[n].active,e.tabs[n].fields=this.formValidation.createFields(e.tabs[n].fields),t++;return e}},template:'\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n
    {{ tab.label }}
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n '}),y=s.default.component("ns-textarea",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),_=n(8737),x=s.default.component("ns-multiselect",{data:function(){return{showPanel:!1,search:""}},props:["field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=void 0!==t.selected&&t.selected,e.field.value&&e.field.value.includes(t.value)&&(t.selected=!0),t}))}},methods:{__:d.__,addOption:function(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout((function(){}),100))},removeOption:function(e,t){var n=this;if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout((function(){n.search=""}),100),!1}},mounted:function(){var e=this;this.field.value&&this.field.value.reverse().forEach((function(t){var n=e.field.options.filter((function(e){return e.value===t}));n.length>=0&&e.addOption(n[0])}))},template:'\n
    \n \n
    \n
    \n
    \n
    \n
    \n {{ option.label }}\n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n
    \n '}),w=s.default.component("ns-date",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),k=n(4255),C=s.default.component("ns-media-input",{template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n ',computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},data:function(){return{}},props:["placeholder","leading","type","field"],mounted:function(){},methods:{toggleMedia:function(){var e=this;new Promise((function(t,n){h.G.show(k.default,Object.assign({resolve:t,reject:n},e.field.data||{}))})).then((function(t){"use-selected"===t.event&&(e.field.data&&"url"!==e.field.data.type?e.field.data&&"model"!==e.field.data.type||(e.field.value=t.value[0]):e.field.value=t.value[0].sizes.original,e.$forceUpdate())}))}}}),j=s.default.component("ns-close-button",{template:'\n \n ',methods:{clicked:function(e){this.$emit("click",e)}}}),$=s.default.component("ns-icon-button",{template:'\n \n ',props:["className","buttonClass","type"],methods:{clicked:function(e){this.$emit("click",e)}}}),E=n(1272),S=n.n(E),P=n(5234),D=n.n(P),O=s.default.component("ns-ckeditor",{data:function(){return{editor:D()}},components:{ckeditor:S().component},mounted:function(){},methods:{__:d.__},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),T=s.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),F=s.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),M=n(9408),A=n(2744),q=n(7757),z=n.n(q),V=n(3601),Y=n(8603),H=n(6386);const L={data:function(){return{fields:[],validation:new b.Z}},methods:{__:d.__,popupCloser:Y.Z,popupResolver:H.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var R=n(1900);const Z=(0,R.Z)(L,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[n("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[n("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),n("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return n("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),n("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[n("div",[n("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),n("div",[n("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var N=function(e,t,n,s){return new(n||(n=Promise))((function(i,r){function a(e){try{l(s.next(e))}catch(e){r(e)}}function o(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((s=s.apply(e,t||[])).next())}))};const I={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,d.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:d.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),i.kX.success((0,d.__)("The document has been generated.")).subscribe()}),(function(e){i.kX.error(e.message||(0,d.__)("Unexpected error occured.")).subscribe()}))},clearSelectedEntries:function(){var e=this;h.G.show(V.default,{title:(0,d.__)("Clear Selected Entries ?"),message:(0,d.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var n=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(n,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(n){n.$checked=e,t.refreshRow(n)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){i.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,d.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){i.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){i.kX.error(e.message).subscribe()}}):void 0:i.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,d.__)("No selection has been made.")).subscribe():i.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,d.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return N(this,void 0,void 0,z().mark((function e(){var t,n=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(Z),e.next=4,new Promise((function(e,t){h.G.show(Z,{resolve:e,reject:t,queryFilters:n.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,i.kX.error(t.message).subscribe()}))}}};const U=(0,R.Z)(I,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?n("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[n("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?n("div",{staticClass:"px-2 flex items-center justify-center"},[n("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[n("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),n("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[n("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?n("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[n("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2 flex items-center justify-center"},[n("button",{staticClass:"rounded-full\n text-sm\n h-10\n px-3\n outline-none\n border\n ns-crud-button\n ",on:{click:function(t){return e.refresh()}}},[n("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?n("div",{staticClass:"px-2 flex items-center"},[n("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none ",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():n("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?n("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():n("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?n("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),n("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[n("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[n("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?n("table",{staticClass:"table ns-table w-full"},[n("thead",[n("tr",[n("th",{staticClass:"text-center px-2 border w-16 py-2"},[n("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,s){return n("th",{key:s,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(s)}}},[n("div",{staticClass:"w-full flex justify-between items-center"},[n("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),n("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?n("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?n("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),n("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,s){return n("ns-table-row",{key:s,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():n("tr",[n("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?n("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?n:n[0]}}},[n("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,s){return n("option",{key:s,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),n("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),n("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var W=n(4864),B=n(1726),X=n(7259);const G=s.default.extend({methods:{__:d.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,B.createAvatar)(X,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const Q=(0,R.Z)(G,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[n("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),n("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?n("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?n("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var J=n(4806),K=n(1828),ee=n(1544),te=n(3506);const ne={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:d.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,n,s;e.searchText.length>0&&i.ih[e.method||"post"](e.url,(t={},n=e.searchArgument||"search",s=e.searchText,n in t?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,t)).subscribe({next:function(t){e.results=t},error:function(e){i.kX.error(e.message||(0,d.__)("An unexpected error occured.")).subscribe()}})}),1e3)}},mounted:function(){}};const se=(0,R.Z)(ne,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-search"},[n("div",{staticClass:"input-group info border-2"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),n("div",{staticClass:"relative"},[n("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?n("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,s){return n("li",{key:s,staticClass:"border-b p-2 cursor-pointer",on:{click:function(n){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},8737:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var s=n(538),i=n(4806),r=n(2744),a=n(9408),o=s.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:i.Z,nsDateTimePicker:r.Z,nsSwitch:a.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\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 '})},1356:(e,t,n)=>{"use strict";n.d(t,{W:()=>c,f:()=>d});var s=n(2077),i=n.n(s),r=n(538),a=n(6740),o=n.n(a),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=r.default.filter("currency",(function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===s){var r={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=o()(e,r).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),d=function(e){var t="0.".concat(l);return parseFloat(i()(e).format(t))}},9698:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var s=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,n)=>{"use strict";function s(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var s=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&s.push(i),e.tabs[n].errors=s.flat(),t.push(s.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var s=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===s.length&&e.tabs[s[0]].fields.forEach((function(e){e.name===s[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var s in t.errors)n(s)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var s in t.errors)n(s)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(s,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){!0===n[t.identifier]&&e.errors.splice(s,1)}))}return e}}],n&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,n)=>{"use strict";n.d(t,{__:()=>s,c:()=>i});var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},8603:(e,t,n)=>{"use strict";function s(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>s})},6386:(e,t,n)=>{"use strict";function s(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>s})},2242:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var s=n(7757),i=n.n(s),r=n(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new r.x}var t,n,s;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,s,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,i().mark((function a(){var o,l,c,d=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){d.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=r,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],s=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(s);return i.open(t,n),i}}],n&&o(t.prototype,n),s&&o(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var s=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return s.Observable.create((function(s){var r=n.__createSnack({message:e,label:t,type:i.type}),a=r.buttonNode,o=(r.textNode,r.snackWrapper,r.sampleSnack);a.addEventListener("click",(function(e){s.onNext(a),s.onCompleted(),o.remove()})),n.__startTimer(i.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,s=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){s()})),s()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,s=e.type,i=void 0===s?"info":s,r=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),d="",u="";switch(i){case"info":d="",u="info";break;case"error":d="",u="error";break;case"success":d="",u="success"}return o.textContent=t,o.setAttribute("class","pr-2"),n&&(l.setAttribute("class","ns-button default"),c.textContent=n,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(d)),l.appendChild(c)),a.appendChild(o),a.appendChild(l),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(u)),r.appendChild(a),null===document.getElementById("snack-wrapper")&&(r.setAttribute("id","snack-wrapper"),r.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(r)),{snackWrapper:r,sampleSnack:a,buttonsWrapper:l,buttonNode:c,textNode:o}}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},6700:(e,t,n)=>{var s={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=r(e);return n(t)}function r(e){if(!n.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}i.keys=function(){return Object.keys(s)},i.resolve=r,e.exports=i,i.id=6700},4806:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var s=n(538),i=n(381),r=n.n(i),a=n(7144),o=n.n(a),l=(n(9095),n(7389));const c=s.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:o()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:r()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:r()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?r()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const d=(0,n(1900).Z)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?n("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[n("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),n("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[n("i",{staticClass:"las la-times"})]),e._v(" "),n("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[n("div",{staticClass:"flex justify-between items-center w-full py-2"},[n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},2744:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:i(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return i()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?i()():i()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?i()():i()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:n(7389).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker mb-2"},[e.field?n("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),n("div",{staticClass:"ns-button"},[n("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?n("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?n("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?n("span",{staticClass:"mx-1 text-sm"},[null!==e.date?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?n("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?n("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?n("div",{staticClass:"relative z-10 h-0 w-0"},[n("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[n("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[n("i",{staticClass:"las la-minus"})]),e._v(" "),n("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[n("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,s){return n("div",{key:s,staticClass:"h-8 flex justify-center items-center text-sm"},[[n("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),n("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[n("div",{staticClass:"-mx-1 flex justify-between"},[n("div",{staticClass:"px-1"},[n("div",{staticClass:"-mx-1 flex"},[e.field?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[n("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[n("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),n("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},1544:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?i()():i()(this.date),this.build()},methods:{__:n(7389).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker"},[n("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),n("span",{staticClass:"mx-1 text-sm"},[n("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?n("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?n("div",{staticClass:"relative h-0 w-0 -mb-2"},[n("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),n("div")])]):e._e()])}),[],!1,null,null,null).exports},1828:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[n("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),n("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},4864:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var s=n(7389);function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,n){e.inputValue({value:n})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var n=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",n)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,s){return n("div",{key:s,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(n){return e.inputValue(t)}}},[void 0!==t.value?n("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?n("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3506:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},9408:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"mb-2 ns-switch"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,s){return n("button",{key:s,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(n){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},4255:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var s=n(7757),i=n.n(s),r=n(9671),a=n(8603),o=n(7389),l=n(3601);function c(e,t,n,s,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(s,i)}const d={name:"ns-media",props:["popup"],components:{VueUpload:n(2948)},data:function(){return{pages:[{label:(0,o.__)("Upload"),name:"upload",selected:!1},{label:(0,o.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return r.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:a.Z,__:o.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,o.__)("Confirm Your Action"),message:(0,o.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){r.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=i().mark((function e(){var n,s,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),s=i().mark((function e(t){var s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n[t],e.prev=1,s.progress=1,e.next=5,new Promise((function(e,t){var n=new FormData;n.append("file",s.file),r.ih.post("/api/nexopos/v4/medias",n,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){s.uploaded=!0,s.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),s.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),a=0;case 3:if(!(a0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,r.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(n,s){s!==t.response.data.indexOf(e)&&(n.selected=!1)})),e.selected=!e.selected}}};const u=(0,n(1900).Z)(d,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[n("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[n("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),n("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,s){return n("li",{key:s,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(n){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?n("div",{staticClass:"content w-full overflow-hidden flex"},[n("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[n("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),n("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),n("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[n("ul",e._l(e.files,(function(t,s){return n("li",{key:s,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[n("span",[e._v(e._s(t.file.name))]),e._v(" "),n("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?n("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?n("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[n("div"),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),n("div",{staticClass:"flex flex-auto overflow-hidden"},[n("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[n("div",{staticClass:"flex flex-auto"},[n("div",{staticClass:"p-2 overflow-x-auto"},[n("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,s){return n("div",{key:s},[n("div",{staticClass:"p-2"},[n("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(n){return e.selectResource(t)}}},[n("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?n("div",{staticClass:"flex flex-auto items-center justify-center"},[n("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),n("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0 ",attrs:{id:"preview"}},[n("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?n("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?n("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),n("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),n("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),n("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[n("div",{staticClass:"flex -mx-2 flex-shrink-0"},[n("div",{staticClass:"px-2 flex-shrink-0 flex"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[n("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[n("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?n("div",{staticClass:"ns-button error"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[n("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),n("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[n("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),n("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),n("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?n("div",{staticClass:"px-2"},[n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},3601:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var s=n(7389),i=n(6386),r=n(8603);const a={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:s.__,popupResolver:i.Z,popupCloser:r.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[n("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[n("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),n("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),n("div",{staticClass:"action-buttons flex border-t"},[n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),n("hr",{staticClass:"border-r h-16"}),e._v(" "),n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=8108,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[743,198],{8108:(e,t,n)=>{"use strict";var s=n(538),i=n(7975),r=function(){return n.e(781).then(n.bind(n,8781))},a=function(){return n.e(331).then(n.bind(n,3331))},o=function(){return n.e(179).then(n.bind(n,6179))},l=function(){return n.e(669).then(n.bind(n,3669))},c=(window.nsState,window.nsScreen,window.nsExtraComponents);window.nsComponents=Object.assign(i,c,{nsRegister:r,nsLogin:a,nsPasswordLost:o,nsNewPassword:l}),window.authVueComponent=new s.default({el:"#page-container",components:Object.assign(Object.assign({nsLogin:a,nsRegister:r,nsPasswordLost:o,nsNewPassword:l},c),i)})},9671:(e,t,n)=>{"use strict";n.d(t,{l:()=>V,kq:()=>Z,ih:()=>Y,kX:()=>H});var s=n(6486),i=n(9669),r=n(6300),a=n(8345),o=n(9624),l=n(9248),c=n(230);function d(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=Z.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:s}),new c.y((function(r){n._client[e](t,s,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,r.next(e.data),r.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;r.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&d(t.prototype,n),s&&d(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=n(3);function p(e,t){for(var n=0;n=1e3){for(var n,s=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=s?e/Math.pow(1e3,s):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][s]}return t})),E=n(1356),S=n(9698);function P(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&q(t.prototype,n),s&&q(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()),I=new b({sidebar:["xs","sm","md"].includes(N.breakpoint)?"hidden":"visible"});Y.defineClient(i),window.nsEvent=V,window.nsHttpClient=Y,window.nsSnackBar=H,window.nsCurrency=E.W,window.nsTruncate=S.b,window.nsRawCurrency=E.f,window.nsAbbreviate=$,window.nsState=I,window.nsUrl=L,window.nsScreen=N,window.ChartJS=r,window.EventEmitter=h,window.Popup=x.G,window.RxJS=y,window.FormValidation=k.Z,window.nsCrudHandler=R},7975:(e,t,n)=>{"use strict";n.r(t),n.d(t,{nsAvatar:()=>Q,nsButton:()=>o,nsCheckbox:()=>p,nsCkeditor:()=>O,nsCloseButton:()=>j,nsCrud:()=>U,nsCrudForm:()=>g,nsDate:()=>w,nsDateRangePicker:()=>J.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>_.P,nsIconButton:()=>$,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>C,nsMenu:()=>r,nsMultiselect:()=>x,nsNotice:()=>K.Z,nsNumpad:()=>W.Z,nsPaginate:()=>te.Z,nsSearch:()=>se,nsSelect:()=>u,nsSelectAudio:()=>f,nsSpinner:()=>v,nsSubmenu:()=>a,nsSwitch:()=>M.Z,nsTableRow:()=>m,nsTabs:()=>T,nsTabsItem:()=>F,nsTextarea:()=>y});var s=n(538),i=n(9671),r=s.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,i.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&i.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,n){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),a=s.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),o=s.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=s.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=s.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),d=n(7389),u=s.default.component("ns-select",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},mounted:function(){},methods:{__:d.__},template:'\n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),f=s.default.component("ns-select-audio",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__:d.__,playSelectedSound:function(){this.field.value.length>0&&new Audio(this.field.value).play()}},template:'\n
    \n \n
    \n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),p=s.default.component("ns-checkbox",{data:function(){return{}},props:["checked","field","label"],template:'\n
    \n
    \n \n
    \n {{ label }}\n {{ field.label }}\n
    \n ',computed:{isChecked:function(){return this.field?this.field.value:this.checked}},methods:{toggleIt:function(){void 0!==this.field&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}}),h=n(2242),m=s.default.component("ns-table-row",{props:["options","row","columns","prependOptions","showOptions"],data:function(){return{optionsToggled:!1}},mounted:function(){},methods:{__:d.__,sanitizeHTML:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.getElementsByTagName("script"),s=n.length;s--;)n[s].parentNode.removeChild(n[s]);return t.innerHTML},getElementOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu:function(e){var t=this;if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout((function(){var e=t.$el.querySelectorAll(".relative > .absolute")[0],n=t.$el.querySelectorAll(".relative")[0],s=t.getElementOffset(n);e.style.top=s.top+"px",e.style.left=s.left+"px",n.classList.remove("relative"),n.classList.add("dropdown-holder")}),100);else{var n=this.$el.querySelectorAll(".dropdown-holder")[0];n.classList.remove("dropdown-holder"),n.classList.add("relative")}},handleChanged:function(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync:function(e){var t=this;e.confirm?confirm(e.confirm.message)&&i.ih[e.type.toLowerCase()](e.url).subscribe((function(e){i.kX.success(e.message).subscribe(),t.$emit("reload",t.row)}),(function(e){t.toggleMenu(),i.kX.error(e.message).subscribe()})):(i.l.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup:function(e,t){var n=window.nsExtraComponents[e.component];if(e.component)return n?new Promise((function(s,i){h.G.show(n,{resolve:s,reject:i,row:t,action:e})})):i.kX.error((0,d.__)('Unable to load the component "'.concat(e.component,'". Make sure the component is registered to "nsExtraComponents".'))).subscribe();this.triggerAsync(e)}},template:'\n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n '}),v=s.default.component("ns-spinner",{data:function(){return{}},mounted:function(){},computed:{validatedSize:function(){return this.size||24},validatedBorder:function(){return this.border||8},validatedAnimation:function(){return this.animation||"fast"}},props:["color","size","border"],template:"\n
    \n
    \n
    \n "}),b=n(7266),g=s.default.component("ns-crud-form",{data:function(){return{form:{},globallyChecked:!1,formValidation:new b.Z,rows:[]}},mounted:function(){this.loadForm()},props:["src","create-url","field-class","return-url","submit-url","submit-method","disable-tabs"],computed:{activeTabFields:function(){for(var e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]}},methods:{__:d.__,toggle:function(e){for(var t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},handleShowOptions:function(e){this.rows.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},submit:function(){var e=this;return this.formValidation.validateForm(this.form).length>0?i.kX.error(this.$slots["error-invalid"]?this.$slots["error-invalid"][0].text:"No error message provided for having an invalid form.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():(this.formValidation.disableForm(this.form),void 0===this.submitUrl?i.kX.error(this.$slots["error-no-submit-url"]?this.$slots["error-no-submit-url"][0].text:"No error message provided for not having a valid submit url.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():void i.ih[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,this.formValidation.extractForm(this.form)).subscribe((function(t){if("success"===t.status){if(e.submitMethod&&"post"===e.submitMethod.toLowerCase()&&!1!==e.returnUrl)return document.location=t.data.editUrl||e.returnUrl;i.kX.info(t.message,(0,d.__)("Okay"),{duration:3e3}).subscribe(),e.$emit("save",t)}e.formValidation.enableForm(e.form)}),(function(t){i.kX.error(t.message,void 0,{duration:5e3}).subscribe(),void 0!==t.data&&e.formValidation.triggerError(e.form,t.data),e.formValidation.enableForm(e.form)})))},handleGlobalChange:function(e){this.globallyChecked=e,this.rows.forEach((function(t){return t.$checked=e}))},loadForm:function(){var e=this;i.ih.get("".concat(this.src)).subscribe({next:function(t){e.form=e.parseForm(t.form),i.kq.doAction("ns-crud-form-loaded",e),e.$emit("updated",e.form)},error:function(e){i.kX.error(e.message,"OKAY",{duration:0}).subscribe()}})},parseForm:function(e){e.main.value=void 0===e.main.value?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];var t=0;for(var n in e.tabs)0===t&&(e.tabs[n].active=!0),e.tabs[n].active=void 0!==e.tabs[n].active&&e.tabs[n].active,e.tabs[n].fields=this.formValidation.createFields(e.tabs[n].fields),t++;return e}},template:'\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n
    {{ tab.label }}
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n '}),y=s.default.component("ns-textarea",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),_=n(8737),x=s.default.component("ns-multiselect",{data:function(){return{showPanel:!1,search:""}},props:["field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=void 0!==t.selected&&t.selected,e.field.value&&e.field.value.includes(t.value)&&(t.selected=!0),t}))}},methods:{__:d.__,addOption:function(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout((function(){}),100))},removeOption:function(e,t){var n=this;if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout((function(){n.search=""}),100),!1}},mounted:function(){var e=this;this.field.value&&this.field.value.reverse().forEach((function(t){var n=e.field.options.filter((function(e){return e.value===t}));n.length>=0&&e.addOption(n[0])}))},template:'\n
    \n \n
    \n
    \n
    \n
    \n
    \n {{ option.label }}\n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n
    \n '}),w=s.default.component("ns-date",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),k=n(4255),C=s.default.component("ns-media-input",{template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n ',computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},data:function(){return{}},props:["placeholder","leading","type","field"],mounted:function(){},methods:{toggleMedia:function(){var e=this;new Promise((function(t,n){h.G.show(k.default,Object.assign({resolve:t,reject:n},e.field.data||{}))})).then((function(t){"use-selected"===t.event&&(e.field.data&&"url"!==e.field.data.type?e.field.data&&"model"!==e.field.data.type||(e.field.value=t.value[0]):e.field.value=t.value[0].sizes.original,e.$forceUpdate())}))}}}),j=s.default.component("ns-close-button",{template:'\n \n ',methods:{clicked:function(e){this.$emit("click",e)}}}),$=s.default.component("ns-icon-button",{template:'\n \n ',props:["className","buttonClass","type"],methods:{clicked:function(e){this.$emit("click",e)}}}),E=n(1272),S=n.n(E),P=n(5234),D=n.n(P),O=s.default.component("ns-ckeditor",{data:function(){return{editor:D()}},components:{ckeditor:S().component},mounted:function(){},methods:{__:d.__},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),T=s.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),F=s.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),M=n(9408),A=n(2744),q=n(7757),z=n.n(q),V=n(3601),Y=n(8603),H=n(6386);const L={data:function(){return{fields:[],validation:new b.Z}},methods:{__:d.__,popupCloser:Y.Z,popupResolver:H.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var R=n(1900);const Z=(0,R.Z)(L,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[n("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[n("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),n("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return n("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),n("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[n("div",[n("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),n("div",[n("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var N=function(e,t,n,s){return new(n||(n=Promise))((function(i,r){function a(e){try{l(s.next(e))}catch(e){r(e)}}function o(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((s=s.apply(e,t||[])).next())}))};const I={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,d.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:d.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),i.kX.success((0,d.__)("The document has been generated.")).subscribe()}),(function(e){i.kX.error(e.message||(0,d.__)("Unexpected error occured.")).subscribe()}))},clearSelectedEntries:function(){var e=this;h.G.show(V.default,{title:(0,d.__)("Clear Selected Entries ?"),message:(0,d.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var n=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(n,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(n){n.$checked=e,t.refreshRow(n)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){i.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,d.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){i.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){i.kX.error(e.message).subscribe()}}):void 0:i.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,d.__)("No selection has been made.")).subscribe():i.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,d.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return N(this,void 0,void 0,z().mark((function e(){var t,n=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(Z),e.next=4,new Promise((function(e,t){h.G.show(Z,{resolve:e,reject:t,queryFilters:n.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,i.kX.error(t.message).subscribe()}))}}};const U=(0,R.Z)(I,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?n("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[n("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?n("div",{staticClass:"px-2 flex items-center justify-center"},[n("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[n("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),n("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[n("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?n("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[n("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2 flex items-center justify-center"},[n("button",{staticClass:"rounded-full\n text-sm\n h-10\n px-3\n outline-none\n border\n ns-crud-button\n ",on:{click:function(t){return e.refresh()}}},[n("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?n("div",{staticClass:"px-2 flex items-center"},[n("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none ",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():n("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?n("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():n("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?n("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),n("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[n("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[n("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?n("table",{staticClass:"table ns-table w-full"},[n("thead",[n("tr",[n("th",{staticClass:"text-center px-2 border w-16 py-2"},[n("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,s){return n("th",{key:s,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(s)}}},[n("div",{staticClass:"w-full flex justify-between items-center"},[n("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),n("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?n("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?n("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),n("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,s){return n("ns-table-row",{key:s,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():n("tr",[n("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?n("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?n:n[0]}}},[n("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,s){return n("option",{key:s,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),n("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),n("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var W=n(4864),B=n(1726),X=n(7259);const G=s.default.extend({methods:{__:d.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,B.createAvatar)(X,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const Q=(0,R.Z)(G,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[n("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),n("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?n("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?n("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var J=n(4806),K=n(1828),ee=n(1544),te=n(3506);const ne={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:d.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,n,s;e.searchText.length>0&&i.ih[e.method||"post"](e.url,(t={},n=e.searchArgument||"search",s=e.searchText,n in t?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,t)).subscribe({next:function(t){e.results=t},error:function(e){i.kX.error(e.message||(0,d.__)("An unexpected error occured.")).subscribe()}})}),1e3)}},mounted:function(){}};const se=(0,R.Z)(ne,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-search"},[n("div",{staticClass:"input-group info border-2"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),n("div",{staticClass:"relative"},[n("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?n("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,s){return n("li",{key:s,staticClass:"border-b p-2 cursor-pointer",on:{click:function(n){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},8737:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var s=n(538),i=n(4806),r=n(2744),a=n(9408),o=s.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:i.Z,nsDateTimePicker:r.Z,nsSwitch:a.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\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 '})},1356:(e,t,n)=>{"use strict";n.d(t,{W:()=>c,f:()=>d});var s=n(2077),i=n.n(s),r=n(538),a=n(6740),o=n.n(a),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=r.default.filter("currency",(function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===s){var r={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=o()(e,r).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),d=function(e){var t="0.".concat(l);return parseFloat(i()(e).format(t))}},9698:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var s=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,n)=>{"use strict";function s(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var s=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&s.push(i),e.tabs[n].errors=s.flat(),t.push(s.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var s=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===s.length&&e.tabs[s[0]].fields.forEach((function(e){e.name===s[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var s in t.errors)n(s)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var s in t.errors)n(s)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(s,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){!0===n[t.identifier]&&e.errors.splice(s,1)}))}return e}}],n&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,n)=>{"use strict";n.d(t,{__:()=>s,c:()=>i});var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},8603:(e,t,n)=>{"use strict";function s(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>s})},6386:(e,t,n)=>{"use strict";function s(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>s})},2242:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var s=n(7757),i=n.n(s),r=n(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new r.x}var t,n,s;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,s,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,i().mark((function a(){var o,l,c,d=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){d.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=r,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],s=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(s);return i.open(t,n),i}}],n&&o(t.prototype,n),s&&o(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var s=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return s.Observable.create((function(s){var r=n.__createSnack({message:e,label:t,type:i.type}),a=r.buttonNode,o=(r.textNode,r.snackWrapper,r.sampleSnack);a.addEventListener("click",(function(e){s.onNext(a),s.onCompleted(),o.remove()})),n.__startTimer(i.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,s=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){s()})),s()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,s=e.type,i=void 0===s?"info":s,r=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),d="",u="";switch(i){case"info":d="",u="info";break;case"error":d="",u="error";break;case"success":d="",u="success"}return o.textContent=t,o.setAttribute("class","pr-2"),n&&(l.setAttribute("class","ns-button default"),c.textContent=n,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(d)),l.appendChild(c)),a.appendChild(o),a.appendChild(l),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(u)),r.appendChild(a),null===document.getElementById("snack-wrapper")&&(r.setAttribute("id","snack-wrapper"),r.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(r)),{snackWrapper:r,sampleSnack:a,buttonsWrapper:l,buttonNode:c,textNode:o}}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},6700:(e,t,n)=>{var s={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=r(e);return n(t)}function r(e){if(!n.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}i.keys=function(){return Object.keys(s)},i.resolve=r,e.exports=i,i.id=6700},4806:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var s=n(538),i=n(381),r=n.n(i),a=n(7144),o=n.n(a),l=(n(9095),n(7389));const c=s.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:o()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:r()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:r()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?r()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const d=(0,n(1900).Z)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?n("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[n("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),n("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[n("i",{staticClass:"las la-times"})]),e._v(" "),n("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[n("div",{staticClass:"flex justify-between items-center w-full py-2"},[n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},2744:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:i(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return i()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?i()():i()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?i()():i()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:n(7389).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker mb-2"},[e.field?n("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),n("div",{staticClass:"ns-button"},[n("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?n("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?n("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?n("span",{staticClass:"mx-1 text-sm"},[null!==e.date?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?n("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?n("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?n("div",{staticClass:"relative z-10 h-0 w-0"},[n("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[n("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[n("i",{staticClass:"las la-minus"})]),e._v(" "),n("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[n("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,s){return n("div",{key:s,staticClass:"h-8 flex justify-center items-center text-sm"},[[n("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),n("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[n("div",{staticClass:"-mx-1 flex justify-between"},[n("div",{staticClass:"px-1"},[n("div",{staticClass:"-mx-1 flex"},[e.field?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[n("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[n("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),n("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},1544:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?i()():i()(this.date),this.build()},methods:{__:n(7389).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker"},[n("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),n("span",{staticClass:"mx-1 text-sm"},[n("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?n("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?n("div",{staticClass:"relative h-0 w-0 -mb-2"},[n("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),n("div")])]):e._e()])}),[],!1,null,null,null).exports},1828:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[n("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),n("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},4864:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var s=n(7389);function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,n){e.inputValue({value:n})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var n=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",n)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,s){return n("div",{key:s,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(n){return e.inputValue(t)}}},[void 0!==t.value?n("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?n("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3506:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},9408:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"mb-2 ns-switch"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,s){return n("button",{key:s,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(n){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},4255:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var s=n(7757),i=n.n(s),r=n(9671),a=n(8603),o=n(7389),l=n(3601);function c(e,t,n,s,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(s,i)}const d={name:"ns-media",props:["popup"],components:{VueUpload:n(2948)},data:function(){return{pages:[{label:(0,o.__)("Upload"),name:"upload",selected:!1},{label:(0,o.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return r.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:a.Z,__:o.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,o.__)("Confirm Your Action"),message:(0,o.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){r.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=i().mark((function e(){var n,s,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),s=i().mark((function e(t){var s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n[t],e.prev=1,s.progress=1,e.next=5,new Promise((function(e,t){var n=new FormData;n.append("file",s.file),r.ih.post("/api/nexopos/v4/medias",n,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){s.uploaded=!0,s.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),s.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),a=0;case 3:if(!(a0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,r.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(n,s){s!==t.response.data.indexOf(e)&&(n.selected=!1)})),e.selected=!e.selected}}};const u=(0,n(1900).Z)(d,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[n("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[n("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),n("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,s){return n("li",{key:s,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(n){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?n("div",{staticClass:"content w-full overflow-hidden flex"},[n("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[n("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),n("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),n("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[n("ul",e._l(e.files,(function(t,s){return n("li",{key:s,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[n("span",[e._v(e._s(t.file.name))]),e._v(" "),n("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?n("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?n("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[n("div"),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),n("div",{staticClass:"flex flex-auto overflow-hidden"},[n("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[n("div",{staticClass:"flex flex-auto"},[n("div",{staticClass:"p-2 overflow-x-auto"},[n("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,s){return n("div",{key:s},[n("div",{staticClass:"p-2"},[n("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(n){return e.selectResource(t)}}},[n("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?n("div",{staticClass:"flex flex-auto items-center justify-center"},[n("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),n("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0 ",attrs:{id:"preview"}},[n("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?n("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?n("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),n("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),n("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),n("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[n("div",{staticClass:"flex -mx-2 flex-shrink-0"},[n("div",{staticClass:"px-2 flex-shrink-0 flex"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[n("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[n("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?n("div",{staticClass:"ns-button error"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[n("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),n("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[n("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),n("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),n("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?n("div",{staticClass:"px-2"},[n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},3601:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var s=n(7389),i=n(6386),r=n(8603);const a={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:s.__,popupResolver:i.Z,popupCloser:r.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[n("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[n("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),n("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),n("div",{staticClass:"action-buttons flex border-t"},[n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),n("hr",{staticClass:"border-r h-16"}),e._v(" "),n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=8108,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/public/js/bootstrap.min/bootstrap.js b/public/js/bootstrap.min/bootstrap.js index 6946e7aef..7761b007d 100644 --- a/public/js/bootstrap.min/bootstrap.js +++ b/public/js/bootstrap.min/bootstrap.js @@ -1 +1 @@ -(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[198],{9671:(e,t,n)=>{"use strict";n.d(t,{l:()=>B,kq:()=>M,ih:()=>H,kX:()=>R});var r=n(6486),i=n(9669),s=n(6300),o=n(8345),a=n(9624),c=n(9248),u=n(230);function l(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=M.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:r}),new u.y((function(s){n._client[e](t,r,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,s.next(e.data),s.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;s.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&l(t.prototype,n),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),p=n(3);function f(e,t){for(var n=0;n=1e3){for(var n,r=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=r?e/Math.pow(1e3,r):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][r]}return t})),P=n(1356),O=n(9698);function C(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&W(t.prototype,n),r&&W(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()),V=new m({sidebar:["xs","sm","md"].includes(N.breakpoint)?"hidden":"visible"});H.defineClient(i),window.nsEvent=B,window.nsHttpClient=H,window.nsSnackBar=R,window.nsCurrency=P.W,window.nsTruncate=O.b,window.nsRawCurrency=P.f,window.nsAbbreviate=S,window.nsState=V,window.nsUrl=Z,window.nsScreen=N,window.ChartJS=s,window.EventEmitter=v,window.Popup=k.G,window.RxJS=w,window.FormValidation=x.Z,window.nsCrudHandler=I},1356:(e,t,n)=>{"use strict";n.d(t,{W:()=>u,f:()=>l});var r=n(2077),i=n.n(r),s=n(538),o=n(6740),a=n.n(o),c=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),u=s.default.filter("currency",(function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===r){var s={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=a()(e,s).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),l=function(e){var t="0.".concat(c);return parseFloat(i()(e).format(t))}},9698:(e,t,n)=>{"use strict";n.d(t,{b:()=>r});var r=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var r=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&r.push(i),e.tabs[n].errors=r.flat(),t.push(r.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var r=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===r.length&&e.tabs[r[0]].fields.forEach((function(e){e.name===r[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var r in t.errors)n(r)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var r in t.errors)n(r)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,r){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(r,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,r){!0===n[t.identifier]&&e.errors.splice(r,1)}))}return e}}],n&&r(t.prototype,n),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,n)=>{"use strict";n.d(t,{__:()=>r,c:()=>i});var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},8603:(e,t,n)=>{"use strict";function r(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>r})},6386:(e,t,n)=>{"use strict";function r(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>r})},2242:(e,t,n)=>{"use strict";n.d(t,{G:()=>u});var r=n(7757),i=n.n(r),s=n(9248);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new s.x}var t,n,r;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,r,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(this,void 0,void 0,i().mark((function o(){var a,c,u,l=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:a=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",a.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){l.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),c=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",c),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),u=Vue.extend(e),this.instance=new u({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=s,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),o,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],r=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(r);return i.open(t,n),i}}],n&&a(t.prototype,n),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var r=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return r.Observable.create((function(r){var s=n.__createSnack({message:e,label:t,type:i.type}),o=s.buttonNode,a=(s.textNode,s.snackWrapper,s.sampleSnack);o.addEventListener("click",(function(e){r.onNext(o),r.onCompleted(),a.remove()})),n.__startTimer(i.duration,a)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,r=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){r()})),r()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,r=e.type,i=void 0===r?"info":r,s=document.getElementById("snack-wrapper")||document.createElement("div"),o=document.createElement("div"),a=document.createElement("p"),c=document.createElement("div"),u=document.createElement("button"),l="",d="";switch(i){case"info":l="",d="info";break;case"error":l="",d="error";break;case"success":l="",d="success"}return a.textContent=t,a.setAttribute("class","pr-2"),n&&(c.setAttribute("class","ns-button default"),u.textContent=n,u.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(l)),c.appendChild(u)),o.appendChild(a),o.appendChild(c),o.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(d)),s.appendChild(o),null===document.getElementById("snack-wrapper")&&(s.setAttribute("id","snack-wrapper"),s.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(s)),{snackWrapper:s,sampleSnack:o,buttonsWrapper:c,buttonNode:u,textNode:a}}}],n&&i(t.prototype,n),s&&i(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},6700:(e,t,n)=>{var r={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=s,e.exports=i,i.id=6700}},e=>{e.O(0,[898],(()=>{return t=9671,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[198],{9671:(e,t,n)=>{"use strict";n.d(t,{l:()=>B,kq:()=>M,ih:()=>H,kX:()=>R});var r=n(6486),i=n(9669),s=n(6300),o=n(8345),a=n(9624),c=n(9248),u=n(230);function l(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=M.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:r}),new u.y((function(s){n._client[e](t,r,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,s.next(e.data),s.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;s.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&l(t.prototype,n),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),p=n(3);function f(e,t){for(var n=0;n=1e3){for(var n,r=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=r?e/Math.pow(1e3,r):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][r]}return t})),P=n(1356),O=n(9698);function C(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&W(t.prototype,n),r&&W(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()),V=new m({sidebar:["xs","sm","md"].includes(N.breakpoint)?"hidden":"visible"});H.defineClient(i),window.nsEvent=B,window.nsHttpClient=H,window.nsSnackBar=R,window.nsCurrency=P.W,window.nsTruncate=O.b,window.nsRawCurrency=P.f,window.nsAbbreviate=S,window.nsState=V,window.nsUrl=Z,window.nsScreen=N,window.ChartJS=s,window.EventEmitter=v,window.Popup=k.G,window.RxJS=w,window.FormValidation=x.Z,window.nsCrudHandler=I},1356:(e,t,n)=>{"use strict";n.d(t,{W:()=>u,f:()=>l});var r=n(2077),i=n.n(r),s=n(538),o=n(6740),a=n.n(o),c=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),u=s.default.filter("currency",(function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===r){var s={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=a()(e,s).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),l=function(e){var t="0.".concat(c);return parseFloat(i()(e).format(t))}},9698:(e,t,n)=>{"use strict";n.d(t,{b:()=>r});var r=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var r=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&r.push(i),e.tabs[n].errors=r.flat(),t.push(r.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var r=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===r.length&&e.tabs[r[0]].fields.forEach((function(e){e.name===r[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var r in t.errors)n(r)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var r in t.errors)n(r)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,r){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(r,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,r){!0===n[t.identifier]&&e.errors.splice(r,1)}))}return e}}],n&&r(t.prototype,n),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,n)=>{"use strict";n.d(t,{__:()=>r,c:()=>i});var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},8603:(e,t,n)=>{"use strict";function r(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>r})},6386:(e,t,n)=>{"use strict";function r(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>r})},2242:(e,t,n)=>{"use strict";n.d(t,{G:()=>u});var r=n(7757),i=n.n(r),s=n(9248);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new s.x}var t,n,r;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,r,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(this,void 0,void 0,i().mark((function o(){var a,c,u,l=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:a=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",a.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){l.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),c=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",c),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),u=Vue.extend(e),this.instance=new u({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=s,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),o,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],r=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(r);return i.open(t,n),i}}],n&&a(t.prototype,n),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var r=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return r.Observable.create((function(r){var s=n.__createSnack({message:e,label:t,type:i.type}),o=s.buttonNode,a=(s.textNode,s.snackWrapper,s.sampleSnack);o.addEventListener("click",(function(e){r.onNext(o),r.onCompleted(),a.remove()})),n.__startTimer(i.duration,a)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,r=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){r()})),r()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,r=e.type,i=void 0===r?"info":r,s=document.getElementById("snack-wrapper")||document.createElement("div"),o=document.createElement("div"),a=document.createElement("p"),c=document.createElement("div"),u=document.createElement("button"),l="",d="";switch(i){case"info":l="",d="info";break;case"error":l="",d="error";break;case"success":l="",d="success"}return a.textContent=t,a.setAttribute("class","pr-2"),n&&(c.setAttribute("class","ns-button default"),u.textContent=n,u.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(l)),c.appendChild(u)),o.appendChild(a),o.appendChild(c),o.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(d)),s.appendChild(o),null===document.getElementById("snack-wrapper")&&(s.setAttribute("id","snack-wrapper"),s.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(s)),{snackWrapper:s,sampleSnack:o,buttonsWrapper:c,buttonNode:u,textNode:a}}}],n&&i(t.prototype,n),s&&i(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},6700:(e,t,n)=>{var r={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=s,e.exports=i,i.id=6700}},e=>{e.O(0,[898],(()=>{return t=9671,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/public/js/cashier.min.js b/public/js/cashier.min.js index 7d82fa561..0eb4bbb5d 100644 --- a/public/js/cashier.min.js +++ b/public/js/cashier.min.js @@ -1 +1 @@ -(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[540,198],{9671:(e,t,n)=>{"use strict";n.d(t,{l:()=>B,kq:()=>M,ih:()=>R,kX:()=>H});var r=n(6486),i=n(9669),s=n(6300),o=n(8345),a=n(9624),c=n(9248),u=n(230);function l(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=M.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:r}),new u.y((function(s){n._client[e](t,r,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,s.next(e.data),s.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;s.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&l(t.prototype,n),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),p=n(3);function f(e,t){for(var n=0;n=1e3){for(var n,r=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=r?e/Math.pow(1e3,r):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][r]}return t})),S=n(1356),O=n(9698);function C(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&W(t.prototype,n),r&&W(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()),V=new m({sidebar:["xs","sm","md"].includes(N.breakpoint)?"hidden":"visible"});R.defineClient(i),window.nsEvent=B,window.nsHttpClient=R,window.nsSnackBar=H,window.nsCurrency=S.W,window.nsTruncate=O.b,window.nsRawCurrency=S.f,window.nsAbbreviate=P,window.nsState=V,window.nsUrl=Z,window.nsScreen=N,window.ChartJS=s,window.EventEmitter=v,window.Popup=k.G,window.RxJS=w,window.FormValidation=_.Z,window.nsCrudHandler=I},5005:(e,t,n)=>{"use strict";var r=n(6515),i=n(9671),s=n(7389);function o(e,t){for(var n=0;n{"use strict";n.d(t,{W:()=>u,f:()=>l});var r=n(2077),i=n.n(r),s=n(538),o=n(6740),a=n.n(o),c=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),u=s.default.filter("currency",(function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===r){var s={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=a()(e,s).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),l=function(e){var t="0.".concat(c);return parseFloat(i()(e).format(t))}},9698:(e,t,n)=>{"use strict";n.d(t,{b:()=>r});var r=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var r=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&r.push(i),e.tabs[n].errors=r.flat(),t.push(r.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var r=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===r.length&&e.tabs[r[0]].fields.forEach((function(e){e.name===r[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var r in t.errors)n(r)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var r in t.errors)n(r)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,r){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(r,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,r){!0===n[t.identifier]&&e.errors.splice(r,1)}))}return e}}],n&&r(t.prototype,n),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,n)=>{"use strict";n.d(t,{__:()=>r,c:()=>i});var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},8603:(e,t,n)=>{"use strict";function r(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>r})},6386:(e,t,n)=>{"use strict";function r(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>r})},2242:(e,t,n)=>{"use strict";n.d(t,{G:()=>u});var r=n(7757),i=n.n(r),s=n(9248);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new s.x}var t,n,r;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,r,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(this,void 0,void 0,i().mark((function o(){var a,c,u,l=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:a=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",a.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){l.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),c=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",c),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),u=Vue.extend(e),this.instance=new u({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=s,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),o,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],r=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(r);return i.open(t,n),i}}],n&&a(t.prototype,n),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var r=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return r.Observable.create((function(r){var s=n.__createSnack({message:e,label:t,type:i.type}),o=s.buttonNode,a=(s.textNode,s.snackWrapper,s.sampleSnack);o.addEventListener("click",(function(e){r.onNext(o),r.onCompleted(),a.remove()})),n.__startTimer(i.duration,a)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,r=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){r()})),r()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,r=e.type,i=void 0===r?"info":r,s=document.getElementById("snack-wrapper")||document.createElement("div"),o=document.createElement("div"),a=document.createElement("p"),c=document.createElement("div"),u=document.createElement("button"),l="",d="";switch(i){case"info":l="",d="info";break;case"error":l="",d="error";break;case"success":l="",d="success"}return a.textContent=t,a.setAttribute("class","pr-2"),n&&(c.setAttribute("class","ns-button default"),u.textContent=n,u.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(l)),c.appendChild(u)),o.appendChild(a),o.appendChild(c),o.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(d)),s.appendChild(o),null===document.getElementById("snack-wrapper")&&(s.setAttribute("id","snack-wrapper"),s.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(s)),{snackWrapper:s,sampleSnack:o,buttonsWrapper:c,buttonNode:u,textNode:a}}}],n&&i(t.prototype,n),s&&i(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},6700:(e,t,n)=>{var r={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=s,e.exports=i,i.id=6700}},e=>{e.O(0,[898],(()=>{return t=5005,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[540,198],{9671:(e,t,n)=>{"use strict";n.d(t,{l:()=>B,kq:()=>M,ih:()=>R,kX:()=>H});var r=n(6486),i=n(9669),s=n(6300),o=n(8345),a=n(9624),c=n(9248),u=n(230);function l(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=M.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:r}),new u.y((function(s){n._client[e](t,r,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,s.next(e.data),s.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;s.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&l(t.prototype,n),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),p=n(3);function f(e,t){for(var n=0;n=1e3){for(var n,r=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=r?e/Math.pow(1e3,r):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][r]}return t})),S=n(1356),O=n(9698);function C(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&W(t.prototype,n),r&&W(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()),V=new m({sidebar:["xs","sm","md"].includes(N.breakpoint)?"hidden":"visible"});R.defineClient(i),window.nsEvent=B,window.nsHttpClient=R,window.nsSnackBar=H,window.nsCurrency=S.W,window.nsTruncate=O.b,window.nsRawCurrency=S.f,window.nsAbbreviate=P,window.nsState=V,window.nsUrl=Z,window.nsScreen=N,window.ChartJS=s,window.EventEmitter=v,window.Popup=k.G,window.RxJS=w,window.FormValidation=_.Z,window.nsCrudHandler=I},5005:(e,t,n)=>{"use strict";var r=n(6515),i=n(9671),s=n(7389);function o(e,t){for(var n=0;n{"use strict";n.d(t,{W:()=>u,f:()=>l});var r=n(2077),i=n.n(r),s=n(538),o=n(6740),a=n.n(o),c=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),u=s.default.filter("currency",(function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===r){var s={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=a()(e,s).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),l=function(e){var t="0.".concat(c);return parseFloat(i()(e).format(t))}},9698:(e,t,n)=>{"use strict";n.d(t,{b:()=>r});var r=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var r=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&r.push(i),e.tabs[n].errors=r.flat(),t.push(r.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var r=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===r.length&&e.tabs[r[0]].fields.forEach((function(e){e.name===r[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var r in t.errors)n(r)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var r in t.errors)n(r)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,r){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(r,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,r){!0===n[t.identifier]&&e.errors.splice(r,1)}))}return e}}],n&&r(t.prototype,n),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,n)=>{"use strict";n.d(t,{__:()=>r,c:()=>i});var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},8603:(e,t,n)=>{"use strict";function r(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>r})},6386:(e,t,n)=>{"use strict";function r(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>r})},2242:(e,t,n)=>{"use strict";n.d(t,{G:()=>u});var r=n(7757),i=n.n(r),s=n(9248);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new s.x}var t,n,r;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,r,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(this,void 0,void 0,i().mark((function o(){var a,c,u,l=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:a=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",a.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){l.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),c=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",c),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),u=Vue.extend(e),this.instance=new u({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=s,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),o,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],r=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(r);return i.open(t,n),i}}],n&&a(t.prototype,n),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var r=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return r.Observable.create((function(r){var s=n.__createSnack({message:e,label:t,type:i.type}),o=s.buttonNode,a=(s.textNode,s.snackWrapper,s.sampleSnack);o.addEventListener("click",(function(e){r.onNext(o),r.onCompleted(),a.remove()})),n.__startTimer(i.duration,a)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,r=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){r()})),r()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,r=e.type,i=void 0===r?"info":r,s=document.getElementById("snack-wrapper")||document.createElement("div"),o=document.createElement("div"),a=document.createElement("p"),c=document.createElement("div"),u=document.createElement("button"),l="",d="";switch(i){case"info":l="",d="info";break;case"error":l="",d="error";break;case"success":l="",d="success"}return a.textContent=t,a.setAttribute("class","pr-2"),n&&(c.setAttribute("class","ns-button default"),u.textContent=n,u.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(l)),c.appendChild(u)),o.appendChild(a),o.appendChild(c),o.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(d)),s.appendChild(o),null===document.getElementById("snack-wrapper")&&(s.setAttribute("id","snack-wrapper"),s.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(s)),{snackWrapper:s,sampleSnack:o,buttonsWrapper:c,buttonNode:u,textNode:a}}}],n&&i(t.prototype,n),s&&i(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},6700:(e,t,n)=>{var r={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=s,e.exports=i,i.id=6700}},e=>{e.O(0,[898],(()=>{return t=5005,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/public/js/dashboard.min.js b/public/js/dashboard.min.js index d0474fe74..d26a198a6 100644 --- a/public/js/dashboard.min.js +++ b/public/js/dashboard.min.js @@ -1 +1 @@ -(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[997,198],{9671:(e,t,n)=>{"use strict";n.d(t,{l:()=>B,kq:()=>M,ih:()=>R,kX:()=>H});var r=n(6486),i=n(9669),s=n(6300),o=n(8345),a=n(9624),u=n(9248),c=n(230);function l(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=M.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:r}),new c.y((function(s){n._client[e](t,r,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,s.next(e.data),s.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;s.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&l(t.prototype,n),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),p=n(3);function f(e,t){for(var n=0;n=1e3){for(var n,r=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=r?e/Math.pow(1e3,r):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][r]}return t})),P=n(1356),C=n(9698);function O(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&W(t.prototype,n),r&&W(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()),V=new m({sidebar:["xs","sm","md"].includes(N.breakpoint)?"hidden":"visible"});R.defineClient(i),window.nsEvent=B,window.nsHttpClient=R,window.nsSnackBar=H,window.nsCurrency=P.W,window.nsTruncate=C.b,window.nsRawCurrency=P.f,window.nsAbbreviate=E,window.nsState=V,window.nsUrl=Z,window.nsScreen=N,window.ChartJS=s,window.EventEmitter=h,window.Popup=k.G,window.RxJS=w,window.FormValidation=_.Z,window.nsCrudHandler=I},7775:(e,t,n)=>{"use strict";var r=n(6515),i=n(9671);function s(e,t){for(var n=0;n{"use strict";n.d(t,{W:()=>c,f:()=>l});var r=n(2077),i=n.n(r),s=n(538),o=n(6740),a=n.n(o),u=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=s.default.filter("currency",(function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===r){var s={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=a()(e,s).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),l=function(e){var t="0.".concat(u);return parseFloat(i()(e).format(t))}},9698:(e,t,n)=>{"use strict";n.d(t,{b:()=>r});var r=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var r=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&r.push(i),e.tabs[n].errors=r.flat(),t.push(r.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var r=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===r.length&&e.tabs[r[0]].fields.forEach((function(e){e.name===r[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var r in t.errors)n(r)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var r in t.errors)n(r)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,r){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(r,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,r){!0===n[t.identifier]&&e.errors.splice(r,1)}))}return e}}],n&&r(t.prototype,n),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,n)=>{"use strict";n.d(t,{__:()=>r,c:()=>i});var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},8603:(e,t,n)=>{"use strict";function r(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>r})},6386:(e,t,n)=>{"use strict";function r(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>r})},2242:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var r=n(7757),i=n.n(r),s=n(9248);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new s.x}var t,n,r;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,r,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u(this,void 0,void 0,i().mark((function o(){var a,u,c,l=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:a=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",a.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){l.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),u=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",u),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=s,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),o,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],r=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(r);return i.open(t,n),i}}],n&&a(t.prototype,n),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var r=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return r.Observable.create((function(r){var s=n.__createSnack({message:e,label:t,type:i.type}),o=s.buttonNode,a=(s.textNode,s.snackWrapper,s.sampleSnack);o.addEventListener("click",(function(e){r.onNext(o),r.onCompleted(),a.remove()})),n.__startTimer(i.duration,a)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,r=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){r()})),r()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,r=e.type,i=void 0===r?"info":r,s=document.getElementById("snack-wrapper")||document.createElement("div"),o=document.createElement("div"),a=document.createElement("p"),u=document.createElement("div"),c=document.createElement("button"),l="",d="";switch(i){case"info":l="",d="info";break;case"error":l="",d="error";break;case"success":l="",d="success"}return a.textContent=t,a.setAttribute("class","pr-2"),n&&(u.setAttribute("class","ns-button default"),c.textContent=n,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(l)),u.appendChild(c)),o.appendChild(a),o.appendChild(u),o.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(d)),s.appendChild(o),null===document.getElementById("snack-wrapper")&&(s.setAttribute("id","snack-wrapper"),s.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(s)),{snackWrapper:s,sampleSnack:o,buttonsWrapper:u,buttonNode:c,textNode:a}}}],n&&i(t.prototype,n),s&&i(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},6700:(e,t,n)=>{var r={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=s,e.exports=i,i.id=6700}},e=>{e.O(0,[898],(()=>{return t=7775,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[997,198],{9671:(e,t,n)=>{"use strict";n.d(t,{l:()=>B,kq:()=>M,ih:()=>R,kX:()=>H});var r=n(6486),i=n(9669),s=n(6300),o=n(8345),a=n(9624),u=n(9248),c=n(230);function l(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=M.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:r}),new c.y((function(s){n._client[e](t,r,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,s.next(e.data),s.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;s.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&l(t.prototype,n),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),p=n(3);function f(e,t){for(var n=0;n=1e3){for(var n,r=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=r?e/Math.pow(1e3,r):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][r]}return t})),P=n(1356),C=n(9698);function O(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&W(t.prototype,n),r&&W(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()),V=new m({sidebar:["xs","sm","md"].includes(N.breakpoint)?"hidden":"visible"});R.defineClient(i),window.nsEvent=B,window.nsHttpClient=R,window.nsSnackBar=H,window.nsCurrency=P.W,window.nsTruncate=C.b,window.nsRawCurrency=P.f,window.nsAbbreviate=E,window.nsState=V,window.nsUrl=Z,window.nsScreen=N,window.ChartJS=s,window.EventEmitter=h,window.Popup=k.G,window.RxJS=w,window.FormValidation=_.Z,window.nsCrudHandler=I},7775:(e,t,n)=>{"use strict";var r=n(6515),i=n(9671);function s(e,t){for(var n=0;n{"use strict";n.d(t,{W:()=>c,f:()=>l});var r=n(2077),i=n.n(r),s=n(538),o=n(6740),a=n.n(o),u=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=s.default.filter("currency",(function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===r){var s={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=a()(e,s).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),l=function(e){var t="0.".concat(u);return parseFloat(i()(e).format(t))}},9698:(e,t,n)=>{"use strict";n.d(t,{b:()=>r});var r=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var r=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&r.push(i),e.tabs[n].errors=r.flat(),t.push(r.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var r=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===r.length&&e.tabs[r[0]].fields.forEach((function(e){e.name===r[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var r in t.errors)n(r)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var r in t.errors)n(r)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,r){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(r,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,r){!0===n[t.identifier]&&e.errors.splice(r,1)}))}return e}}],n&&r(t.prototype,n),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,n)=>{"use strict";n.d(t,{__:()=>r,c:()=>i});var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},8603:(e,t,n)=>{"use strict";function r(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>r})},6386:(e,t,n)=>{"use strict";function r(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>r})},2242:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var r=n(7757),i=n.n(r),s=n(9248);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new s.x}var t,n,r;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,r,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u(this,void 0,void 0,i().mark((function o(){var a,u,c,l=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:a=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",a.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){l.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),u=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",u),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=s,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),o,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],r=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(r);return i.open(t,n),i}}],n&&a(t.prototype,n),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var r=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return r.Observable.create((function(r){var s=n.__createSnack({message:e,label:t,type:i.type}),o=s.buttonNode,a=(s.textNode,s.snackWrapper,s.sampleSnack);o.addEventListener("click",(function(e){r.onNext(o),r.onCompleted(),a.remove()})),n.__startTimer(i.duration,a)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,r=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){r()})),r()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,r=e.type,i=void 0===r?"info":r,s=document.getElementById("snack-wrapper")||document.createElement("div"),o=document.createElement("div"),a=document.createElement("p"),u=document.createElement("div"),c=document.createElement("button"),l="",d="";switch(i){case"info":l="",d="info";break;case"error":l="",d="error";break;case"success":l="",d="success"}return a.textContent=t,a.setAttribute("class","pr-2"),n&&(u.setAttribute("class","ns-button default"),c.textContent=n,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(l)),u.appendChild(c)),o.appendChild(a),o.appendChild(u),o.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(d)),s.appendChild(o),null===document.getElementById("snack-wrapper")&&(s.setAttribute("id","snack-wrapper"),s.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(s)),{snackWrapper:s,sampleSnack:o,buttonsWrapper:u,buttonNode:c,textNode:a}}}],n&&i(t.prototype,n),s&&i(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},6700:(e,t,n)=>{var r={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=s,e.exports=i,i.id=6700}},e=>{e.O(0,[898],(()=>{return t=7775,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/public/js/popups.min.js b/public/js/popups.min.js index 4cc5d9407..ee76c16cf 100644 --- a/public/js/popups.min.js +++ b/public/js/popups.min.js @@ -1 +1 @@ -(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[820,198,89,110,4],{9671:(e,t,s)=>{"use strict";s.d(t,{l:()=>Z,kq:()=>L,ih:()=>R,kX:()=>Y});var n=s(6486),i=s(9669),r=s(6300),a=s(8345),o=s(9624),l=s(9248),c=s(230);function u(e,t){for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,s)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,s)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var s=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=L.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:n}),new c.y((function(r){s._client[e](t,n,Object.assign(Object.assign({},s._client.defaults[e]),i)).then((function(e){s._lastRequestData=e,r.next(e.data),r.complete(),s._subject.next({identifier:"async.stop"})})).catch((function(e){var t;r.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),s._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,s=e.value;this._subject.next({identifier:t,value:s})}}],s&&u(t.prototype,s),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=s(3);function p(e,t){for(var s=0;s=1e3){for(var s,n=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((s=parseFloat((0!=n?e/Math.pow(1e3,n):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}s%1!=0&&(s=s.toFixed(1)),t=s+["","k","m","b","t"][n]}return t})),$=s(1356),O=s(9698);function S(e,t){for(var s=0;s0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&q(t.prototype,s),n&&q(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()),U=new b({sidebar:["xs","sm","md"].includes(H.breakpoint)?"hidden":"visible"});R.defineClient(i),window.nsEvent=Z,window.nsHttpClient=R,window.nsSnackBar=Y,window.nsCurrency=$.W,window.nsTruncate=O.b,window.nsRawCurrency=$.f,window.nsAbbreviate=P,window.nsState=U,window.nsUrl=z,window.nsScreen=H,window.ChartJS=r,window.EventEmitter=m,window.Popup=x.G,window.RxJS=y,window.FormValidation=C.Z,window.nsCrudHandler=I},7975:(e,t,s)=>{"use strict";s.r(t),s.d(t,{nsAvatar:()=>B,nsButton:()=>o,nsCheckbox:()=>p,nsCkeditor:()=>E,nsCloseButton:()=>j,nsCrud:()=>N,nsCrudForm:()=>_,nsDate:()=>w,nsDateRangePicker:()=>K.Z,nsDateTimePicker:()=>V.Z,nsDatepicker:()=>ee.Z,nsField:()=>g.P,nsIconButton:()=>P,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>k,nsMenu:()=>r,nsMultiselect:()=>x,nsNotice:()=>J.Z,nsNumpad:()=>X.Z,nsPaginate:()=>te.Z,nsSearch:()=>ne,nsSelect:()=>d,nsSelectAudio:()=>f,nsSpinner:()=>h,nsSubmenu:()=>a,nsSwitch:()=>A.Z,nsTableRow:()=>v,nsTabs:()=>T,nsTabsItem:()=>F,nsTextarea:()=>y});var n=s(538),i=s(9671),r=n.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,i.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&i.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,s){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),a=n.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),o=n.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=n.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=n.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),u=s(7389),d=n.default.component("ns-select",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},mounted:function(){},methods:{__:u.__},template:'\n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),f=n.default.component("ns-select-audio",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__:u.__,playSelectedSound:function(){this.field.value.length>0&&new Audio(this.field.value).play()}},template:'\n
    \n \n
    \n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),p=n.default.component("ns-checkbox",{data:function(){return{}},props:["checked","field","label"],template:'\n
    \n
    \n \n
    \n {{ label }}\n {{ field.label }}\n
    \n ',computed:{isChecked:function(){return this.field?this.field.value:this.checked}},methods:{toggleIt:function(){void 0!==this.field&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}}),m=s(2242),v=n.default.component("ns-table-row",{props:["options","row","columns","prependOptions","showOptions"],data:function(){return{optionsToggled:!1}},mounted:function(){},methods:{__:u.__,sanitizeHTML:function(e){var t=document.createElement("div");t.innerHTML=e;for(var s=t.getElementsByTagName("script"),n=s.length;n--;)s[n].parentNode.removeChild(s[n]);return t.innerHTML},getElementOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu:function(e){var t=this;if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout((function(){var e=t.$el.querySelectorAll(".relative > .absolute")[0],s=t.$el.querySelectorAll(".relative")[0],n=t.getElementOffset(s);e.style.top=n.top+"px",e.style.left=n.left+"px",s.classList.remove("relative"),s.classList.add("dropdown-holder")}),100);else{var s=this.$el.querySelectorAll(".dropdown-holder")[0];s.classList.remove("dropdown-holder"),s.classList.add("relative")}},handleChanged:function(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync:function(e){var t=this;e.confirm?confirm(e.confirm.message)&&i.ih[e.type.toLowerCase()](e.url).subscribe((function(e){i.kX.success(e.message).subscribe(),t.$emit("reload",t.row)}),(function(e){t.toggleMenu(),i.kX.error(e.message).subscribe()})):(i.l.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup:function(e,t){var s=window.nsExtraComponents[e.component];if(e.component)return s?new Promise((function(n,i){m.G.show(s,{resolve:n,reject:i,row:t,action:e})})):i.kX.error((0,u.__)('Unable to load the component "'.concat(e.component,'". Make sure the component is registered to "nsExtraComponents".'))).subscribe();this.triggerAsync(e)}},template:'\n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n '}),h=n.default.component("ns-spinner",{data:function(){return{}},mounted:function(){},computed:{validatedSize:function(){return this.size||24},validatedBorder:function(){return this.border||8},validatedAnimation:function(){return this.animation||"fast"}},props:["color","size","border"],template:"\n
    \n
    \n
    \n "}),b=s(7266),_=n.default.component("ns-crud-form",{data:function(){return{form:{},globallyChecked:!1,formValidation:new b.Z,rows:[]}},mounted:function(){this.loadForm()},props:["src","create-url","field-class","return-url","submit-url","submit-method","disable-tabs"],computed:{activeTabFields:function(){for(var e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]}},methods:{__:u.__,toggle:function(e){for(var t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},handleShowOptions:function(e){this.rows.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},submit:function(){var e=this;return this.formValidation.validateForm(this.form).length>0?i.kX.error(this.$slots["error-invalid"]?this.$slots["error-invalid"][0].text:"No error message provided for having an invalid form.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():(this.formValidation.disableForm(this.form),void 0===this.submitUrl?i.kX.error(this.$slots["error-no-submit-url"]?this.$slots["error-no-submit-url"][0].text:"No error message provided for not having a valid submit url.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():void i.ih[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,this.formValidation.extractForm(this.form)).subscribe((function(t){if("success"===t.status){if(e.submitMethod&&"post"===e.submitMethod.toLowerCase()&&!1!==e.returnUrl)return document.location=t.data.editUrl||e.returnUrl;i.kX.info(t.message,(0,u.__)("Okay"),{duration:3e3}).subscribe(),e.$emit("save",t)}e.formValidation.enableForm(e.form)}),(function(t){i.kX.error(t.message,void 0,{duration:5e3}).subscribe(),void 0!==t.data&&e.formValidation.triggerError(e.form,t.data),e.formValidation.enableForm(e.form)})))},handleGlobalChange:function(e){this.globallyChecked=e,this.rows.forEach((function(t){return t.$checked=e}))},loadForm:function(){var e=this;i.ih.get("".concat(this.src)).subscribe({next:function(t){e.form=e.parseForm(t.form),i.kq.doAction("ns-crud-form-loaded",e),e.$emit("updated",e.form)},error:function(e){i.kX.error(e.message,"OKAY",{duration:0}).subscribe()}})},parseForm:function(e){e.main.value=void 0===e.main.value?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];var t=0;for(var s in e.tabs)0===t&&(e.tabs[s].active=!0),e.tabs[s].active=void 0!==e.tabs[s].active&&e.tabs[s].active,e.tabs[s].fields=this.formValidation.createFields(e.tabs[s].fields),t++;return e}},template:'\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n
    {{ tab.label }}
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n '}),y=n.default.component("ns-textarea",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),g=s(8737),x=n.default.component("ns-multiselect",{data:function(){return{showPanel:!1,search:""}},props:["field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=void 0!==t.selected&&t.selected,e.field.value&&e.field.value.includes(t.value)&&(t.selected=!0),t}))}},methods:{__:u.__,addOption:function(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout((function(){}),100))},removeOption:function(e,t){var s=this;if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout((function(){s.search=""}),100),!1}},mounted:function(){var e=this;this.field.value&&this.field.value.reverse().forEach((function(t){var s=e.field.options.filter((function(e){return e.value===t}));s.length>=0&&e.addOption(s[0])}))},template:'\n
    \n \n
    \n
    \n
    \n
    \n
    \n {{ option.label }}\n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n
    \n '}),w=n.default.component("ns-date",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),C=s(4255),k=n.default.component("ns-media-input",{template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n ',computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},data:function(){return{}},props:["placeholder","leading","type","field"],mounted:function(){},methods:{toggleMedia:function(){var e=this;new Promise((function(t,s){m.G.show(C.default,Object.assign({resolve:t,reject:s},e.field.data||{}))})).then((function(t){"use-selected"===t.event&&(e.field.data&&"url"!==e.field.data.type?e.field.data&&"model"!==e.field.data.type||(e.field.value=t.value[0]):e.field.value=t.value[0].sizes.original,e.$forceUpdate())}))}}}),j=n.default.component("ns-close-button",{template:'\n \n ',methods:{clicked:function(e){this.$emit("click",e)}}}),P=n.default.component("ns-icon-button",{template:'\n \n ',props:["className","buttonClass","type"],methods:{clicked:function(e){this.$emit("click",e)}}}),$=s(1272),O=s.n($),S=s(5234),D=s.n(S),E=n.default.component("ns-ckeditor",{data:function(){return{editor:D()}},components:{ckeditor:O().component},mounted:function(){},methods:{__:u.__},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),T=n.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),F=n.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),A=s(9408),V=s(2744),q=s(7757),M=s.n(q),Z=s(3601),R=s(8603),Y=s(6386);const z={data:function(){return{fields:[],validation:new b.Z}},methods:{__:u.__,popupCloser:R.Z,popupResolver:Y.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var I=s(1900);const L=(0,I.Z)(z,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[s("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[s("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[s("div",[s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var H=function(e,t,s,n){return new(s||(s=Promise))((function(i,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function o(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(a,o)}l((n=n.apply(e,t||[])).next())}))};const U={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,u.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:u.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var s=[];t-3>1&&s.push(1,"...");for(var n=1;n<=e;n++)t+3>n&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),i.kX.success((0,u.__)("The document has been generated.")).subscribe()}),(function(e){i.kX.error(e.message||(0,u.__)("Unexpected error occured.")).subscribe()}))},clearSelectedEntries:function(){var e=this;m.G.show(Z.default,{title:(0,u.__)("Clear Selected Entries ?"),message:(0,u.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var s=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(s,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(s){s.$checked=e,t.refreshRow(s)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){i.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,u.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){i.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){i.kX.error(e.message).subscribe()}}):void 0:i.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,u.__)("No selection has been made.")).subscribe():i.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,u.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return H(this,void 0,void 0,M().mark((function e(){var t,s=this;return M().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(L),e.next=4,new Promise((function(e,t){m.G.show(L,{resolve:e,reject:t,queryFilters:s.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,i.kX.error(t.message).subscribe()}))}}};const N=(0,I.Z)(U,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?s("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[s("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?s("div",{staticClass:"px-2 flex items-center justify-center"},[s("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[s("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),s("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[s("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?s("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[s("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2 flex items-center justify-center"},[s("button",{staticClass:"rounded-full\n text-sm\n h-10\n px-3\n outline-none\n border\n ns-crud-button\n ",on:{click:function(t){return e.refresh()}}},[s("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?s("div",{staticClass:"px-2 flex items-center"},[s("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none ",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():s("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?s("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():s("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?s("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),s("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?s("div",{staticClass:"px-1 flex items-center"},[s("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[s("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),s("div",{staticClass:"px-1 flex items-center"},[s("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[s("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),s("div",{staticClass:"flex"},[s("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",[s("th",{staticClass:"text-center px-2 border w-16 py-2"},[s("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?s("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,n){return s("th",{key:n,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(n)}}},[s("div",{staticClass:"w-full flex justify-between items-center"},[s("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),s("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?s("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?s("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?s("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),s("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,n){return s("ns-table-row",{key:n,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():s("tr",[s("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?s("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?s:s[0]}}},[s("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,n){return s("option",{key:n,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),s("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),s("div",{staticClass:"flex"},[s("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),s("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[s("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,n){return["..."!==e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(s){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[s("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var X=s(4864),Q=s(1726),W=s(7259);const G=n.default.extend({methods:{__:u.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,Q.createAvatar)(W,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const B=(0,I.Z)(G,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[s("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),s("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?s("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?s("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var K=s(4806),J=s(1828),ee=s(1544),te=s(3506);const se={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:u.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,s,n;e.searchText.length>0&&i.ih[e.method||"post"](e.url,(t={},s=e.searchArgument||"search",n=e.searchText,s in t?Object.defineProperty(t,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[s]=n,t)).subscribe({next:function(t){e.results=t},error:function(e){i.kX.error(e.message||(0,u.__)("An unexpected error occured.")).subscribe()}})}),1e3)}},mounted:function(){}};const ne=(0,I.Z)(se,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-search"},[s("div",{staticClass:"input-group info border-2"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),s("div",{staticClass:"relative"},[s("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?s("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,n){return s("li",{key:n,staticClass:"border-b p-2 cursor-pointer",on:{click:function(s){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},8737:(e,t,s)=>{"use strict";s.d(t,{P:()=>o});var n=s(538),i=s(4806),r=s(2744),a=s(9408),o=n.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:i.Z,nsDateTimePicker:r.Z,nsSwitch:a.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\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 '})},1356:(e,t,s)=>{"use strict";s.d(t,{W:()=>c,f:()=>u});var n=s(2077),i=s.n(n),r=s(538),a=s(6740),o=s.n(a),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=r.default.filter("currency",(function(e){var t,s,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===n){var r={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};s=o()(e,r).format()}else s=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(s).concat("after"===ns.currency.ns_currency_position?t:"")})),u=function(e){var t="0.".concat(l);return parseFloat(i()(e).format(t))}},9698:(e,t,s)=>{"use strict";s.d(t,{b:()=>n});var n=s(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,s)=>{"use strict";function n(e,t){for(var s=0;si});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,s,i;return t=e,s=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var s in e.tabs)if(e.tabs[s].fields){var n=[],i=this.validateFieldsErrors(e.tabs[s].fields);i.length>0&&n.push(i),e.tabs[s].errors=n.flat(),t.push(n.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var s in e)0===t&&(e[s].active=!0),e[s].active=void 0!==e[s].active&&e[s].active,e[s].fields=this.createFields(e[s].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var s=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(s,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(s){t.fieldPassCheck(e,s)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var s in e.tabs)void 0===t[s]&&(t[s]={}),t[s]=this.extractFields(e.tabs[s].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var s=function(s){var n=s.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===n.length&&e.tabs[n[0]].fields.forEach((function(e){e.name===n[1]&&t.errors[s].forEach((function(t){var s={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(s)}))})),s===e.main.name&&t.errors[s].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var n in t.errors)s(n)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var s=function(s){e.forEach((function(e){e.name===s&&t.errors[s].forEach((function(t){var s={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(s)}))}))};for(var n in t.errors)s(n)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(s,n){s.identifier===t.identifier&&!0===s.invalid&&e.errors.splice(n,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(s,n){!0===s[t.identifier]&&e.errors.splice(n,1)}))}return e}}],s&&n(t.prototype,s),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,s)=>{"use strict";s.d(t,{__:()=>n,c:()=>i});var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},8603:(e,t,s)=>{"use strict";function n(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var s=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(s+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}s.d(t,{Z:()=>n})},6386:(e,t,s)=>{"use strict";function n(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}s.d(t,{Z:()=>n})},2242:(e,t,s)=>{"use strict";s.d(t,{G:()=>c});var n=s(7757),i=s.n(n),r=s(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var s=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[s-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new r.x}var t,s,n;return t=e,s=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s=0;s<10;s++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,s,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,i().mark((function a(){var o,l,c,u=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){u.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=r,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var s="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(s),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],n=[{key:"show",value:function(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(n);return i.open(t,s),i}}],s&&o(t.prototype,s),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1703:(e,t,s)=>{"use strict";function n(e,t){for(var s=0;si});var i=function(){function e(t){var s=t.settings,n=t.options,i=t.type;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.printingURL={refund:"refund_printing_url",sale:"sale_printing_url",payment:"payment_printing_url"},this.settings=s,this.options=n,this.type=i||"refund"}var t,s,i;return t=e,(s=[{key:"processRegularPrinting",value:function(e){var t=document.querySelector("printing-section");t&&t.remove();var s=this.settings[this.printingURL[this.type]].replace("{reference_id}",e),n=document.createElement("iframe");n.id="printing-section",n.className="hidden",n.src=s,document.body.appendChild(n),setTimeout((function(){document.querySelector("#printing-section").remove()}),5e3)}},{key:"printOrder",value:function(e){"default"===this.options.ns_pos_printing_gateway?this.processRegularPrinting(e):this.processCustomPrinting(e,this.options.ns_pos_printing_gateway)}},{key:"processCustomPrinting",value:function(e,t){nsHooks.applyFilters("ns-order-custom-refund-print",{printed:!1,reference_id:e,gateway:t}).printed||nsSnackBar.error(__("Unsupported print gateway.")).subscribe()}}])&&n(t.prototype,s),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,s)=>{"use strict";s.d(t,{S:()=>r});var n=s(3260);function i(e,t){for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return n.Observable.create((function(n){var r=s.__createSnack({message:e,label:t,type:i.type}),a=r.buttonNode,o=(r.textNode,r.snackWrapper,r.sampleSnack);a.addEventListener("click",(function(e){n.onNext(a),n.onCompleted(),o.remove()})),s.__startTimer(i.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var s,n=function(){e>0&&!1!==e&&(s=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(s)})),t.addEventListener("mouseleave",(function(){n()})),n()}},{key:"__createSnack",value:function(e){var t=e.message,s=e.label,n=e.type,i=void 0===n?"info":n,r=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),u="",d="";switch(i){case"info":u="",d="info";break;case"error":u="",d="error";break;case"success":u="",d="success"}return o.textContent=t,o.setAttribute("class","pr-2"),s&&(l.setAttribute("class","ns-button default"),c.textContent=s,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(u)),l.appendChild(c)),a.appendChild(o),a.appendChild(l),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(d)),r.appendChild(a),null===document.getElementById("snack-wrapper")&&(r.setAttribute("id","snack-wrapper"),r.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(r)),{snackWrapper:r,sampleSnack:a,buttonsWrapper:l,buttonNode:c,textNode:o}}}],s&&i(t.prototype,s),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},3823:(e,t,s)=>{"use strict";var n=s(3613),i=s(9671);const r={name:"ns-products-preview",computed:{product:function(){return this.$popupParams.product}},methods:{__:s(7389).__,changeActiveTab:function(e){this.active=e,"units-quantities"===this.active&&this.loadProductQuantities()},loadProductQuantities:function(){var e=this;this.hasLoadedUnitQuantities=!1,i.ih.get("/api/nexopos/v4/products/".concat(this.product.id,"/units/quantities")).subscribe((function(t){e.unitQuantities=t,e.hasLoadedUnitQuantities=!0}))}},data:function(){return{active:"units-quantities",unitQuantities:[],hasLoadedUnitQuantities:!1}},mounted:function(){var e=this;this.loadProductQuantities(),this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&e.$popup.close()}))}};const a=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg w-6/7-screen lg:w-3/5-screen h-6/7-screen lg:h-4/5-screen ns-box overflow-hidden flex flex-col"},[s("div",{staticClass:"p-2 border-b ns-box-header text-primary text-center font-medium flex justify-between items-center"},[s("div",[e._v("\n "+e._s(e.__("Previewing :"))+" "+e._s(e.product.name)+"\n ")]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.$popup.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex-auto overflow-y-auto ns-box-body"},[s("div",{staticClass:"p-2"},[s("ns-tabs",{attrs:{active:e.active},on:{active:function(t){return e.changeActiveTab(t)}}},[s("ns-tabs-item",{attrs:{label:e.__("Units & Quantities"),identifier:"units-quantities"}},[e.hasLoadedUnitQuantities?s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",[s("th",{staticClass:"p-1 border"},[e._v(e._s(e.__("Unit")))]),e._v(" "),s("th",{staticClass:"text-right p-1 border",attrs:{width:"150"}},[e._v(e._s(e.__("Sale Price")))]),e._v(" "),s("th",{staticClass:"text-right p-1 border",attrs:{width:"150"}},[e._v(e._s(e.__("Wholesale Price")))]),e._v(" "),s("th",{staticClass:"text-right p-1 border",attrs:{width:"150"}},[e._v(e._s(e.__("Quantity")))])])]),e._v(" "),s("tbody",e._l(e.unitQuantities,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"p-1 border text-left"},[e._v(e._s(t.unit.name))]),e._v(" "),s("td",{staticClass:"p-1 border text-right"},[e._v(e._s(e._f("currency")(t.sale_price)))]),e._v(" "),s("td",{staticClass:"p-1 border text-right"},[e._v(e._s(e._f("currency")(t.wholesale_price)))]),e._v(" "),s("td",{staticClass:"p-1 border text-right"},[e._v(e._s(t.quantity))])])})),0)]):e._e(),e._v(" "),e.hasLoadedUnitQuantities?e._e():s("ns-spinner",{attrs:{size:"16",border:"4"}})],1)],1)],1)])])}),[],!1,null,null,null).exports;var o=s(9110),l=s(3601),c=s(9089),u=s(4255),d=s(1345),f=s(3306),p=s(3296),m=s(2004),v={nsOrderPreview:n.Z,nsProductPreview:a,nsAlertPopup:o.default,nsConfirmPopup:l.default,nsPromptPopup:c.default,nsMediaPopup:u.default,nsProcurementQuantity:d.Z,nsOrdersRefund:f.Z,nsSelectPopup:p.Z,nsPOSLoadingPopup:m.default};for(var h in v)window[h]=v[h]},6700:(e,t,s)=>{var n={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=r(e);return s(t)}function r(e){if(!s.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=r,e.exports=i,i.id=6700},4806:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var n=s(538),i=s(381),r=s.n(i),a=s(7144),o=s.n(a),l=(s(9095),s(7389));const c=n.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:o()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:r()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:r()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?r()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const u=(0,s(1900).Z)(c,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[s("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),s("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?s("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[s("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),s("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[s("i",{staticClass:"las la-times"})]),e._v(" "),s("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[s("div",{staticClass:"flex justify-between items-center w-full py-2"},[s("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),s("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():s("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,n){return s("p",{key:n,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},2744:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(381),i=s.n(n);const r={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:i(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return i()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?i()():i()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?i()():i()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:s(7389).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"picker mb-2"},[e.field?s("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),s("div",{staticClass:"ns-button"},[s("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[s("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?s("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?s("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?s("span",{staticClass:"mx-1 text-sm"},[null!==e.date?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?s("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?s("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?s("div",{staticClass:"relative z-10 h-0 w-0"},[s("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[s("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[s("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[s("i",{staticClass:"las la-minus"})]),e._v(" "),s("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),s("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[s("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,n){return s("div",{key:n,staticClass:"h-8 flex justify-center items-center text-sm"},[[s("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(s){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,n){return s("div",{key:n,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(n,i){return s("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===n?s("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(s){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),s("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[s("div",{staticClass:"-mx-1 flex justify-between"},[s("div",{staticClass:"px-1"},[s("div",{staticClass:"-mx-1 flex"},[e.field?s("div",{staticClass:"px-1"},[s("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[s("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?s("div",{staticClass:"px-1"},[s("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[s("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),s("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},1544:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(381),i=s.n(n);const r={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?i()():i()(this.date),this.build()},methods:{__:s(7389).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"picker"},[s("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[s("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),s("span",{staticClass:"mx-1 text-sm"},[s("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?s("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?s("div",{staticClass:"relative h-0 w-0 -mb-2"},[s("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,n){return s("div",{key:n,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(n,i){return s("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===n?s("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(s){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),s("div")])]):e._e()])}),[],!1,null,null,null).exports},1828:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});const n={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const i=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[s("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),s("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},4864:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(7389);function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);"Object"===s&&e.constructor&&(s=e.constructor.name);if("Map"===s||"Set"===s)return Array.from(e);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,n=new Array(t);s0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,s){e.inputValue({value:s})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var s=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",s)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const o=(0,s(1900).Z)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,n){return s("div",{key:n,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(s){return e.inputValue(t)}}},[void 0!==t.value?s("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?s("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3506:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});const n={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var s=[];t-3>1&&s.push(1,"...");for(var n=1;n<=e;n++)t+3>n&&t-30||"string"==typeof e}))}}};const i=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[s("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,n){return["..."!==e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(s){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[s("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},9408:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});const n={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const i=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"mb-2 ns-switch"},[s("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),s("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,n){return s("button",{key:n,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(s){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():s("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,n){return s("p",{key:n,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},4255:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var n=s(7757),i=s.n(n),r=s(9671),a=s(8603),o=s(7389),l=s(3601);function c(e,t,s,n,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void s(e)}o.done?t(l):Promise.resolve(l).then(n,i)}const u={name:"ns-media",props:["popup"],components:{VueUpload:s(2948)},data:function(){return{pages:[{label:(0,o.__)("Upload"),name:"upload",selected:!1},{label:(0,o.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return r.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:a.Z,__:o.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,o.__)("Confirm Your Action"),message:(0,o.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){r.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(s){t.addEventListener(s,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(s){t.addEventListener(s,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=i().mark((function e(){var s,n,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),n=i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s[t],e.prev=1,n.progress=1,e.next=5,new Promise((function(e,t){var s=new FormData;s.append("file",n.file),r.ih.post("/api/nexopos/v4/medias",s,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){n.uploaded=!0,n.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),n.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),a=0;case 3:if(!(a0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,r.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(s,n){n!==t.response.data.indexOf(e)&&(s.selected=!1)})),e.selected=!e.selected}}};const d=(0,s(1900).Z)(u,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[s("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[s("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),s("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,n){return s("li",{key:n,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(s){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?s("div",{staticClass:"content w-full overflow-hidden flex"},[s("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[s("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),s("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),s("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[s("ul",e._l(e.files,(function(t,n){return s("li",{key:n,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[s("span",[e._v(e._s(t.file.name))]),e._v(" "),s("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?s("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?s("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[s("div"),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),s("div",{staticClass:"flex flex-auto overflow-hidden"},[s("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"p-2 overflow-x-auto"},[s("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,n){return s("div",{key:n},[s("div",{staticClass:"p-2"},[s("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(s){return e.selectResource(t)}}},[s("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?s("div",{staticClass:"flex flex-auto items-center justify-center"},[s("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),s("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0 ",attrs:{id:"preview"}},[s("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?s("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?s("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),s("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),s("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),s("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[s("div",{staticClass:"flex -mx-2 flex-shrink-0"},[s("div",{staticClass:"px-2 flex-shrink-0 flex"},[s("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[s("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[s("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?s("div",{staticClass:"ns-button error"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[s("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),s("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[s("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[s("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),s("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),s("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[s("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?s("div",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},9110:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});const n={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){var e=this;this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(void 0!==e.$popupParams.onAction&&e.$popupParams.onAction(!1),e.$popup.close())}))},methods:{__:s(7389).__,emitAction:function(e){void 0!==this.$popupParams.onAction&&this.$popupParams.onAction(e),this.$popup.close()}}};const i=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-6/7-screen md:w-4/7-screen lg:w-3/7-screen flex flex-col shadow-lg",class:e.size,attrs:{id:"alert-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[e.title?s("h2",{staticClass:"text-3xl font-body"},[e._v(e._s(e.title))]):e._e(),e._v(" "),s("p",{staticClass:"py-4 text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"action-buttons flex border-t justify-end items-center p-2"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Ok")))])],1)])}),[],!1,null,null,null).exports},3613:(e,t,s)=>{"use strict";s.d(t,{Z:()=>K});var n=s(7757),i=s.n(n),r=s(9671),a=s(1356),o=s(2277),l=s(7266),c=s(8603),u=s(7389);function d(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function f(e){for(var t=1;tthis.availableQuantity)return r.kX.error("Unable to proceed as the quantity provided is exceed the available quantity.").subscribe();this.product.quantity=parseFloat(e),this.$popupParams.resolve(this.product),this.$popup.close()}}};const g=(0,v.Z)(y,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-xl ns-box overflow-hidden w-95vw md:w-4/6-screen lg:w-3/7-screen"},[s("div",{staticClass:"p-2 flex justify-between ns-box-header"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Quantity")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),e.product?s("div",{staticClass:"border-t border-b ns-box-body py-2 flex items-center justify-center text-2xl font-semibold"},[s("span",[e._v(e._s(e.seeValue))]),e._v(" "),s("span",{staticClass:"text-primary text-sm"},[e._v("("+e._s(e.availableQuantity)+" "+e._s(e.__("available"))+")")])]):e._e(),e._v(" "),e.product?s("div",{staticClass:"flex-auto overflow-y-auto p-2"},[s("ns-numpad",{attrs:{value:e.product.quantity},on:{next:function(t){return e.updateQuantity(t)},changed:function(t){return e.setChangedValue(t)}}})],1):e._e()])}),[],!1,null,null,null).exports;var x=s(3296),w=s(3601),C=s(2242),k=s(1703);function j(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function P(e){for(var t=1;t0?this.refundables.map((function(e){return parseFloat(e.unit_price)*parseFloat(e.quantity)})).reduce((function(e,t){return e+t}))+this.shippingFees:0+this.shippingFees},shippingFees:function(){return this.refundShipping?this.order.shipping:0}},data:function(){return{isSubmitting:!1,formValidation:new l.Z,refundables:[],paymentOptions:[],paymentField:[],print:new k.Z({settings:systemSettings,options:systemOptions,type:"refund"}),refundShipping:!1,selectedPaymentGateway:!1,screen:0,selectFields:[{type:"select",options:this.order.products.map((function(e){return{label:"".concat(e.name," - ").concat(e.unit.name," (x").concat(e.quantity,")"),value:e.id}})),validation:"required",name:"product_id",label:(0,u.__)("Product"),description:(0,u.__)("Select the product to perform a refund.")}]}},methods:{__:u.__,updateScreen:function(e){this.screen=e},toggleRefundShipping:function(e){this.refundShipping=e,this.refundShipping},proceedPayment:function(){var e=this;return!1===this.selectedPaymentGateway?r.kX.error((0,u.__)("Please select a payment gateway before proceeding.")).subscribe():0===this.total?r.kX.error((0,u.__)("There is nothing to refund.")).subscribe():0===this.screenValue?r.kX.error((0,u.__)("Please provide a valid payment amount.")).subscribe():void C.G.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("The refund will be made on the current order."),onAction:function(t){t&&e.doProceed()}})},doProceed:function(){var e=this,t={products:this.refundables,total:this.screenValue,payment:this.selectedPaymentGateway,refund_shipping:this.refundShipping};this.isSubmitting=!0,r.ih.post("/api/nexopos/v4/orders/".concat(this.order.id,"/refund"),t).subscribe({next:function(t){e.isSubmitting=!1,e.$emit("changed",!0),"refunded"===t.data.order.payment_status&&e.$emit("loadTab","details"),e.print.printOrder(t.data.orderRefund.id),r.kX.success(t.message).subscribe()},error:function(t){e.isSubmitting=!1,r.kX.error(t.message).subscribe()}})},addProduct:function(){var e=this;if(this.formValidation.validateFields(this.selectFields),!this.formValidation.fieldsValid(this.selectFields))return r.kX.error((0,u.__)("Please select a product before proceeding.")).subscribe();var t=this.formValidation.extractFields(this.selectFields),s=this.order.products.filter((function(e){return e.id===t.product_id})),n=this.refundables.filter((function(e){return e.id===t.product_id}));if(n.length>0){var i=n.map((function(e){return parseInt(e.quantity)})).reduce((function(e,t){return e+t}));if(i===s[0].quantity)return r.kX.error((0,u.__)("Not enough quantity to proceed.")).subscribe()}if(0===s[0].quantity)return r.kX.error((0,u.__)("Not enough quantity to proceed.")).subscribe();var a=P(P({},s[0]),{condition:"",description:""});new Promise((function(e,t){C.G.show(h,{resolve:e,reject:t,product:a})})).then((function(t){t.quantity=e.getProductOriginalQuantity(t.id)-e.getProductUsedQuantity(t.id),e.refundables.push(t)}),(function(e){return e}))},getProductOriginalQuantity:function(e){var t=this.order.products.filter((function(t){return t.id===e}));return t.length>0?t.map((function(e){return parseFloat(e.quantity)})).reduce((function(e,t){return e+t})):0},getProductUsedQuantity:function(e){var t=this.refundables.filter((function(t){return t.id===e}));return t.length>0?t.map((function(e){return parseFloat(e.quantity)})).reduce((function(e,t){return e+t})):0},openSettings:function(e){var t=this;new Promise((function(t,s){C.G.show(h,{resolve:t,reject:s,product:e})})).then((function(s){var n=t.refundables.indexOf(e);t.$set(t.refundables,n,s)}),(function(e){return e}))},selectPaymentGateway:function(){var e=this;new Promise((function(t,s){C.G.show(x.Z,P({resolve:t,reject:s,value:[e.selectedPaymentOption]},e.paymentField[0]))})).then((function(t){e.selectedPaymentGateway=t[0]}),(function(e){return e}))},changeQuantity:function(e){var t=this;new Promise((function(s,n){var i=t.getProductOriginalQuantity(e.id)-t.getProductUsedQuantity(e.id)+parseFloat(e.quantity);C.G.show(g,{resolve:s,reject:n,product:e,availableQuantity:i})})).then((function(s){if(s.quantity>t.getProductUsedQuantity(e.id)-e.quantity){var n=t.refundables.indexOf(e);t.$set(t.refundables,n,s)}}))},deleteProduct:function(e){var t=this;new Promise((function(s,n){C.G.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to delete this product ?"),onAction:function(s){if(s){var n=t.refundables.indexOf(e);t.refundables.splice(n,1)}}})}))}},mounted:function(){var e=this;this.selectFields=this.formValidation.createFields(this.selectFields),r.ih.get("/api/nexopos/v4/orders/payments").subscribe((function(t){e.paymentField=t}))}};const S=(0,v.Z)(O,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-m-4 flex-auto flex flex-wrap relative"},[e.isSubmitting?s("div",{staticClass:"bg-overlay h-full w-full flex items-center justify-center absolute z-30"},[s("ns-spinner")],1):e._e(),e._v(" "),s("div",{staticClass:"px-4 w-full lg:w-1/2"},[s("h3",{staticClass:"py-2 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Refund With Products")))]),e._v(" "),s("div",{staticClass:"my-2"},[s("ul",[s("li",{staticClass:"border-b border-info-primary flex justify-between items-center mb-2"},[s("div",{staticClass:"flex-auto flex-col flex"},[s("div",{staticClass:"p-2 flex"},e._l(e.selectFields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),s("div",{staticClass:"flex justify-between p-2"},[s("div",{staticClass:"flex items-center text-primary"},[e.order.shipping>0?s("span",{staticClass:"mr-2"},[e._v(e._s(e.__("Refund Shipping")))]):e._e(),e._v(" "),e.order.shipping>0?s("ns-checkbox",{attrs:{checked:e.refundShipping},on:{change:function(t){return e.toggleRefundShipping(t)}}}):e._e()],1),e._v(" "),s("div",[s("button",{staticClass:"border rounded-full px-2 py-1 ns-inset-button info",on:{click:function(t){return e.addProduct()}}},[e._v(e._s(e.__("Add Product")))])])])])]),e._v(" "),s("li",[s("h4",{staticClass:"py-1 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Products")))])]),e._v(" "),e._l(e.refundables,(function(t){return s("li",{key:t.id,staticClass:"elevation-surface border flex justify-between items-center mb-2"},[s("div",{staticClass:"px-2 text-primary flex justify-between flex-auto"},[s("div",{staticClass:"flex flex-col"},[s("p",{staticClass:"py-2"},[s("span",[e._v(e._s(t.name))]),e._v(" "),"damaged"===t.condition?s("span",{staticClass:"rounded-full px-2 py-1 text-xs bg-error-tertiary mx-2 text-white"},[e._v(e._s(e.__("Damaged")))]):e._e(),e._v(" "),"unspoiled"===t.condition?s("span",{staticClass:"rounded-full px-2 py-1 text-xs bg-success-tertiary mx-2 text-white"},[e._v(e._s(e.__("Unspoiled")))]):e._e()]),e._v(" "),s("small",[e._v(e._s(t.unit.name))])]),e._v(" "),s("div",{staticClass:"flex items-center justify-center"},[s("span",{staticClass:"py-1 flex items-center cursor-pointer border-b border-dashed border-info-primary"},[e._v(e._s(e._f("currency")(t.unit_price*t.quantity)))])])]),e._v(" "),s("div",{staticClass:"flex"},[s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.openSettings(t)}}},[s("i",{staticClass:"las la-cog text-xl"})]),e._v(" "),s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.deleteProduct(t)}}},[s("i",{staticClass:"las la-trash"})]),e._v(" "),s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.changeQuantity(t)}}},[e._v(e._s(t.quantity))])])])}))],2)])]),e._v(" "),s("div",{staticClass:"px-4 w-full lg:w-1/2"},[s("h3",{staticClass:"py-2 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Summary")))]),e._v(" "),s("div",{staticClass:"py-2"},[s("div",{staticClass:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Total")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.total)))])]),e._v(" "),s("div",{staticClass:"elevation-surface border success font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Paid")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.tendered)))])]),e._v(" "),s("div",{staticClass:"elevation-surface border info font-semibold flex mb-2 p-2 justify-between cursor-pointer",on:{click:function(t){return e.selectPaymentGateway()}}},[s("span",[e._v(e._s(e.__("Payment Gateway")))]),e._v(" "),s("span",[e._v(e._s(e.selectedPaymentGateway?e.selectedPaymentGateway.label:"N/A"))])]),e._v(" "),s("div",{staticClass:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Screen")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.screenValue)))])]),e._v(" "),s("div",[s("ns-numpad",{attrs:{currency:!0,value:e.screen},on:{changed:function(t){return e.updateScreen(t)},next:function(t){return e.proceedPayment(t)}}})],1)])])])}),[],!1,null,null,null).exports;var D=s(9089);function E(e,t){for(var s=0;s0?t[0].label:(0,u.__)("Unknown Status")}},{key:"getDeliveryStatus",value:function(e){var t=deliveryStatuses.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,u.__)("Unknown Status")}},{key:"getProcessingStatus",value:function(e){var t=processingStatuses.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,u.__)("Unknown Status")}},{key:"getPaymentStatus",value:function(e){var t=paymentLabels.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,u.__)("Unknown Status")}}])&&E(t.prototype,s),n&&E(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function F(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function A(e){for(var t=1;t0?s("span",[e._v(e._s(e._f("currency")(e.order.total-e.order.tendered)))]):e._e(),e._v(" "),e.order.total-e.order.tendered<=0?s("span",[e._v(e._s(e._f("currency")(0)))]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2 w-full md:w-1/2"},[s("div",{staticClass:"my-1 h-12 py-1 px-2 flex justify-between items-center elevation-surface warning border text-xl font-bold"},[s("span",[e._v(e._s(e.__("Customer Account")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.customer.account_amount)))])])])]),e._v(" "),s("div",{staticClass:"flex -mx-4 flex-wrap"},[s("div",{staticClass:"px-2 w-full mb-4 md:w-1/2"},["paid"!==e.order.payment_status?s("div",[s("h3",{staticClass:"font-semibold border-b-2 border-info-primary py-2"},[e._v("\n "+e._s(e.__("Payment"))+"\n ")]),e._v(" "),s("div",{staticClass:"py-2"},[e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),e._v(" "),s("div",{staticClass:"my-2 px-2 h-12 flex justify-end items-center border elevation-surface"},[e._v("\n "+e._s(e._f("currency")(e.inputValue))+"\n ")]),e._v(" "),s("ns-numpad",{attrs:{floating:!0,value:e.inputValue},on:{next:function(t){return e.submitPayment(t)},changed:function(t){return e.updateValue(t)}}})],2)]):e._e(),e._v(" "),"paid"===e.order.payment_status?s("div",{staticClass:"flex items-center justify-center h-full"},[s("h3",{staticClass:"text-primary font-semibold"},[e._v(e._s(e.__("No payment possible for paid order.")))])]):e._e()]),e._v(" "),s("div",{staticClass:"px-2 w-full mb-4 md:w-1/2"},[s("h3",{staticClass:"font-semibold border-b-2 border-info-primary py-2 mb-2"},[e._v("\n "+e._s(e.__("Payment History"))+"\n ")]),e._v(" "),s("ul",e._l(e.order.payments,(function(t){return s("li",{key:t.id,staticClass:"p-2 flex items-center justify-between text-shite border elevation-surface mb-2"},[s("span",[e._v(e._s(e.paymentsLabels[t.identifier]||e.__("Unknown")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(t.value)))])])})),0)])])])}),[],!1,null,null,null).exports;var Z=s(3306);const R={props:["order"],data:function(){return{processingStatuses,deliveryStatuses,labels:new T,showProcessingSelect:!1,showDeliverySelect:!1}},mounted:function(){},methods:{__:u.__,submitProcessingChange:function(){var e=this;C.G.show(w.default,{title:(0,u.__)("Would you proceed ?"),message:(0,u.__)("The processing status of the order will be changed. Please confirm your action."),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/processing"),{process_status:e.order.process_status}).subscribe({next:function(t){e.showProcessingSelect=!1,r.kX.success(t.message).subscribe()},error:function(e){r.kX.error(e.message||(0,u.__)("Unexpected error occured.")).subscribe()}})}})},openRefunds:function(){var e=this;try{new Promise((function(t,s){var n=e.order;C.G.show(Z.Z,{order:n,resolve:t,reject:s})}))}catch(e){}},submitDeliveryStatus:function(){var e=this;C.G.show(w.default,{title:(0,u.__)("Would you proceed ?"),message:(0,u.__)("The delivery status of the order will be changed. Please confirm your action."),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/delivery"),{delivery_status:e.order.delivery_status}).subscribe({next:function(t){e.showDeliverySelect=!1,r.kX.success(t.message).subscribe()},error:function(e){r.kX.error(e.message||(0,u.__)("Unexpected error occured.")).subscribe()}})}})}}};const Y=(0,v.Z)(R,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-mx-4 flex flex-wrap"},[s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"w-full mb-2 flex-wrap flex"},[s("div",{staticClass:"w-full mb-2 px-4"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Payment Summary")))])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"elevation-surface border p-2 flex justify-between items-start"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Sub Total")))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(e.order.subtotal)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice error"},[s("div",[s("h4",{staticClass:"text-semibold"},[s("span",{staticClass:"text-white"},[e._v(e._s(e.__("Discount")))]),e._v(" "),"percentage"===e.order.discount_type?s("span",{staticClass:"text-white ml-1"},[e._v("("+e._s(e.order.discount_percentage)+"%)")]):e._e(),e._v(" "),"flat"===e.order.discount_type?s("span",{staticClass:"text-white ml-1"},[e._v("(Flat)")]):e._e()])]),e._v(" "),s("div",{staticClass:"font-semibold"},[s("span",[e._v(e._s(e._f("currency")(e.order.discount)))])])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Shipping")))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(e.order.shipping)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice error"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v("\n "+e._s(e.__("Coupons"))+"\n ")])]),e._v(" "),s("div",{staticClass:"font-semibold"},[s("span",[e._v(e._s(e._f("currency")(e.order.total_coupons)))])])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice info"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Total")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.total)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice warning"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Taxes")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.tax_value)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start text-primary elevation-surface error border"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Change")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.change)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Paid")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.tendered)))])])])])]),e._v(" "),s("div",{staticClass:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},[s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Order Status")))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Customer")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.order.nexopos_customers_name))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Type")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.labels.getTypeLabel(e.order.type)))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Delivery Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},[s("div",{staticClass:"w-full text-center"},[e.showDeliverySelect?e._e():s("span",{staticClass:"font-semibold text-secondary border-b border-info-primary cursor-pointer border-dashed",on:{click:function(t){e.showDeliverySelect=!0}}},[e._v(e._s(e.labels.getDeliveryStatus(e.order.delivery_status)))])]),e._v(" "),e.showDeliverySelect?s("div",{staticClass:"flex-auto flex"},[s("div",{staticClass:"ns-select flex items-center justify-center"},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.order.delivery_status,expression:"order.delivery_status"}],ref:"process_status",staticClass:"flex-auto border-info-primary rounded-lg",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.order,"delivery_status",t.target.multiple?s:s[0])}}},e._l(e.deliveryStatuses,(function(t,n){return s("option",{key:n,domProps:{value:t.value}},[e._v(e._s(t.label))])})),0)]),e._v(" "),s("div",{staticClass:"pl-2 flex"},[s("ns-close-button",{on:{click:function(t){e.showDeliverySelect=!1}}}),e._v(" "),s("button",{staticClass:"bg-success-primary text-white rounded-full px-2 py-1",on:{click:function(t){return e.submitDeliveryStatus(e.order)}}},[e._v(e._s(e.__("Save")))])],1)]):e._e()])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex flex-col md:flex-row justify-between items-center elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Processing Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},[s("div",{staticClass:"w-full text-center"},[e.showProcessingSelect?e._e():s("span",{staticClass:"border-b border-info-primary cursor-pointer border-dashed",on:{click:function(t){e.showProcessingSelect=!0}}},[e._v(e._s(e.labels.getProcessingStatus(e.order.process_status)))])]),e._v(" "),e.showProcessingSelect?s("div",{staticClass:"flex-auto flex"},[s("div",{staticClass:"ns-select flex items-center justify-center"},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.order.process_status,expression:"order.process_status"}],ref:"process_status",staticClass:"flex-auto border-info-primary rounded-lg",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.order,"process_status",t.target.multiple?s:s[0])}}},e._l(e.processingStatuses,(function(t,n){return s("option",{key:n,domProps:{value:t.value}},[e._v(e._s(t.label))])})),0)]),e._v(" "),s("div",{staticClass:"pl-2 flex"},[s("ns-close-button",{on:{click:function(t){e.showProcessingSelect=!1}}}),e._v(" "),s("button",{staticClass:"bg-success-primary text-white rounded-full px-2 py-1",on:{click:function(t){return e.submitProcessingChange(e.order)}}},[e._v(e._s(e.__("Save")))])],1)]):e._e()])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Payment Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.labels.getPaymentStatus(e.order.payment_status)))])])]),e._v(" "),s("div",{staticClass:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},[s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Products")))])]),e._v(" "),e._l(e.order.products,(function(t){return s("div",{key:t.id,staticClass:"p-2 flex justify-between items-start elevation-surface border mb-6"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(t.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-secondary text-sm"},[e._v(e._s(t.unit.name||"N/A"))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(t.total_price)))])])})),e._v(" "),s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary flex justify-between"},[s("span",[e._v(e._s(e.__("Refunded Products")))]),e._v(" "),s("a",{staticClass:"border-b border-info-primary border-dashed",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.openRefunds()}}},[e._v(e._s(e.__("All Refunds")))])])]),e._v(" "),e._l(e.order.refunded_products,(function(t){return s("div",{key:t.id,staticClass:"p-2 flex justify-between items-start elevation-surface border mb-6"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(t.order_product.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-secondary text-sm"},[e._v(e._s(t.unit.name||"N/A")+" | "),s("span",{staticClass:"rounded-full px-2",class:"damaged"===t.condition?"bg-error-tertiary text-white":"bg-info-tertiary text-white"},[e._v(e._s(t.condition))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(t.total_price)))])])}))],2)])}),[],!1,null,null,null).exports;function z(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function I(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const L={name:"ns-order-instalments-payment",components:{nsNotice:s(7975).nsNotice},data:function(){return{paymentTypes,fields:[{type:"select",name:"payment_type",description:(0,u.__)("Select the payment type that must apply to the current order."),label:(0,u.__)("Payment Type"),validation:"required",options:paymentTypes}],print:new k.Z({settings:systemSettings,options:systemOptions,type:"payment"}),validation:new l.Z,order:null,instalment:null}},methods:{__:u.__,popupResolver:b.Z,popupCloser:c.Z,close:function(){this.popupResolver(!1)},updateInstalmentAsDue:function(e){var t=this;nsHttpClient.put("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments/").concat(this.instalment.id,"/"),{instalment:{date:ns.date.moment.format("YYYY-MM-DD HH:mm:ss")}}).subscribe({next:function(e){t.submitPayment()},error:function(e){r.kX.error(e.message||(0,u.__)("An unexpected error has occured")).subscribe()}})},submitPayment:function(){var e=this;if(!this.validation.validateFields(this.fields))return r.kX.error(__m("The form is not valid.")).subcribe();nsHttpClient.post("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments/").concat(this.instalment.id,"/pay"),function(e){for(var t=1;t0?this.instalments.map((function(e){return e.amount})).reduce((function(e,t){return parseFloat(e)+parseFloat(t)})):0}},methods:{__:u.__,loadInstalments:function(){var e=this;r.ih.get("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments")).subscribe((function(t){e.original=t,e.instalments=t.map((function(e){return e.price_clicked=!1,e.date_clicked=!1,e.date=moment(e.date).format("YYYY-MM-DD"),e}))}))},showReceipt:function(e){if(null===e.payment_id)return r.kX.error((0,u.__)("This instalment doesn't have any payment attached.")).subscribe();this.print.printOrder(e.payment_id)},addInstalment:function(){this.instalments.push({date:ns.date.moment.format("YYYY-MM-DD"),amount:this.order.total-this.totalInstalments,paid:!1})},createInstalment:function(e){var t=this;Popup.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to create this instalment ?"),onAction:function(s){s&&r.ih.post("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments"),{instalment:e}).subscribe({next:function(e){t.loadInstalments(),r.kX.success(e.message).subscribe()},error:function(e){r.kX.error(e.message||(0,u.__)("An unexpected error has occured")).subscribe()}})}})},deleteInstalment:function(e){var t=this;Popup.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to delete this instalment ?"),onAction:function(s){s&&r.ih.delete("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments/").concat(e.id)).subscribe({next:function(s){var n=t.instalments.indexOf(e);t.instalments.splice(n,1),r.kX.success(s.message).subscribe()},error:function(e){r.kX.error(e.message||(0,u.__)("An unexpected error has occured")).subscribe()}})}})},markAsPaid:function(e){var t,s=this;return(t=i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,new Promise((function(t,n){Popup.show(H,{order:s.order,instalment:e,resolve:t,reject:n})}));case 3:t.sent,s.loadInstalments(),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})),function(){var e=this,s=arguments;return new Promise((function(n,i){var r=t.apply(e,s);function a(e){U(r,n,i,a,o,"next",e)}function o(e){U(r,n,i,a,o,"throw",e)}a(void 0)}))})()},togglePriceEdition:function(e){var t=this;e.paid||(e.price_clicked=!e.price_clicked,this.$forceUpdate(),e.price_clicked&&setTimeout((function(){t.$refs.amount[0].select()}),100))},updateInstalment:function(e){var t=this;Popup.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to update that instalment ?"),onAction:function(s){s&&r.ih.put("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments/").concat(e.id),{instalment:e}).subscribe({next:function(e){r.kX.success(e.message).subscribe()},error:function(e){r.kX.error(e.message||(0,u.__)("An unexpected error has occured")).subscribe()}})}})},toggleDateEdition:function(e){var t=this;e.paid||(e.date_clicked=!e.date_clicked,this.$forceUpdate(),e.date_clicked&&setTimeout((function(){t.$refs.date[0].select()}),200))}}};const X=(0,v.Z)(N,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-mx-4 flex-auto flex flex-wrap"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"w-full mb-2 flex-wrap"},[s("div",{staticClass:"w-full mb-2 px-4"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Instalments")))])]),e._v(" "),s("div",{staticClass:"px-4"},[s("ul",{staticClass:"border-table-th-edge border-t text-primary"},[e._l(e.instalments,(function(t){return s("li",{key:t.id,staticClass:"border-b border-l flex justify-between elevation-surface",class:t.paid?"success":"info"},[s("span",{staticClass:"p-2"},[t.date_clicked?e._e():s("span",{on:{click:function(s){return e.toggleDateEdition(t)}}},[e._v(e._s(t.date))]),e._v(" "),t.date_clicked?s("span",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.date,expression:"instalment.date"}],ref:"date",refInFor:!0,staticClass:"border border-info-primary rounded",attrs:{type:"date"},domProps:{value:t.date},on:{blur:function(s){return e.toggleDateEdition(t)},input:function(s){s.target.composing||e.$set(t,"date",s.target.value)}}})]):e._e()]),e._v(" "),s("div",{staticClass:"flex items-center"},[s("div",{staticClass:"flex items-center px-2 h-full border-r"},[t.price_clicked?e._e():s("span",{on:{click:function(s){return e.togglePriceEdition(t)}}},[e._v(e._s(e._f("currency")(t.amount)))]),e._v(" "),t.price_clicked?s("span",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.amount,expression:"instalment.amount"}],ref:"amount",refInFor:!0,staticClass:"border border-info-primary p-1",attrs:{type:"text"},domProps:{value:t.amount},on:{blur:function(s){return e.togglePriceEdition(t)},input:function(s){s.target.composing||e.$set(t,"amount",s.target.value)}}})]):e._e()]),e._v(" "),!t.paid&&t.id?s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full border-r"},[s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"success",className:"la-money-bill-wave-alt"},on:{click:function(s){return e.markAsPaid(t)}}})],1),e._v(" "),s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"info",className:"la-save"},on:{click:function(s){return e.updateInstalment(t)}}})],1),e._v(" "),s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"error",className:"la-trash-alt"},on:{click:function(s){return e.deleteInstalment(t)}}})],1)]):e._e(),e._v(" "),t.paid||t.id?e._e():s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full border-r"},[s("div",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"px-3 py-1 rounded-full",on:{click:function(s){return e.createInstalment(t)}}},[s("i",{staticClass:"las la-plus"}),e._v("\n "+e._s(e.__("Create"))+"\n ")])])])]),e._v(" "),t.paid?s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"px-3 text-xs py-1 rounded-full",on:{click:function(s){return e.showReceipt(t)}}},[s("i",{staticClass:"las la-print"}),e._v("\n "+e._s(e.__("Receipt"))+"\n ")])])]):e._e()])])})),e._v(" "),s("li",{staticClass:"flex justify-between p-2 border-r border-b border-l elevation-surface"},[s("div",{staticClass:"flex items-center justify-center"},[s("span",[e._v("\n "+e._s(e.__("Total :"))+" "+e._s(e._f("currency")(e.order.total))+"\n ")]),e._v(" "),s("span",{staticClass:"ml-1 text-sm"},[e._v("\n ("+e._s(e.__("Remaining :"))+" "+e._s(e._f("currency")(e.order.total-e.totalInstalments))+")\n ")])]),e._v(" "),s("div",{staticClass:"-mx-2 flex flex-wrap items-center"},[s("span",{staticClass:"px-2"},[e._v("\n "+e._s(e.__("Instalments:"))+" "+e._s(e._f("currency")(e.totalInstalments))+"\n ")]),e._v(" "),s("span",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"rounded-full px-3 py-1",on:{click:function(t){return e.addInstalment()}}},[e._v(e._s(e.__("Add Instalment")))])])])])])],2)])])])])}),[],!1,null,null,null).exports;function Q(e,t,s,n,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void s(e)}o.done?t(l):Promise.resolve(l).then(n,i)}function W(e){return function(){var t=this,s=arguments;return new Promise((function(n,i){var r=e.apply(t,s);function a(e){Q(r,n,i,a,o,"next",e)}function o(e){Q(r,n,i,a,o,"throw",e)}a(void 0)}))}}var G={filters:{nsCurrency:a.W},name:"ns-preview-popup",data:function(){return{active:"details",order:new Object,products:[],payments:[],options:null,settings:null}},components:{nsOrderRefund:S,nsOrderPayment:M,nsOrderDetails:Y,nsOrderInstalments:X},computed:{isVoidable:function(){return["paid","partially_paid","unpaid"].includes(this.order.payment_status)},isDeleteAble:function(){return["hold"].includes(this.order.payment_status)}},methods:{__:u.__,popupResolver:b.Z,popupCloser:c.Z,closePopup:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.popupResolver(e)},setActive:function(e){this.active=e},refresh:function(){this.$popupParams.component.$emit("updated"),this.loadOrderDetails(this.order.id)},printOrder:function(){if("default"===this.options.ns_pos_printing_gateway)this.processRegularPrinting(this.order.id);else this.processCustomPrinting(this.order.id,this.options.ns_pos_printing_gateway,!1)},processCustomPrinting:function(e,t){var s=arguments;return W(i().mark((function n(){var a;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:a=!(s.length>2&&void 0!==s[2])||s[2],!1===nsHooks.applyFilters(a?"ns-order-custom-print":"ns-order-custom-print-aloud",{printed:!1,order_id:e,gateway:t}).printed&&r.kX.error((0,u.__)("Unsupported print gateway.")).subscribe();case 3:case"end":return n.stop()}}),n)})))()},processRegularPrinting:function(e){var t=document.querySelector("printing-section");t&&t.remove();var s=document.createElement("iframe");s.id="printing-section",s.className="hidden",s.src=this.settings.sale_printing_url.replace("{reference_id}",e),document.body.appendChild(s)},loadOrderDetails:function(e){var t=this;(0,o.D)([r.ih.get("/api/nexopos/v4/orders/".concat(e)),r.ih.get("/api/nexopos/v4/orders/".concat(e,"/products")),r.ih.get("/api/nexopos/v4/orders/".concat(e,"/payments"))]).subscribe((function(e){t.order=e[0],t.products=e[1],t.payments=e[2]}))},deleteOrder:function(){var e=this;Popup.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to delete this order"),onAction:function(t){t&&r.ih.delete("/api/nexopos/v4/orders/".concat(e.order.id)).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.refreshCrudTable(),e.closePopup(!0)},error:function(e){r.kX.error(e.message).subscribe()}})}})},voidOrder:function(){var e=this;try{new Promise((function(t,s){Popup.show(D.default,{resolve:t,reject:s,title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("The current order will be void. This action will be recorded. Consider providing a reason for this operation"),onAction:function(t){!1!==t&&r.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/void"),{reason:t}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.refreshCrudTable(),e.closePopup(!0)},error:function(e){r.kX.error(e.message).subscribe()}})}})}))}catch(e){console.log(e)}},refreshCrudTable:function(){this.$popupParams.component.$emit("updated",!0)}},watch:{active:function(){"details"===this.active&&this.loadOrderDetails(this.order.id)}},mounted:function(){this.order=this.$popupParams.order,this.options=systemOptions,this.settings=systemSettings,this.loadOrderDetails(this.order.id),this.popupCloser()}};window.nsOrderPreviewPopup=G;const B=G;const K=(0,v.Z)(B,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-95vh w-95vw md:h-6/7-screen md:w-6/7-screen overflow-hidden shadow-xl ns-box flex flex-col"},[s("div",{staticClass:"border-b ns-box-header p-3 flex items-center justify-between"},[s("div",[s("h3",[e._v(e._s(e.__("Order Options")))])]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup(!0)}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 overflow-scroll ns-box-body flex flex-auto"},[e.order.id?s("ns-tabs",{attrs:{active:e.active},on:{active:function(t){return e.setActive(t)}}},[s("ns-tabs-item",{staticClass:"overflow-y-auto",attrs:{label:e.__("Details"),identifier:"details"}},[s("ns-order-details",{attrs:{order:e.order}})],1),e._v(" "),["order_void","hold","refunded","partially_refunded"].includes(e.order.payment_status)?e._e():s("ns-tabs-item",{staticClass:"overflow-y-auto",attrs:{label:e.__("Payments"),identifier:"payments"}},[s("ns-order-payment",{attrs:{order:e.order},on:{changed:function(t){return e.refresh()}}})],1),e._v(" "),["order_void","hold","refunded"].includes(e.order.payment_status)?e._e():s("ns-tabs-item",{staticClass:"flex overflow-y-auto",attrs:{label:e.__("Refund & Return"),identifier:"refund"}},[s("ns-order-refund",{attrs:{order:e.order},on:{loadTab:function(t){return e.setActive(t)},changed:function(t){return e.refresh()}}})],1),e._v(" "),["partially_paid","unpaid"].includes(e.order.payment_status)&&e.order.support_instalments?s("ns-tabs-item",{staticClass:"flex overflow-y-auto",attrs:{label:e.__("Installments"),identifier:"instalments"}},[s("ns-order-instalments",{attrs:{order:e.order},on:{changed:function(t){return e.refresh()}}})],1):e._e()],1):e._e(),e._v(" "),e.order.id?e._e():s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1)],1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between border-t ns-box-footer"},[s("div",[e.isVoidable?s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.voidOrder()}}},[s("i",{staticClass:"las la-ban"}),e._v("\n "+e._s(e.__("Void"))+"\n ")]):e._e(),e._v(" "),e.isDeleteAble?s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.deleteOrder()}}},[s("i",{staticClass:"las la-trash"}),e._v("\n "+e._s(e.__("Delete"))+"\n ")]):e._e()],1),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.printOrder()}}},[s("i",{staticClass:"las la-print"}),e._v("\n "+e._s(e.__("Print"))+"\n ")])],1)])])}),[],!1,null,null,null).exports},3306:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var n=s(7389),i=s(8603),r=s(6386),a=s(9671),o=s(1703);const l={name:"ns-orders-refund-popup",data:function(){return{order:null,refunds:[],view:"summary",previewed:null,loaded:!1,options:systemOptions,settings:systemSettings,print:new o.Z({settings:systemSettings,options:systemOptions,type:"refund"})}},methods:{__:n.__,popupCloser:i.Z,popupResolver:r.Z,toggleProductView:function(e){this.view="details",this.previewed=e},loadOrderRefunds:function(){var e=this;nsHttpClient.get("/api/nexopos/v4/orders/".concat(this.order.id,"/refunds")).subscribe((function(t){e.loaded=!0,e.refunds=t.refunds}),(function(e){a.kX.error(e.message).subscribe()}))},close:function(){this.$popup.close()},printRefundReceipt:function(e){this.print.printOrder(e.id)}},mounted:function(){this.order=this.$popupParams.order,this.popupCloser(),this.loadOrderRefunds()}};const c=(0,s(1900).Z)(l,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg w-95vw h-95vh md:w-3/5-screen md:h-3/5-screen ns-box flex flex-col overflow-hidden"},[s("div",{staticClass:"border-b p-2 flex items-center justify-between ns-box-header"},[s("h3",[e._v(e._s(e.__("Order Refunds")))]),e._v(" "),s("div",{staticClass:"flex"},["details"===e.view?s("div",{staticClass:"flex items-center justify-center cursor-pointer rounded-full px-3 border hover:bg-info-primary hover:text-white mr-1",on:{click:function(t){e.view="summary"}}},[e._v(e._s(e.__("Go Back")))]):e._e(),e._v(" "),s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"overflow-auto flex-auto ns-box-body"},["summary"===e.view?[e.loaded?e._e():s("div",{staticClass:"flex h-full w-full items-center justify-center"},[s("ns-spinner",{attrs:{size:"24"}})],1),e._v(" "),e.loaded&&0===e.refunds.length?s("div",{staticClass:"flex h-full w-full items-center justify-center"},[s("i",{staticClass:"lar la-frown-open"})]):e._e(),e._v(" "),e.loaded&&e.refunds.length>0?e._l(e.refunds,(function(t){return s("div",{key:t.id,staticClass:"border-b flex flex-col md:flex-row"},[s("div",{staticClass:"w-full md:flex-auto p-2"},[s("h3",{staticClass:"font-semibold mb-1"},[e._v(e._s(e.order.code))]),e._v(" "),s("div",[s("ul",{staticClass:"flex -mx-1 text-sm text-primary"},[s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Total"))+" : "+e._s(e._f("currency")(t.total)))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("By"))+" : "+e._s(t.author.username))])])])]),e._v(" "),s("div",{staticClass:"w-full md:w-16 cursor-pointer hover:bg-info-primary hover:border-info-primary hover:text-white text-lg flex items-center justify-center md:border-l",on:{click:function(s){return e.toggleProductView(t)}}},[s("i",{staticClass:"las la-eye"})]),e._v(" "),s("div",{staticClass:"w-full md:w-16 cursor-pointer hover:bg-info-primary hover:border-info-primary hover:text-white text-lg flex items-center justify-center md:border-l",on:{click:function(s){return e.printRefundReceipt(t)}}},[s("i",{staticClass:"las la-print"})])])})):e._e()]:e._e(),e._v(" "),"details"===e.view?e._l(e.previewed.refunded_products,(function(t){return s("div",{key:t.id,staticClass:"border-b flex flex-col md:flex-row"},[s("div",{staticClass:"w-full md:flex-auto p-2"},[s("h3",{staticClass:"font-semibold mb-1"},[e._v(e._s(t.product.name))]),e._v(" "),s("div",[s("ul",{staticClass:"flex -mx-1 text-sm text-primary"},[s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Condition"))+" : "+e._s(t.condition))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Quantity"))+" : "+e._s(t.quantity))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Total"))+" : "+e._s(e._f("currency")(t.total_price)))])])])])])})):e._e()],2)])}),[],!1,null,null,null).exports},3601:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>o});var n=s(7389),i=s(6386),r=s(8603);const a={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:n.__,popupResolver:i.Z,popupCloser:r.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const o=(0,s(1900).Z)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[s("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),s("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"action-buttons flex border-t"},[s("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),s("hr",{staticClass:"border-r h-16"}),e._v(" "),s("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports},2004:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});const n={name:"ns-pos-loading-popup"};const i=(0,s(1900).Z)(n,(function(){var e=this.$createElement;return(this._self._c||e)("ns-spinner")}),[],!1,null,null,null).exports},1345:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var n=s(9671),i=s(7389);function r(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);"Object"===s&&e.constructor&&(s=e.constructor.name);if("Map"===s||"Set"===s)return Array.from(e);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,n=new Array(t);s{"use strict";s.r(t),s.d(t,{default:()=>i});const n={data:function(){return{title:"",message:"",input:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){var e=this;this.input=this.$popupParams.input||"",this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams.reject(!1),e.$popup.close())}))},methods:{__:s(7389).__,emitAction:function(e){this.$popupParams.onAction(e?this.input:e),this.$popup.close()},reject:function(e){void 0!==this.$popupParams.reject&&this.$popupParams.reject(e),this.$popup.close()}}};const i=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-5/7-screen md:w-3/7-screen flex flex-col shadow-lg",class:e.size,attrs:{id:"prompt-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-2"},[s("h2",{staticClass:"text-3xl font-body"},[e._v(e._s(e.title))]),e._v(" "),s("p",{staticClass:"w-full md:mx-auto md:w-2/3 py-4 text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"p-2"},[s("div",{staticClass:"ns-input"},[s("textarea",{directives:[{name:"model",rawName:"v-model",value:e.input,expression:"input"}],staticClass:"w-full border-2 p-2",attrs:{name:"",id:"",cols:"30",rows:"10"},domProps:{value:e.input},on:{input:function(t){t.target.composing||(e.input=t.target.value)}}})])]),e._v(" "),s("div",{staticClass:"flex border-t action-buttons"},[s("button",{staticClass:"flex-auto w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Ok")))]),e._v(" "),s("hr",{staticClass:"border-r"}),e._v(" "),s("button",{staticClass:"flex-auto w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.reject(!1)}}},[e._v(e._s(e.__("Cancel")))])])])}),[],!1,null,null,null).exports},3296:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(8603),i=s(7389);const r={data:function(){return{value:[],options:[],description:"",label:null,type:"select"}},computed:{},mounted:function(){this.popupCloser(),this.value=this.$popupParams.value||[],this.options=this.$popupParams.options,this.label=this.$popupParams.label,this.description=this.$popupParams.description||"",this.type=this.$popupParams.type||this.type},methods:{popupCloser:n.Z,__:i.__,toggle:function(e){var t=this.value.indexOf(e);-1===t?this.value.unshift(e):this.value.splice(t,1)},isSelected:function(e){return this.value.indexOf(e)>=0},close:function(){this.$popupParams.reject(!1),this.$popup.close()},select:function(e){void 0!==e&&(this.value=[e]),this.$popupParams.resolve(this.value),this.close()}}};const a=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-xl ns-box w-6/7-screen md:w-4/7-screen lg:w-3/7-screen max-h-5/6-screen overflow-hidden flex flex-col"},[s("div",{staticClass:"p-2 flex justify-between border-b items-center ns-box-header"},[s("span",{staticClass:"text-semibold text-primary"},[e._v("\n "+e._s(e.label)+"\n ")]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex flex-col overflow-hidden"},[e.description.length>0?s("p",{staticClass:"p-2 text-center text-sm bg-info-primary"},[e._v(e._s(e.description))]):e._e(),e._v(" "),s("div",{staticClass:"overflow-y-auto"},[s("ul",{staticClass:"ns-vertical-menu"},["select"===e.type?e._l(e.options,(function(t){return s("li",{key:t.value,staticClass:"p-2 border-b border-box-edge text-primary cursor-pointer",on:{click:function(s){return e.select(t)}}},[e._v(e._s(t.label))])})):e._e(),e._v(" "),"multiselect"===e.type?e._l(e.options,(function(t){return s("li",{key:t.value,staticClass:"p-2 border-b text-primary cursor-pointer",class:e.isSelected(t)?"active":"",on:{click:function(s){return e.toggle(t)}}},[e._v(e._s(t.label))])})):e._e()],2)])]),e._v(" "),"multiselect"===e.type?s("div",{staticClass:"flex justify-between"},[s("div"),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.select()}}},[e._v(e._s(e.__("Select")))])],1)]):e._e()])}),[],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=3823,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[820,198,89,110,4],{9671:(e,t,s)=>{"use strict";s.d(t,{l:()=>Z,kq:()=>L,ih:()=>R,kX:()=>Y});var n=s(6486),i=s(9669),r=s(6300),a=s(8345),o=s(9624),l=s(9248),c=s(230);function u(e,t){for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,s)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,s)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var s=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=L.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:n}),new c.y((function(r){s._client[e](t,n,Object.assign(Object.assign({},s._client.defaults[e]),i)).then((function(e){s._lastRequestData=e,r.next(e.data),r.complete(),s._subject.next({identifier:"async.stop"})})).catch((function(e){var t;r.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),s._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,s=e.value;this._subject.next({identifier:t,value:s})}}],s&&u(t.prototype,s),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=s(3);function p(e,t){for(var s=0;s=1e3){for(var s,n=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((s=parseFloat((0!=n?e/Math.pow(1e3,n):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}s%1!=0&&(s=s.toFixed(1)),t=s+["","k","m","b","t"][n]}return t})),$=s(1356),O=s(9698);function S(e,t){for(var s=0;s0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&q(t.prototype,s),n&&q(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()),U=new b({sidebar:["xs","sm","md"].includes(H.breakpoint)?"hidden":"visible"});R.defineClient(i),window.nsEvent=Z,window.nsHttpClient=R,window.nsSnackBar=Y,window.nsCurrency=$.W,window.nsTruncate=O.b,window.nsRawCurrency=$.f,window.nsAbbreviate=P,window.nsState=U,window.nsUrl=z,window.nsScreen=H,window.ChartJS=r,window.EventEmitter=m,window.Popup=x.G,window.RxJS=y,window.FormValidation=C.Z,window.nsCrudHandler=I},7975:(e,t,s)=>{"use strict";s.r(t),s.d(t,{nsAvatar:()=>B,nsButton:()=>o,nsCheckbox:()=>p,nsCkeditor:()=>E,nsCloseButton:()=>j,nsCrud:()=>N,nsCrudForm:()=>_,nsDate:()=>w,nsDateRangePicker:()=>K.Z,nsDateTimePicker:()=>V.Z,nsDatepicker:()=>ee.Z,nsField:()=>g.P,nsIconButton:()=>P,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>k,nsMenu:()=>r,nsMultiselect:()=>x,nsNotice:()=>J.Z,nsNumpad:()=>X.Z,nsPaginate:()=>te.Z,nsSearch:()=>ne,nsSelect:()=>d,nsSelectAudio:()=>f,nsSpinner:()=>h,nsSubmenu:()=>a,nsSwitch:()=>A.Z,nsTableRow:()=>v,nsTabs:()=>T,nsTabsItem:()=>F,nsTextarea:()=>y});var n=s(538),i=s(9671),r=n.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,i.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&i.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,s){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),a=n.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),o=n.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=n.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=n.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),u=s(7389),d=n.default.component("ns-select",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},mounted:function(){},methods:{__:u.__},template:'\n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),f=n.default.component("ns-select-audio",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__:u.__,playSelectedSound:function(){this.field.value.length>0&&new Audio(this.field.value).play()}},template:'\n
    \n \n
    \n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),p=n.default.component("ns-checkbox",{data:function(){return{}},props:["checked","field","label"],template:'\n
    \n
    \n \n
    \n {{ label }}\n {{ field.label }}\n
    \n ',computed:{isChecked:function(){return this.field?this.field.value:this.checked}},methods:{toggleIt:function(){void 0!==this.field&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}}),m=s(2242),v=n.default.component("ns-table-row",{props:["options","row","columns","prependOptions","showOptions"],data:function(){return{optionsToggled:!1}},mounted:function(){},methods:{__:u.__,sanitizeHTML:function(e){var t=document.createElement("div");t.innerHTML=e;for(var s=t.getElementsByTagName("script"),n=s.length;n--;)s[n].parentNode.removeChild(s[n]);return t.innerHTML},getElementOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu:function(e){var t=this;if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout((function(){var e=t.$el.querySelectorAll(".relative > .absolute")[0],s=t.$el.querySelectorAll(".relative")[0],n=t.getElementOffset(s);e.style.top=n.top+"px",e.style.left=n.left+"px",s.classList.remove("relative"),s.classList.add("dropdown-holder")}),100);else{var s=this.$el.querySelectorAll(".dropdown-holder")[0];s.classList.remove("dropdown-holder"),s.classList.add("relative")}},handleChanged:function(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync:function(e){var t=this;e.confirm?confirm(e.confirm.message)&&i.ih[e.type.toLowerCase()](e.url).subscribe((function(e){i.kX.success(e.message).subscribe(),t.$emit("reload",t.row)}),(function(e){t.toggleMenu(),i.kX.error(e.message).subscribe()})):(i.l.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup:function(e,t){var s=window.nsExtraComponents[e.component];if(e.component)return s?new Promise((function(n,i){m.G.show(s,{resolve:n,reject:i,row:t,action:e})})):i.kX.error((0,u.__)('Unable to load the component "'.concat(e.component,'". Make sure the component is registered to "nsExtraComponents".'))).subscribe();this.triggerAsync(e)}},template:'\n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n '}),h=n.default.component("ns-spinner",{data:function(){return{}},mounted:function(){},computed:{validatedSize:function(){return this.size||24},validatedBorder:function(){return this.border||8},validatedAnimation:function(){return this.animation||"fast"}},props:["color","size","border"],template:"\n
    \n
    \n
    \n "}),b=s(7266),_=n.default.component("ns-crud-form",{data:function(){return{form:{},globallyChecked:!1,formValidation:new b.Z,rows:[]}},mounted:function(){this.loadForm()},props:["src","create-url","field-class","return-url","submit-url","submit-method","disable-tabs"],computed:{activeTabFields:function(){for(var e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]}},methods:{__:u.__,toggle:function(e){for(var t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},handleShowOptions:function(e){this.rows.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},submit:function(){var e=this;return this.formValidation.validateForm(this.form).length>0?i.kX.error(this.$slots["error-invalid"]?this.$slots["error-invalid"][0].text:"No error message provided for having an invalid form.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():(this.formValidation.disableForm(this.form),void 0===this.submitUrl?i.kX.error(this.$slots["error-no-submit-url"]?this.$slots["error-no-submit-url"][0].text:"No error message provided for not having a valid submit url.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():void i.ih[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,this.formValidation.extractForm(this.form)).subscribe((function(t){if("success"===t.status){if(e.submitMethod&&"post"===e.submitMethod.toLowerCase()&&!1!==e.returnUrl)return document.location=t.data.editUrl||e.returnUrl;i.kX.info(t.message,(0,u.__)("Okay"),{duration:3e3}).subscribe(),e.$emit("save",t)}e.formValidation.enableForm(e.form)}),(function(t){i.kX.error(t.message,void 0,{duration:5e3}).subscribe(),void 0!==t.data&&e.formValidation.triggerError(e.form,t.data),e.formValidation.enableForm(e.form)})))},handleGlobalChange:function(e){this.globallyChecked=e,this.rows.forEach((function(t){return t.$checked=e}))},loadForm:function(){var e=this;i.ih.get("".concat(this.src)).subscribe({next:function(t){e.form=e.parseForm(t.form),i.kq.doAction("ns-crud-form-loaded",e),e.$emit("updated",e.form)},error:function(e){i.kX.error(e.message,"OKAY",{duration:0}).subscribe()}})},parseForm:function(e){e.main.value=void 0===e.main.value?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];var t=0;for(var s in e.tabs)0===t&&(e.tabs[s].active=!0),e.tabs[s].active=void 0!==e.tabs[s].active&&e.tabs[s].active,e.tabs[s].fields=this.formValidation.createFields(e.tabs[s].fields),t++;return e}},template:'\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n
    {{ tab.label }}
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n '}),y=n.default.component("ns-textarea",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),g=s(8737),x=n.default.component("ns-multiselect",{data:function(){return{showPanel:!1,search:""}},props:["field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=void 0!==t.selected&&t.selected,e.field.value&&e.field.value.includes(t.value)&&(t.selected=!0),t}))}},methods:{__:u.__,addOption:function(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout((function(){}),100))},removeOption:function(e,t){var s=this;if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout((function(){s.search=""}),100),!1}},mounted:function(){var e=this;this.field.value&&this.field.value.reverse().forEach((function(t){var s=e.field.options.filter((function(e){return e.value===t}));s.length>=0&&e.addOption(s[0])}))},template:'\n
    \n \n
    \n
    \n
    \n
    \n
    \n {{ option.label }}\n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n
    \n '}),w=n.default.component("ns-date",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),C=s(4255),k=n.default.component("ns-media-input",{template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n ',computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},data:function(){return{}},props:["placeholder","leading","type","field"],mounted:function(){},methods:{toggleMedia:function(){var e=this;new Promise((function(t,s){m.G.show(C.default,Object.assign({resolve:t,reject:s},e.field.data||{}))})).then((function(t){"use-selected"===t.event&&(e.field.data&&"url"!==e.field.data.type?e.field.data&&"model"!==e.field.data.type||(e.field.value=t.value[0]):e.field.value=t.value[0].sizes.original,e.$forceUpdate())}))}}}),j=n.default.component("ns-close-button",{template:'\n \n ',methods:{clicked:function(e){this.$emit("click",e)}}}),P=n.default.component("ns-icon-button",{template:'\n \n ',props:["className","buttonClass","type"],methods:{clicked:function(e){this.$emit("click",e)}}}),$=s(1272),O=s.n($),S=s(5234),D=s.n(S),E=n.default.component("ns-ckeditor",{data:function(){return{editor:D()}},components:{ckeditor:O().component},mounted:function(){},methods:{__:u.__},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),T=n.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),F=n.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),A=s(9408),V=s(2744),q=s(7757),M=s.n(q),Z=s(3601),R=s(8603),Y=s(6386);const z={data:function(){return{fields:[],validation:new b.Z}},methods:{__:u.__,popupCloser:R.Z,popupResolver:Y.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var I=s(1900);const L=(0,I.Z)(z,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[s("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[s("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[s("div",[s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var H=function(e,t,s,n){return new(s||(s=Promise))((function(i,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function o(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(a,o)}l((n=n.apply(e,t||[])).next())}))};const U={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,u.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:u.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var s=[];t-3>1&&s.push(1,"...");for(var n=1;n<=e;n++)t+3>n&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),i.kX.success((0,u.__)("The document has been generated.")).subscribe()}),(function(e){i.kX.error(e.message||(0,u.__)("Unexpected error occured.")).subscribe()}))},clearSelectedEntries:function(){var e=this;m.G.show(Z.default,{title:(0,u.__)("Clear Selected Entries ?"),message:(0,u.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var s=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(s,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(s){s.$checked=e,t.refreshRow(s)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){i.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,u.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){i.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){i.kX.error(e.message).subscribe()}}):void 0:i.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,u.__)("No selection has been made.")).subscribe():i.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,u.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return H(this,void 0,void 0,M().mark((function e(){var t,s=this;return M().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(L),e.next=4,new Promise((function(e,t){m.G.show(L,{resolve:e,reject:t,queryFilters:s.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,i.kX.error(t.message).subscribe()}))}}};const N=(0,I.Z)(U,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?s("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[s("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?s("div",{staticClass:"px-2 flex items-center justify-center"},[s("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[s("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),s("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[s("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?s("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[s("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2 flex items-center justify-center"},[s("button",{staticClass:"rounded-full\n text-sm\n h-10\n px-3\n outline-none\n border\n ns-crud-button\n ",on:{click:function(t){return e.refresh()}}},[s("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?s("div",{staticClass:"px-2 flex items-center"},[s("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none ",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():s("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?s("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():s("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?s("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),s("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?s("div",{staticClass:"px-1 flex items-center"},[s("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[s("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),s("div",{staticClass:"px-1 flex items-center"},[s("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[s("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),s("div",{staticClass:"flex"},[s("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",[s("th",{staticClass:"text-center px-2 border w-16 py-2"},[s("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?s("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,n){return s("th",{key:n,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(n)}}},[s("div",{staticClass:"w-full flex justify-between items-center"},[s("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),s("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?s("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?s("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?s("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),s("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,n){return s("ns-table-row",{key:n,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():s("tr",[s("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?s("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?s:s[0]}}},[s("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,n){return s("option",{key:n,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),s("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),s("div",{staticClass:"flex"},[s("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),s("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[s("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,n){return["..."!==e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(s){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[s("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var X=s(4864),Q=s(1726),W=s(7259);const G=n.default.extend({methods:{__:u.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,Q.createAvatar)(W,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const B=(0,I.Z)(G,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[s("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),s("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?s("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?s("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var K=s(4806),J=s(1828),ee=s(1544),te=s(3506);const se={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:u.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,s,n;e.searchText.length>0&&i.ih[e.method||"post"](e.url,(t={},s=e.searchArgument||"search",n=e.searchText,s in t?Object.defineProperty(t,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[s]=n,t)).subscribe({next:function(t){e.results=t},error:function(e){i.kX.error(e.message||(0,u.__)("An unexpected error occured.")).subscribe()}})}),1e3)}},mounted:function(){}};const ne=(0,I.Z)(se,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-search"},[s("div",{staticClass:"input-group info border-2"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),s("div",{staticClass:"relative"},[s("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?s("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,n){return s("li",{key:n,staticClass:"border-b p-2 cursor-pointer",on:{click:function(s){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},8737:(e,t,s)=>{"use strict";s.d(t,{P:()=>o});var n=s(538),i=s(4806),r=s(2744),a=s(9408),o=n.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:i.Z,nsDateTimePicker:r.Z,nsSwitch:a.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\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 '})},1356:(e,t,s)=>{"use strict";s.d(t,{W:()=>c,f:()=>u});var n=s(2077),i=s.n(n),r=s(538),a=s(6740),o=s.n(a),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=r.default.filter("currency",(function(e){var t,s,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===n){var r={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};s=o()(e,r).format()}else s=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(s).concat("after"===ns.currency.ns_currency_position?t:"")})),u=function(e){var t="0.".concat(l);return parseFloat(i()(e).format(t))}},9698:(e,t,s)=>{"use strict";s.d(t,{b:()=>n});var n=s(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,s)=>{"use strict";function n(e,t){for(var s=0;si});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,s,i;return t=e,s=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var s in e.tabs)if(e.tabs[s].fields){var n=[],i=this.validateFieldsErrors(e.tabs[s].fields);i.length>0&&n.push(i),e.tabs[s].errors=n.flat(),t.push(n.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var s in e)0===t&&(e[s].active=!0),e[s].active=void 0!==e[s].active&&e[s].active,e[s].fields=this.createFields(e[s].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var s=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(s,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(s){t.fieldPassCheck(e,s)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var s in e.tabs)void 0===t[s]&&(t[s]={}),t[s]=this.extractFields(e.tabs[s].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var s=function(s){var n=s.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===n.length&&e.tabs[n[0]].fields.forEach((function(e){e.name===n[1]&&t.errors[s].forEach((function(t){var s={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(s)}))})),s===e.main.name&&t.errors[s].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var n in t.errors)s(n)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var s=function(s){e.forEach((function(e){e.name===s&&t.errors[s].forEach((function(t){var s={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(s)}))}))};for(var n in t.errors)s(n)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(s,n){s.identifier===t.identifier&&!0===s.invalid&&e.errors.splice(n,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(s,n){!0===s[t.identifier]&&e.errors.splice(n,1)}))}return e}}],s&&n(t.prototype,s),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,s)=>{"use strict";s.d(t,{__:()=>n,c:()=>i});var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},8603:(e,t,s)=>{"use strict";function n(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var s=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(s+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}s.d(t,{Z:()=>n})},6386:(e,t,s)=>{"use strict";function n(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}s.d(t,{Z:()=>n})},2242:(e,t,s)=>{"use strict";s.d(t,{G:()=>c});var n=s(7757),i=s.n(n),r=s(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var s=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[s-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new r.x}var t,s,n;return t=e,s=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s=0;s<10;s++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,s,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,i().mark((function a(){var o,l,c,u=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){u.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=r,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var s="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(s),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],n=[{key:"show",value:function(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(n);return i.open(t,s),i}}],s&&o(t.prototype,s),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1703:(e,t,s)=>{"use strict";function n(e,t){for(var s=0;si});var i=function(){function e(t){var s=t.settings,n=t.options,i=t.type;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.printingURL={refund:"refund_printing_url",sale:"sale_printing_url",payment:"payment_printing_url"},this.settings=s,this.options=n,this.type=i||"refund"}var t,s,i;return t=e,(s=[{key:"processRegularPrinting",value:function(e){var t=document.querySelector("printing-section");t&&t.remove();var s=this.settings[this.printingURL[this.type]].replace("{reference_id}",e),n=document.createElement("iframe");n.id="printing-section",n.className="hidden",n.src=s,document.body.appendChild(n),setTimeout((function(){document.querySelector("#printing-section").remove()}),5e3)}},{key:"printOrder",value:function(e){"default"===this.options.ns_pos_printing_gateway?this.processRegularPrinting(e):this.processCustomPrinting(e,this.options.ns_pos_printing_gateway)}},{key:"processCustomPrinting",value:function(e,t){nsHooks.applyFilters("ns-order-custom-refund-print",{printed:!1,reference_id:e,gateway:t}).printed||nsSnackBar.error(__("Unsupported print gateway.")).subscribe()}}])&&n(t.prototype,s),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,s)=>{"use strict";s.d(t,{S:()=>r});var n=s(3260);function i(e,t){for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return n.Observable.create((function(n){var r=s.__createSnack({message:e,label:t,type:i.type}),a=r.buttonNode,o=(r.textNode,r.snackWrapper,r.sampleSnack);a.addEventListener("click",(function(e){n.onNext(a),n.onCompleted(),o.remove()})),s.__startTimer(i.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var s,n=function(){e>0&&!1!==e&&(s=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(s)})),t.addEventListener("mouseleave",(function(){n()})),n()}},{key:"__createSnack",value:function(e){var t=e.message,s=e.label,n=e.type,i=void 0===n?"info":n,r=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),u="",d="";switch(i){case"info":u="",d="info";break;case"error":u="",d="error";break;case"success":u="",d="success"}return o.textContent=t,o.setAttribute("class","pr-2"),s&&(l.setAttribute("class","ns-button default"),c.textContent=s,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(u)),l.appendChild(c)),a.appendChild(o),a.appendChild(l),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(d)),r.appendChild(a),null===document.getElementById("snack-wrapper")&&(r.setAttribute("id","snack-wrapper"),r.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(r)),{snackWrapper:r,sampleSnack:a,buttonsWrapper:l,buttonNode:c,textNode:o}}}],s&&i(t.prototype,s),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},3823:(e,t,s)=>{"use strict";var n=s(3613),i=s(9671);const r={name:"ns-products-preview",computed:{product:function(){return this.$popupParams.product}},methods:{__:s(7389).__,changeActiveTab:function(e){this.active=e,"units-quantities"===this.active&&this.loadProductQuantities()},loadProductQuantities:function(){var e=this;this.hasLoadedUnitQuantities=!1,i.ih.get("/api/nexopos/v4/products/".concat(this.product.id,"/units/quantities")).subscribe((function(t){e.unitQuantities=t,e.hasLoadedUnitQuantities=!0}))}},data:function(){return{active:"units-quantities",unitQuantities:[],hasLoadedUnitQuantities:!1}},mounted:function(){var e=this;this.loadProductQuantities(),this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&e.$popup.close()}))}};const a=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg w-6/7-screen lg:w-3/5-screen h-6/7-screen lg:h-4/5-screen ns-box overflow-hidden flex flex-col"},[s("div",{staticClass:"p-2 border-b ns-box-header text-primary text-center font-medium flex justify-between items-center"},[s("div",[e._v("\n "+e._s(e.__("Previewing :"))+" "+e._s(e.product.name)+"\n ")]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.$popup.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex-auto overflow-y-auto ns-box-body"},[s("div",{staticClass:"p-2"},[s("ns-tabs",{attrs:{active:e.active},on:{active:function(t){return e.changeActiveTab(t)}}},[s("ns-tabs-item",{attrs:{label:e.__("Units & Quantities"),identifier:"units-quantities"}},[e.hasLoadedUnitQuantities?s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",[s("th",{staticClass:"p-1 border"},[e._v(e._s(e.__("Unit")))]),e._v(" "),s("th",{staticClass:"text-right p-1 border",attrs:{width:"150"}},[e._v(e._s(e.__("Sale Price")))]),e._v(" "),s("th",{staticClass:"text-right p-1 border",attrs:{width:"150"}},[e._v(e._s(e.__("Wholesale Price")))]),e._v(" "),s("th",{staticClass:"text-right p-1 border",attrs:{width:"150"}},[e._v(e._s(e.__("Quantity")))])])]),e._v(" "),s("tbody",e._l(e.unitQuantities,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"p-1 border text-left"},[e._v(e._s(t.unit.name))]),e._v(" "),s("td",{staticClass:"p-1 border text-right"},[e._v(e._s(e._f("currency")(t.sale_price)))]),e._v(" "),s("td",{staticClass:"p-1 border text-right"},[e._v(e._s(e._f("currency")(t.wholesale_price)))]),e._v(" "),s("td",{staticClass:"p-1 border text-right"},[e._v(e._s(t.quantity))])])})),0)]):e._e(),e._v(" "),e.hasLoadedUnitQuantities?e._e():s("ns-spinner",{attrs:{size:"16",border:"4"}})],1)],1)],1)])])}),[],!1,null,null,null).exports;var o=s(9110),l=s(3601),c=s(9089),u=s(4255),d=s(1345),f=s(3306),p=s(3296),m=s(2004),v={nsOrderPreview:n.Z,nsProductPreview:a,nsAlertPopup:o.default,nsConfirmPopup:l.default,nsPromptPopup:c.default,nsMediaPopup:u.default,nsProcurementQuantity:d.Z,nsOrdersRefund:f.Z,nsSelectPopup:p.Z,nsPOSLoadingPopup:m.default};for(var h in v)window[h]=v[h]},6700:(e,t,s)=>{var n={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=r(e);return s(t)}function r(e){if(!s.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=r,e.exports=i,i.id=6700},4806:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var n=s(538),i=s(381),r=s.n(i),a=s(7144),o=s.n(a),l=(s(9095),s(7389));const c=n.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:o()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:r()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:r()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?r()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const u=(0,s(1900).Z)(c,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[s("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),s("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?s("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[s("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),s("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[s("i",{staticClass:"las la-times"})]),e._v(" "),s("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[s("div",{staticClass:"flex justify-between items-center w-full py-2"},[s("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),s("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():s("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,n){return s("p",{key:n,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},2744:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(381),i=s.n(n);const r={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:i(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return i()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?i()():i()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?i()():i()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:s(7389).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"picker mb-2"},[e.field?s("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),s("div",{staticClass:"ns-button"},[s("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[s("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?s("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?s("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?s("span",{staticClass:"mx-1 text-sm"},[null!==e.date?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?s("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?s("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?s("div",{staticClass:"relative z-10 h-0 w-0"},[s("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[s("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[s("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[s("i",{staticClass:"las la-minus"})]),e._v(" "),s("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),s("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[s("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,n){return s("div",{key:n,staticClass:"h-8 flex justify-center items-center text-sm"},[[s("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(s){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,n){return s("div",{key:n,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(n,i){return s("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===n?s("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(s){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),s("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[s("div",{staticClass:"-mx-1 flex justify-between"},[s("div",{staticClass:"px-1"},[s("div",{staticClass:"-mx-1 flex"},[e.field?s("div",{staticClass:"px-1"},[s("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[s("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?s("div",{staticClass:"px-1"},[s("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[s("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),s("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},1544:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(381),i=s.n(n);const r={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?i()():i()(this.date),this.build()},methods:{__:s(7389).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"picker"},[s("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[s("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),s("span",{staticClass:"mx-1 text-sm"},[s("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?s("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?s("div",{staticClass:"relative h-0 w-0 -mb-2"},[s("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,n){return s("div",{key:n,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(n,i){return s("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===n?s("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(s){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),s("div")])]):e._e()])}),[],!1,null,null,null).exports},1828:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});const n={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const i=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[s("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),s("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},4864:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(7389);function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);"Object"===s&&e.constructor&&(s=e.constructor.name);if("Map"===s||"Set"===s)return Array.from(e);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,n=new Array(t);s0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,s){e.inputValue({value:s})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var s=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",s)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const o=(0,s(1900).Z)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,n){return s("div",{key:n,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(s){return e.inputValue(t)}}},[void 0!==t.value?s("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?s("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3506:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});const n={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var s=[];t-3>1&&s.push(1,"...");for(var n=1;n<=e;n++)t+3>n&&t-30||"string"==typeof e}))}}};const i=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[s("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,n){return["..."!==e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(s){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[s("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},9408:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});const n={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const i=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"mb-2 ns-switch"},[s("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),s("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,n){return s("button",{key:n,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(s){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():s("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,n){return s("p",{key:n,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},4255:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var n=s(7757),i=s.n(n),r=s(9671),a=s(8603),o=s(7389),l=s(3601);function c(e,t,s,n,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void s(e)}o.done?t(l):Promise.resolve(l).then(n,i)}const u={name:"ns-media",props:["popup"],components:{VueUpload:s(2948)},data:function(){return{pages:[{label:(0,o.__)("Upload"),name:"upload",selected:!1},{label:(0,o.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return r.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:a.Z,__:o.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,o.__)("Confirm Your Action"),message:(0,o.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){r.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(s){t.addEventListener(s,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(s){t.addEventListener(s,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=i().mark((function e(){var s,n,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),n=i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s[t],e.prev=1,n.progress=1,e.next=5,new Promise((function(e,t){var s=new FormData;s.append("file",n.file),r.ih.post("/api/nexopos/v4/medias",s,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){n.uploaded=!0,n.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),n.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),a=0;case 3:if(!(a0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,r.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(s,n){n!==t.response.data.indexOf(e)&&(s.selected=!1)})),e.selected=!e.selected}}};const d=(0,s(1900).Z)(u,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[s("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[s("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),s("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,n){return s("li",{key:n,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(s){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?s("div",{staticClass:"content w-full overflow-hidden flex"},[s("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[s("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),s("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),s("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[s("ul",e._l(e.files,(function(t,n){return s("li",{key:n,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[s("span",[e._v(e._s(t.file.name))]),e._v(" "),s("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?s("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?s("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[s("div"),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),s("div",{staticClass:"flex flex-auto overflow-hidden"},[s("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"p-2 overflow-x-auto"},[s("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,n){return s("div",{key:n},[s("div",{staticClass:"p-2"},[s("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(s){return e.selectResource(t)}}},[s("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?s("div",{staticClass:"flex flex-auto items-center justify-center"},[s("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),s("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0 ",attrs:{id:"preview"}},[s("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?s("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?s("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),s("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),s("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),s("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[s("div",{staticClass:"flex -mx-2 flex-shrink-0"},[s("div",{staticClass:"px-2 flex-shrink-0 flex"},[s("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[s("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[s("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?s("div",{staticClass:"ns-button error"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[s("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),s("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[s("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[s("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),s("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),s("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[s("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?s("div",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},9110:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});const n={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){var e=this;this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(void 0!==e.$popupParams.onAction&&e.$popupParams.onAction(!1),e.$popup.close())}))},methods:{__:s(7389).__,emitAction:function(e){void 0!==this.$popupParams.onAction&&this.$popupParams.onAction(e),this.$popup.close()}}};const i=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-6/7-screen md:w-4/7-screen lg:w-3/7-screen flex flex-col shadow-lg",class:e.size,attrs:{id:"alert-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[e.title?s("h2",{staticClass:"text-3xl font-body"},[e._v(e._s(e.title))]):e._e(),e._v(" "),s("p",{staticClass:"py-4 text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"action-buttons flex border-t justify-end items-center p-2"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Ok")))])],1)])}),[],!1,null,null,null).exports},3613:(e,t,s)=>{"use strict";s.d(t,{Z:()=>K});var n=s(7757),i=s.n(n),r=s(9671),a=s(1356),o=s(2277),l=s(7266),c=s(8603),u=s(7389);function d(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function f(e){for(var t=1;tthis.availableQuantity)return r.kX.error("Unable to proceed as the quantity provided is exceed the available quantity.").subscribe();this.product.quantity=parseFloat(e),this.$popupParams.resolve(this.product),this.$popup.close()}}};const g=(0,v.Z)(y,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-xl ns-box overflow-hidden w-95vw md:w-4/6-screen lg:w-3/7-screen"},[s("div",{staticClass:"p-2 flex justify-between ns-box-header"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Quantity")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),e.product?s("div",{staticClass:"border-t border-b ns-box-body py-2 flex items-center justify-center text-2xl font-semibold"},[s("span",[e._v(e._s(e.seeValue))]),e._v(" "),s("span",{staticClass:"text-primary text-sm"},[e._v("("+e._s(e.availableQuantity)+" "+e._s(e.__("available"))+")")])]):e._e(),e._v(" "),e.product?s("div",{staticClass:"flex-auto overflow-y-auto p-2"},[s("ns-numpad",{attrs:{value:e.product.quantity},on:{next:function(t){return e.updateQuantity(t)},changed:function(t){return e.setChangedValue(t)}}})],1):e._e()])}),[],!1,null,null,null).exports;var x=s(3296),w=s(3601),C=s(2242),k=s(1703);function j(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function P(e){for(var t=1;t0?this.refundables.map((function(e){return parseFloat(e.unit_price)*parseFloat(e.quantity)})).reduce((function(e,t){return e+t}))+this.shippingFees:0+this.shippingFees},shippingFees:function(){return this.refundShipping?this.order.shipping:0}},data:function(){return{isSubmitting:!1,formValidation:new l.Z,refundables:[],paymentOptions:[],paymentField:[],print:new k.Z({settings:systemSettings,options:systemOptions,type:"refund"}),refundShipping:!1,selectedPaymentGateway:!1,screen:0,selectFields:[{type:"select",options:this.order.products.map((function(e){return{label:"".concat(e.name," - ").concat(e.unit.name," (x").concat(e.quantity,")"),value:e.id}})),validation:"required",name:"product_id",label:(0,u.__)("Product"),description:(0,u.__)("Select the product to perform a refund.")}]}},methods:{__:u.__,updateScreen:function(e){this.screen=e},toggleRefundShipping:function(e){this.refundShipping=e,this.refundShipping},proceedPayment:function(){var e=this;return!1===this.selectedPaymentGateway?r.kX.error((0,u.__)("Please select a payment gateway before proceeding.")).subscribe():0===this.total?r.kX.error((0,u.__)("There is nothing to refund.")).subscribe():0===this.screenValue?r.kX.error((0,u.__)("Please provide a valid payment amount.")).subscribe():void C.G.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("The refund will be made on the current order."),onAction:function(t){t&&e.doProceed()}})},doProceed:function(){var e=this,t={products:this.refundables,total:this.screenValue,payment:this.selectedPaymentGateway,refund_shipping:this.refundShipping};this.isSubmitting=!0,r.ih.post("/api/nexopos/v4/orders/".concat(this.order.id,"/refund"),t).subscribe({next:function(t){e.isSubmitting=!1,e.$emit("changed",!0),"refunded"===t.data.order.payment_status&&e.$emit("loadTab","details"),e.print.printOrder(t.data.orderRefund.id),r.kX.success(t.message).subscribe()},error:function(t){e.isSubmitting=!1,r.kX.error(t.message).subscribe()}})},addProduct:function(){var e=this;if(this.formValidation.validateFields(this.selectFields),!this.formValidation.fieldsValid(this.selectFields))return r.kX.error((0,u.__)("Please select a product before proceeding.")).subscribe();var t=this.formValidation.extractFields(this.selectFields),s=this.order.products.filter((function(e){return e.id===t.product_id})),n=this.refundables.filter((function(e){return e.id===t.product_id}));if(n.length>0){var i=n.map((function(e){return parseInt(e.quantity)})).reduce((function(e,t){return e+t}));if(i===s[0].quantity)return r.kX.error((0,u.__)("Not enough quantity to proceed.")).subscribe()}if(0===s[0].quantity)return r.kX.error((0,u.__)("Not enough quantity to proceed.")).subscribe();var a=P(P({},s[0]),{condition:"",description:""});new Promise((function(e,t){C.G.show(h,{resolve:e,reject:t,product:a})})).then((function(t){t.quantity=e.getProductOriginalQuantity(t.id)-e.getProductUsedQuantity(t.id),e.refundables.push(t)}),(function(e){return e}))},getProductOriginalQuantity:function(e){var t=this.order.products.filter((function(t){return t.id===e}));return t.length>0?t.map((function(e){return parseFloat(e.quantity)})).reduce((function(e,t){return e+t})):0},getProductUsedQuantity:function(e){var t=this.refundables.filter((function(t){return t.id===e}));return t.length>0?t.map((function(e){return parseFloat(e.quantity)})).reduce((function(e,t){return e+t})):0},openSettings:function(e){var t=this;new Promise((function(t,s){C.G.show(h,{resolve:t,reject:s,product:e})})).then((function(s){var n=t.refundables.indexOf(e);t.$set(t.refundables,n,s)}),(function(e){return e}))},selectPaymentGateway:function(){var e=this;new Promise((function(t,s){C.G.show(x.Z,P({resolve:t,reject:s,value:[e.selectedPaymentOption]},e.paymentField[0]))})).then((function(t){e.selectedPaymentGateway=t[0]}),(function(e){return e}))},changeQuantity:function(e){var t=this;new Promise((function(s,n){var i=t.getProductOriginalQuantity(e.id)-t.getProductUsedQuantity(e.id)+parseFloat(e.quantity);C.G.show(g,{resolve:s,reject:n,product:e,availableQuantity:i})})).then((function(s){if(s.quantity>t.getProductUsedQuantity(e.id)-e.quantity){var n=t.refundables.indexOf(e);t.$set(t.refundables,n,s)}}))},deleteProduct:function(e){var t=this;new Promise((function(s,n){C.G.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to delete this product ?"),onAction:function(s){if(s){var n=t.refundables.indexOf(e);t.refundables.splice(n,1)}}})}))}},mounted:function(){var e=this;this.selectFields=this.formValidation.createFields(this.selectFields),r.ih.get("/api/nexopos/v4/orders/payments").subscribe((function(t){e.paymentField=t}))}};const S=(0,v.Z)(O,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-m-4 flex-auto flex flex-wrap relative"},[e.isSubmitting?s("div",{staticClass:"bg-overlay h-full w-full flex items-center justify-center absolute z-30"},[s("ns-spinner")],1):e._e(),e._v(" "),s("div",{staticClass:"px-4 w-full lg:w-1/2"},[s("h3",{staticClass:"py-2 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Refund With Products")))]),e._v(" "),s("div",{staticClass:"my-2"},[s("ul",[s("li",{staticClass:"border-b border-info-primary flex justify-between items-center mb-2"},[s("div",{staticClass:"flex-auto flex-col flex"},[s("div",{staticClass:"p-2 flex"},e._l(e.selectFields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),s("div",{staticClass:"flex justify-between p-2"},[s("div",{staticClass:"flex items-center text-primary"},[e.order.shipping>0?s("span",{staticClass:"mr-2"},[e._v(e._s(e.__("Refund Shipping")))]):e._e(),e._v(" "),e.order.shipping>0?s("ns-checkbox",{attrs:{checked:e.refundShipping},on:{change:function(t){return e.toggleRefundShipping(t)}}}):e._e()],1),e._v(" "),s("div",[s("button",{staticClass:"border rounded-full px-2 py-1 ns-inset-button info",on:{click:function(t){return e.addProduct()}}},[e._v(e._s(e.__("Add Product")))])])])])]),e._v(" "),s("li",[s("h4",{staticClass:"py-1 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Products")))])]),e._v(" "),e._l(e.refundables,(function(t){return s("li",{key:t.id,staticClass:"elevation-surface border flex justify-between items-center mb-2"},[s("div",{staticClass:"px-2 text-primary flex justify-between flex-auto"},[s("div",{staticClass:"flex flex-col"},[s("p",{staticClass:"py-2"},[s("span",[e._v(e._s(t.name))]),e._v(" "),"damaged"===t.condition?s("span",{staticClass:"rounded-full px-2 py-1 text-xs bg-error-tertiary mx-2 text-white"},[e._v(e._s(e.__("Damaged")))]):e._e(),e._v(" "),"unspoiled"===t.condition?s("span",{staticClass:"rounded-full px-2 py-1 text-xs bg-success-tertiary mx-2 text-white"},[e._v(e._s(e.__("Unspoiled")))]):e._e()]),e._v(" "),s("small",[e._v(e._s(t.unit.name))])]),e._v(" "),s("div",{staticClass:"flex items-center justify-center"},[s("span",{staticClass:"py-1 flex items-center cursor-pointer border-b border-dashed border-info-primary"},[e._v(e._s(e._f("currency")(t.unit_price*t.quantity)))])])]),e._v(" "),s("div",{staticClass:"flex"},[s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.openSettings(t)}}},[s("i",{staticClass:"las la-cog text-xl"})]),e._v(" "),s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.deleteProduct(t)}}},[s("i",{staticClass:"las la-trash"})]),e._v(" "),s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.changeQuantity(t)}}},[e._v(e._s(t.quantity))])])])}))],2)])]),e._v(" "),s("div",{staticClass:"px-4 w-full lg:w-1/2"},[s("h3",{staticClass:"py-2 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Summary")))]),e._v(" "),s("div",{staticClass:"py-2"},[s("div",{staticClass:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Total")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.total)))])]),e._v(" "),s("div",{staticClass:"elevation-surface border success font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Paid")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.tendered)))])]),e._v(" "),s("div",{staticClass:"elevation-surface border info font-semibold flex mb-2 p-2 justify-between cursor-pointer",on:{click:function(t){return e.selectPaymentGateway()}}},[s("span",[e._v(e._s(e.__("Payment Gateway")))]),e._v(" "),s("span",[e._v(e._s(e.selectedPaymentGateway?e.selectedPaymentGateway.label:"N/A"))])]),e._v(" "),s("div",{staticClass:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Screen")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.screenValue)))])]),e._v(" "),s("div",[s("ns-numpad",{attrs:{currency:!0,value:e.screen},on:{changed:function(t){return e.updateScreen(t)},next:function(t){return e.proceedPayment(t)}}})],1)])])])}),[],!1,null,null,null).exports;var D=s(9089);function E(e,t){for(var s=0;s0?t[0].label:(0,u.__)("Unknown Status")}},{key:"getDeliveryStatus",value:function(e){var t=deliveryStatuses.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,u.__)("Unknown Status")}},{key:"getProcessingStatus",value:function(e){var t=processingStatuses.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,u.__)("Unknown Status")}},{key:"getPaymentStatus",value:function(e){var t=paymentLabels.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,u.__)("Unknown Status")}}])&&E(t.prototype,s),n&&E(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function F(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function A(e){for(var t=1;t0?s("span",[e._v(e._s(e._f("currency")(e.order.total-e.order.tendered)))]):e._e(),e._v(" "),e.order.total-e.order.tendered<=0?s("span",[e._v(e._s(e._f("currency")(0)))]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2 w-full md:w-1/2"},[s("div",{staticClass:"my-1 h-12 py-1 px-2 flex justify-between items-center elevation-surface warning border text-xl font-bold"},[s("span",[e._v(e._s(e.__("Customer Account")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.customer.account_amount)))])])])]),e._v(" "),s("div",{staticClass:"flex -mx-4 flex-wrap"},[s("div",{staticClass:"px-2 w-full mb-4 md:w-1/2"},["paid"!==e.order.payment_status?s("div",[s("h3",{staticClass:"font-semibold border-b-2 border-info-primary py-2"},[e._v("\n "+e._s(e.__("Payment"))+"\n ")]),e._v(" "),s("div",{staticClass:"py-2"},[e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),e._v(" "),s("div",{staticClass:"my-2 px-2 h-12 flex justify-end items-center border elevation-surface"},[e._v("\n "+e._s(e._f("currency")(e.inputValue))+"\n ")]),e._v(" "),s("ns-numpad",{attrs:{floating:!0,value:e.inputValue},on:{next:function(t){return e.submitPayment(t)},changed:function(t){return e.updateValue(t)}}})],2)]):e._e(),e._v(" "),"paid"===e.order.payment_status?s("div",{staticClass:"flex items-center justify-center h-full"},[s("h3",{staticClass:"text-primary font-semibold"},[e._v(e._s(e.__("No payment possible for paid order.")))])]):e._e()]),e._v(" "),s("div",{staticClass:"px-2 w-full mb-4 md:w-1/2"},[s("h3",{staticClass:"font-semibold border-b-2 border-info-primary py-2 mb-2"},[e._v("\n "+e._s(e.__("Payment History"))+"\n ")]),e._v(" "),s("ul",e._l(e.order.payments,(function(t){return s("li",{key:t.id,staticClass:"p-2 flex items-center justify-between text-shite border elevation-surface mb-2"},[s("span",[e._v(e._s(e.paymentsLabels[t.identifier]||e.__("Unknown")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(t.value)))])])})),0)])])])}),[],!1,null,null,null).exports;var Z=s(3306);const R={props:["order"],data:function(){return{processingStatuses,deliveryStatuses,labels:new T,showProcessingSelect:!1,showDeliverySelect:!1}},mounted:function(){},methods:{__:u.__,submitProcessingChange:function(){var e=this;C.G.show(w.default,{title:(0,u.__)("Would you proceed ?"),message:(0,u.__)("The processing status of the order will be changed. Please confirm your action."),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/processing"),{process_status:e.order.process_status}).subscribe({next:function(t){e.showProcessingSelect=!1,r.kX.success(t.message).subscribe()},error:function(e){r.kX.error(e.message||(0,u.__)("Unexpected error occured.")).subscribe()}})}})},openRefunds:function(){var e=this;try{new Promise((function(t,s){var n=e.order;C.G.show(Z.Z,{order:n,resolve:t,reject:s})}))}catch(e){}},submitDeliveryStatus:function(){var e=this;C.G.show(w.default,{title:(0,u.__)("Would you proceed ?"),message:(0,u.__)("The delivery status of the order will be changed. Please confirm your action."),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/delivery"),{delivery_status:e.order.delivery_status}).subscribe({next:function(t){e.showDeliverySelect=!1,r.kX.success(t.message).subscribe()},error:function(e){r.kX.error(e.message||(0,u.__)("Unexpected error occured.")).subscribe()}})}})}}};const Y=(0,v.Z)(R,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-mx-4 flex flex-wrap"},[s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"w-full mb-2 flex-wrap flex"},[s("div",{staticClass:"w-full mb-2 px-4"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Payment Summary")))])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"elevation-surface border p-2 flex justify-between items-start"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Sub Total")))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(e.order.subtotal)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice error"},[s("div",[s("h4",{staticClass:"text-semibold"},[s("span",{staticClass:"text-white"},[e._v(e._s(e.__("Discount")))]),e._v(" "),"percentage"===e.order.discount_type?s("span",{staticClass:"text-white ml-1"},[e._v("("+e._s(e.order.discount_percentage)+"%)")]):e._e(),e._v(" "),"flat"===e.order.discount_type?s("span",{staticClass:"text-white ml-1"},[e._v("(Flat)")]):e._e()])]),e._v(" "),s("div",{staticClass:"font-semibold"},[s("span",[e._v(e._s(e._f("currency")(e.order.discount)))])])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Shipping")))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(e.order.shipping)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice error"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v("\n "+e._s(e.__("Coupons"))+"\n ")])]),e._v(" "),s("div",{staticClass:"font-semibold"},[s("span",[e._v(e._s(e._f("currency")(e.order.total_coupons)))])])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice info"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Total")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.total)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice warning"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Taxes")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.tax_value)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start text-primary elevation-surface error border"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Change")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.change)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Paid")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.tendered)))])])])])]),e._v(" "),s("div",{staticClass:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},[s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Order Status")))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Customer")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.order.nexopos_customers_name))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Type")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.labels.getTypeLabel(e.order.type)))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Delivery Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},[s("div",{staticClass:"w-full text-center"},[e.showDeliverySelect?e._e():s("span",{staticClass:"font-semibold text-secondary border-b border-info-primary cursor-pointer border-dashed",on:{click:function(t){e.showDeliverySelect=!0}}},[e._v(e._s(e.labels.getDeliveryStatus(e.order.delivery_status)))])]),e._v(" "),e.showDeliverySelect?s("div",{staticClass:"flex-auto flex"},[s("div",{staticClass:"ns-select flex items-center justify-center"},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.order.delivery_status,expression:"order.delivery_status"}],ref:"process_status",staticClass:"flex-auto border-info-primary rounded-lg",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.order,"delivery_status",t.target.multiple?s:s[0])}}},e._l(e.deliveryStatuses,(function(t,n){return s("option",{key:n,domProps:{value:t.value}},[e._v(e._s(t.label))])})),0)]),e._v(" "),s("div",{staticClass:"pl-2 flex"},[s("ns-close-button",{on:{click:function(t){e.showDeliverySelect=!1}}}),e._v(" "),s("button",{staticClass:"bg-success-primary text-white rounded-full px-2 py-1",on:{click:function(t){return e.submitDeliveryStatus(e.order)}}},[e._v(e._s(e.__("Save")))])],1)]):e._e()])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex flex-col md:flex-row justify-between items-center elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Processing Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},[s("div",{staticClass:"w-full text-center"},[e.showProcessingSelect?e._e():s("span",{staticClass:"border-b border-info-primary cursor-pointer border-dashed",on:{click:function(t){e.showProcessingSelect=!0}}},[e._v(e._s(e.labels.getProcessingStatus(e.order.process_status)))])]),e._v(" "),e.showProcessingSelect?s("div",{staticClass:"flex-auto flex"},[s("div",{staticClass:"ns-select flex items-center justify-center"},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.order.process_status,expression:"order.process_status"}],ref:"process_status",staticClass:"flex-auto border-info-primary rounded-lg",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.order,"process_status",t.target.multiple?s:s[0])}}},e._l(e.processingStatuses,(function(t,n){return s("option",{key:n,domProps:{value:t.value}},[e._v(e._s(t.label))])})),0)]),e._v(" "),s("div",{staticClass:"pl-2 flex"},[s("ns-close-button",{on:{click:function(t){e.showProcessingSelect=!1}}}),e._v(" "),s("button",{staticClass:"bg-success-primary text-white rounded-full px-2 py-1",on:{click:function(t){return e.submitProcessingChange(e.order)}}},[e._v(e._s(e.__("Save")))])],1)]):e._e()])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Payment Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.labels.getPaymentStatus(e.order.payment_status)))])])]),e._v(" "),s("div",{staticClass:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},[s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Products")))])]),e._v(" "),e._l(e.order.products,(function(t){return s("div",{key:t.id,staticClass:"p-2 flex justify-between items-start elevation-surface border mb-6"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(t.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-secondary text-sm"},[e._v(e._s(t.unit.name||"N/A"))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(t.total_price)))])])})),e._v(" "),s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary flex justify-between"},[s("span",[e._v(e._s(e.__("Refunded Products")))]),e._v(" "),s("a",{staticClass:"border-b border-info-primary border-dashed",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.openRefunds()}}},[e._v(e._s(e.__("All Refunds")))])])]),e._v(" "),e._l(e.order.refunded_products,(function(t){return s("div",{key:t.id,staticClass:"p-2 flex justify-between items-start elevation-surface border mb-6"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(t.order_product.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-secondary text-sm"},[e._v(e._s(t.unit.name||"N/A")+" | "),s("span",{staticClass:"rounded-full px-2",class:"damaged"===t.condition?"bg-error-tertiary text-white":"bg-info-tertiary text-white"},[e._v(e._s(t.condition))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(t.total_price)))])])}))],2)])}),[],!1,null,null,null).exports;function z(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function I(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const L={name:"ns-order-instalments-payment",components:{nsNotice:s(7975).nsNotice},data:function(){return{paymentTypes,fields:[{type:"select",name:"payment_type",description:(0,u.__)("Select the payment type that must apply to the current order."),label:(0,u.__)("Payment Type"),validation:"required",options:paymentTypes}],print:new k.Z({settings:systemSettings,options:systemOptions,type:"payment"}),validation:new l.Z,order:null,instalment:null}},methods:{__:u.__,popupResolver:b.Z,popupCloser:c.Z,close:function(){this.popupResolver(!1)},updateInstalmentAsDue:function(e){var t=this;nsHttpClient.put("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments/").concat(this.instalment.id,"/"),{instalment:{date:ns.date.moment.format("YYYY-MM-DD HH:mm:ss")}}).subscribe({next:function(e){t.submitPayment()},error:function(e){r.kX.error(e.message||(0,u.__)("An unexpected error has occured")).subscribe()}})},submitPayment:function(){var e=this;if(!this.validation.validateFields(this.fields))return r.kX.error(__m("The form is not valid.")).subcribe();nsHttpClient.post("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments/").concat(this.instalment.id,"/pay"),function(e){for(var t=1;t0?this.instalments.map((function(e){return e.amount})).reduce((function(e,t){return parseFloat(e)+parseFloat(t)})):0}},methods:{__:u.__,loadInstalments:function(){var e=this;r.ih.get("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments")).subscribe((function(t){e.original=t,e.instalments=t.map((function(e){return e.price_clicked=!1,e.date_clicked=!1,e.date=moment(e.date).format("YYYY-MM-DD"),e}))}))},showReceipt:function(e){if(null===e.payment_id)return r.kX.error((0,u.__)("This instalment doesn't have any payment attached.")).subscribe();this.print.printOrder(e.payment_id)},addInstalment:function(){this.instalments.push({date:ns.date.moment.format("YYYY-MM-DD"),amount:this.order.total-this.totalInstalments,paid:!1})},createInstalment:function(e){var t=this;Popup.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to create this instalment ?"),onAction:function(s){s&&r.ih.post("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments"),{instalment:e}).subscribe({next:function(e){t.loadInstalments(),r.kX.success(e.message).subscribe()},error:function(e){r.kX.error(e.message||(0,u.__)("An unexpected error has occured")).subscribe()}})}})},deleteInstalment:function(e){var t=this;Popup.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to delete this instalment ?"),onAction:function(s){s&&r.ih.delete("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments/").concat(e.id)).subscribe({next:function(s){var n=t.instalments.indexOf(e);t.instalments.splice(n,1),r.kX.success(s.message).subscribe()},error:function(e){r.kX.error(e.message||(0,u.__)("An unexpected error has occured")).subscribe()}})}})},markAsPaid:function(e){var t,s=this;return(t=i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,new Promise((function(t,n){Popup.show(H,{order:s.order,instalment:e,resolve:t,reject:n})}));case 3:t.sent,s.loadInstalments(),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})),function(){var e=this,s=arguments;return new Promise((function(n,i){var r=t.apply(e,s);function a(e){U(r,n,i,a,o,"next",e)}function o(e){U(r,n,i,a,o,"throw",e)}a(void 0)}))})()},togglePriceEdition:function(e){var t=this;e.paid||(e.price_clicked=!e.price_clicked,this.$forceUpdate(),e.price_clicked&&setTimeout((function(){t.$refs.amount[0].select()}),100))},updateInstalment:function(e){var t=this;Popup.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to update that instalment ?"),onAction:function(s){s&&r.ih.put("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments/").concat(e.id),{instalment:e}).subscribe({next:function(e){r.kX.success(e.message).subscribe()},error:function(e){r.kX.error(e.message||(0,u.__)("An unexpected error has occured")).subscribe()}})}})},toggleDateEdition:function(e){var t=this;e.paid||(e.date_clicked=!e.date_clicked,this.$forceUpdate(),e.date_clicked&&setTimeout((function(){t.$refs.date[0].select()}),200))}}};const X=(0,v.Z)(N,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-mx-4 flex-auto flex flex-wrap"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"w-full mb-2 flex-wrap"},[s("div",{staticClass:"w-full mb-2 px-4"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Instalments")))])]),e._v(" "),s("div",{staticClass:"px-4"},[s("ul",{staticClass:"border-table-th-edge border-t text-primary"},[e._l(e.instalments,(function(t){return s("li",{key:t.id,staticClass:"border-b border-l flex justify-between elevation-surface",class:t.paid?"success":"info"},[s("span",{staticClass:"p-2"},[t.date_clicked?e._e():s("span",{on:{click:function(s){return e.toggleDateEdition(t)}}},[e._v(e._s(t.date))]),e._v(" "),t.date_clicked?s("span",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.date,expression:"instalment.date"}],ref:"date",refInFor:!0,staticClass:"border border-info-primary rounded",attrs:{type:"date"},domProps:{value:t.date},on:{blur:function(s){return e.toggleDateEdition(t)},input:function(s){s.target.composing||e.$set(t,"date",s.target.value)}}})]):e._e()]),e._v(" "),s("div",{staticClass:"flex items-center"},[s("div",{staticClass:"flex items-center px-2 h-full border-r"},[t.price_clicked?e._e():s("span",{on:{click:function(s){return e.togglePriceEdition(t)}}},[e._v(e._s(e._f("currency")(t.amount)))]),e._v(" "),t.price_clicked?s("span",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.amount,expression:"instalment.amount"}],ref:"amount",refInFor:!0,staticClass:"border border-info-primary p-1",attrs:{type:"text"},domProps:{value:t.amount},on:{blur:function(s){return e.togglePriceEdition(t)},input:function(s){s.target.composing||e.$set(t,"amount",s.target.value)}}})]):e._e()]),e._v(" "),!t.paid&&t.id?s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full border-r"},[s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"success",className:"la-money-bill-wave-alt"},on:{click:function(s){return e.markAsPaid(t)}}})],1),e._v(" "),s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"info",className:"la-save"},on:{click:function(s){return e.updateInstalment(t)}}})],1),e._v(" "),s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"error",className:"la-trash-alt"},on:{click:function(s){return e.deleteInstalment(t)}}})],1)]):e._e(),e._v(" "),t.paid||t.id?e._e():s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full border-r"},[s("div",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"px-3 py-1 rounded-full",on:{click:function(s){return e.createInstalment(t)}}},[s("i",{staticClass:"las la-plus"}),e._v("\n "+e._s(e.__("Create"))+"\n ")])])])]),e._v(" "),t.paid?s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"px-3 text-xs py-1 rounded-full",on:{click:function(s){return e.showReceipt(t)}}},[s("i",{staticClass:"las la-print"}),e._v("\n "+e._s(e.__("Receipt"))+"\n ")])])]):e._e()])])})),e._v(" "),s("li",{staticClass:"flex justify-between p-2 border-r border-b border-l elevation-surface"},[s("div",{staticClass:"flex items-center justify-center"},[s("span",[e._v("\n "+e._s(e.__("Total :"))+" "+e._s(e._f("currency")(e.order.total))+"\n ")]),e._v(" "),s("span",{staticClass:"ml-1 text-sm"},[e._v("\n ("+e._s(e.__("Remaining :"))+" "+e._s(e._f("currency")(e.order.total-e.totalInstalments))+")\n ")])]),e._v(" "),s("div",{staticClass:"-mx-2 flex flex-wrap items-center"},[s("span",{staticClass:"px-2"},[e._v("\n "+e._s(e.__("Instalments:"))+" "+e._s(e._f("currency")(e.totalInstalments))+"\n ")]),e._v(" "),s("span",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"rounded-full px-3 py-1",on:{click:function(t){return e.addInstalment()}}},[e._v(e._s(e.__("Add Instalment")))])])])])])],2)])])])])}),[],!1,null,null,null).exports;function Q(e,t,s,n,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void s(e)}o.done?t(l):Promise.resolve(l).then(n,i)}function W(e){return function(){var t=this,s=arguments;return new Promise((function(n,i){var r=e.apply(t,s);function a(e){Q(r,n,i,a,o,"next",e)}function o(e){Q(r,n,i,a,o,"throw",e)}a(void 0)}))}}var G={filters:{nsCurrency:a.W},name:"ns-preview-popup",data:function(){return{active:"details",order:new Object,products:[],payments:[],options:null,settings:null}},components:{nsOrderRefund:S,nsOrderPayment:M,nsOrderDetails:Y,nsOrderInstalments:X},computed:{isVoidable:function(){return["paid","partially_paid","unpaid"].includes(this.order.payment_status)},isDeleteAble:function(){return["hold"].includes(this.order.payment_status)}},methods:{__:u.__,popupResolver:b.Z,popupCloser:c.Z,closePopup:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.popupResolver(e)},setActive:function(e){this.active=e},refresh:function(){this.$popupParams.component.$emit("updated"),this.loadOrderDetails(this.order.id)},printOrder:function(){if("default"===this.options.ns_pos_printing_gateway)this.processRegularPrinting(this.order.id);else this.processCustomPrinting(this.order.id,this.options.ns_pos_printing_gateway,!1)},processCustomPrinting:function(e,t){var s=arguments;return W(i().mark((function n(){var a;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:a=!(s.length>2&&void 0!==s[2])||s[2],!1===nsHooks.applyFilters(a?"ns-order-custom-print":"ns-order-custom-print-aloud",{printed:!1,order_id:e,gateway:t}).printed&&r.kX.error((0,u.__)("Unsupported print gateway.")).subscribe();case 3:case"end":return n.stop()}}),n)})))()},processRegularPrinting:function(e){var t=document.querySelector("printing-section");t&&t.remove();var s=document.createElement("iframe");s.id="printing-section",s.className="hidden",s.src=this.settings.sale_printing_url.replace("{reference_id}",e),document.body.appendChild(s)},loadOrderDetails:function(e){var t=this;(0,o.D)([r.ih.get("/api/nexopos/v4/orders/".concat(e)),r.ih.get("/api/nexopos/v4/orders/".concat(e,"/products")),r.ih.get("/api/nexopos/v4/orders/".concat(e,"/payments"))]).subscribe((function(e){t.order=e[0],t.products=e[1],t.payments=e[2]}))},deleteOrder:function(){var e=this;Popup.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to delete this order"),onAction:function(t){t&&r.ih.delete("/api/nexopos/v4/orders/".concat(e.order.id)).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.refreshCrudTable(),e.closePopup(!0)},error:function(e){r.kX.error(e.message).subscribe()}})}})},voidOrder:function(){var e=this;try{new Promise((function(t,s){Popup.show(D.default,{resolve:t,reject:s,title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("The current order will be void. This action will be recorded. Consider providing a reason for this operation"),onAction:function(t){!1!==t&&r.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/void"),{reason:t}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.refreshCrudTable(),e.closePopup(!0)},error:function(e){r.kX.error(e.message).subscribe()}})}})}))}catch(e){console.log(e)}},refreshCrudTable:function(){this.$popupParams.component.$emit("updated",!0)}},watch:{active:function(){"details"===this.active&&this.loadOrderDetails(this.order.id)}},mounted:function(){this.order=this.$popupParams.order,this.options=systemOptions,this.settings=systemSettings,this.loadOrderDetails(this.order.id),this.popupCloser()}};window.nsOrderPreviewPopup=G;const B=G;const K=(0,v.Z)(B,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-95vh w-95vw md:h-6/7-screen md:w-6/7-screen overflow-hidden shadow-xl ns-box flex flex-col"},[s("div",{staticClass:"border-b ns-box-header p-3 flex items-center justify-between"},[s("div",[s("h3",[e._v(e._s(e.__("Order Options")))])]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup(!0)}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 overflow-scroll ns-box-body flex flex-auto"},[e.order.id?s("ns-tabs",{attrs:{active:e.active},on:{active:function(t){return e.setActive(t)}}},[s("ns-tabs-item",{staticClass:"overflow-y-auto",attrs:{label:e.__("Details"),identifier:"details"}},[s("ns-order-details",{attrs:{order:e.order}})],1),e._v(" "),["order_void","hold","refunded","partially_refunded"].includes(e.order.payment_status)?e._e():s("ns-tabs-item",{staticClass:"overflow-y-auto",attrs:{label:e.__("Payments"),identifier:"payments"}},[s("ns-order-payment",{attrs:{order:e.order},on:{changed:function(t){return e.refresh()}}})],1),e._v(" "),["order_void","hold","refunded"].includes(e.order.payment_status)?e._e():s("ns-tabs-item",{staticClass:"flex overflow-y-auto",attrs:{label:e.__("Refund & Return"),identifier:"refund"}},[s("ns-order-refund",{attrs:{order:e.order},on:{loadTab:function(t){return e.setActive(t)},changed:function(t){return e.refresh()}}})],1),e._v(" "),["partially_paid","unpaid"].includes(e.order.payment_status)&&e.order.support_instalments?s("ns-tabs-item",{staticClass:"flex overflow-y-auto",attrs:{label:e.__("Installments"),identifier:"instalments"}},[s("ns-order-instalments",{attrs:{order:e.order},on:{changed:function(t){return e.refresh()}}})],1):e._e()],1):e._e(),e._v(" "),e.order.id?e._e():s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1)],1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between border-t ns-box-footer"},[s("div",[e.isVoidable?s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.voidOrder()}}},[s("i",{staticClass:"las la-ban"}),e._v("\n "+e._s(e.__("Void"))+"\n ")]):e._e(),e._v(" "),e.isDeleteAble?s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.deleteOrder()}}},[s("i",{staticClass:"las la-trash"}),e._v("\n "+e._s(e.__("Delete"))+"\n ")]):e._e()],1),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.printOrder()}}},[s("i",{staticClass:"las la-print"}),e._v("\n "+e._s(e.__("Print"))+"\n ")])],1)])])}),[],!1,null,null,null).exports},3306:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var n=s(7389),i=s(8603),r=s(6386),a=s(9671),o=s(1703);const l={name:"ns-orders-refund-popup",data:function(){return{order:null,refunds:[],view:"summary",previewed:null,loaded:!1,options:systemOptions,settings:systemSettings,print:new o.Z({settings:systemSettings,options:systemOptions,type:"refund"})}},methods:{__:n.__,popupCloser:i.Z,popupResolver:r.Z,toggleProductView:function(e){this.view="details",this.previewed=e},loadOrderRefunds:function(){var e=this;nsHttpClient.get("/api/nexopos/v4/orders/".concat(this.order.id,"/refunds")).subscribe((function(t){e.loaded=!0,e.refunds=t.refunds}),(function(e){a.kX.error(e.message).subscribe()}))},close:function(){this.$popup.close()},printRefundReceipt:function(e){this.print.printOrder(e.id)}},mounted:function(){this.order=this.$popupParams.order,this.popupCloser(),this.loadOrderRefunds()}};const c=(0,s(1900).Z)(l,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg w-95vw h-95vh md:w-3/5-screen md:h-3/5-screen ns-box flex flex-col overflow-hidden"},[s("div",{staticClass:"border-b p-2 flex items-center justify-between ns-box-header"},[s("h3",[e._v(e._s(e.__("Order Refunds")))]),e._v(" "),s("div",{staticClass:"flex"},["details"===e.view?s("div",{staticClass:"flex items-center justify-center cursor-pointer rounded-full px-3 border hover:bg-info-primary hover:text-white mr-1",on:{click:function(t){e.view="summary"}}},[e._v(e._s(e.__("Go Back")))]):e._e(),e._v(" "),s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"overflow-auto flex-auto ns-box-body"},["summary"===e.view?[e.loaded?e._e():s("div",{staticClass:"flex h-full w-full items-center justify-center"},[s("ns-spinner",{attrs:{size:"24"}})],1),e._v(" "),e.loaded&&0===e.refunds.length?s("div",{staticClass:"flex h-full w-full items-center justify-center"},[s("i",{staticClass:"lar la-frown-open"})]):e._e(),e._v(" "),e.loaded&&e.refunds.length>0?e._l(e.refunds,(function(t){return s("div",{key:t.id,staticClass:"border-b flex flex-col md:flex-row"},[s("div",{staticClass:"w-full md:flex-auto p-2"},[s("h3",{staticClass:"font-semibold mb-1"},[e._v(e._s(e.order.code))]),e._v(" "),s("div",[s("ul",{staticClass:"flex -mx-1 text-sm text-primary"},[s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Total"))+" : "+e._s(e._f("currency")(t.total)))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("By"))+" : "+e._s(t.author.username))])])])]),e._v(" "),s("div",{staticClass:"w-full md:w-16 cursor-pointer hover:bg-info-primary hover:border-info-primary hover:text-white text-lg flex items-center justify-center md:border-l",on:{click:function(s){return e.toggleProductView(t)}}},[s("i",{staticClass:"las la-eye"})]),e._v(" "),s("div",{staticClass:"w-full md:w-16 cursor-pointer hover:bg-info-primary hover:border-info-primary hover:text-white text-lg flex items-center justify-center md:border-l",on:{click:function(s){return e.printRefundReceipt(t)}}},[s("i",{staticClass:"las la-print"})])])})):e._e()]:e._e(),e._v(" "),"details"===e.view?e._l(e.previewed.refunded_products,(function(t){return s("div",{key:t.id,staticClass:"border-b flex flex-col md:flex-row"},[s("div",{staticClass:"w-full md:flex-auto p-2"},[s("h3",{staticClass:"font-semibold mb-1"},[e._v(e._s(t.product.name))]),e._v(" "),s("div",[s("ul",{staticClass:"flex -mx-1 text-sm text-primary"},[s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Condition"))+" : "+e._s(t.condition))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Quantity"))+" : "+e._s(t.quantity))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Total"))+" : "+e._s(e._f("currency")(t.total_price)))])])])])])})):e._e()],2)])}),[],!1,null,null,null).exports},3601:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>o});var n=s(7389),i=s(6386),r=s(8603);const a={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:n.__,popupResolver:i.Z,popupCloser:r.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const o=(0,s(1900).Z)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[s("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),s("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"action-buttons flex border-t"},[s("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),s("hr",{staticClass:"border-r h-16"}),e._v(" "),s("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports},2004:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});const n={name:"ns-pos-loading-popup"};const i=(0,s(1900).Z)(n,(function(){var e=this.$createElement;return(this._self._c||e)("ns-spinner")}),[],!1,null,null,null).exports},1345:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var n=s(9671),i=s(7389);function r(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);"Object"===s&&e.constructor&&(s=e.constructor.name);if("Map"===s||"Set"===s)return Array.from(e);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,n=new Array(t);s{"use strict";s.r(t),s.d(t,{default:()=>i});const n={data:function(){return{title:"",message:"",input:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){var e=this;this.input=this.$popupParams.input||"",this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams.reject(!1),e.$popup.close())}))},methods:{__:s(7389).__,emitAction:function(e){this.$popupParams.onAction(e?this.input:e),this.$popup.close()},reject:function(e){void 0!==this.$popupParams.reject&&this.$popupParams.reject(e),this.$popup.close()}}};const i=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-5/7-screen md:w-3/7-screen flex flex-col shadow-lg",class:e.size,attrs:{id:"prompt-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-2"},[s("h2",{staticClass:"text-3xl font-body"},[e._v(e._s(e.title))]),e._v(" "),s("p",{staticClass:"w-full md:mx-auto md:w-2/3 py-4 text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"p-2"},[s("div",{staticClass:"ns-input"},[s("textarea",{directives:[{name:"model",rawName:"v-model",value:e.input,expression:"input"}],staticClass:"w-full border-2 p-2",attrs:{name:"",id:"",cols:"30",rows:"10"},domProps:{value:e.input},on:{input:function(t){t.target.composing||(e.input=t.target.value)}}})])]),e._v(" "),s("div",{staticClass:"flex border-t action-buttons"},[s("button",{staticClass:"flex-auto w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Ok")))]),e._v(" "),s("hr",{staticClass:"border-r"}),e._v(" "),s("button",{staticClass:"flex-auto w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.reject(!1)}}},[e._v(e._s(e.__("Cancel")))])])])}),[],!1,null,null,null).exports},3296:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(8603),i=s(7389);const r={data:function(){return{value:[],options:[],description:"",label:null,type:"select"}},computed:{},mounted:function(){this.popupCloser(),this.value=this.$popupParams.value||[],this.options=this.$popupParams.options,this.label=this.$popupParams.label,this.description=this.$popupParams.description||"",this.type=this.$popupParams.type||this.type},methods:{popupCloser:n.Z,__:i.__,toggle:function(e){var t=this.value.indexOf(e);-1===t?this.value.unshift(e):this.value.splice(t,1)},isSelected:function(e){return this.value.indexOf(e)>=0},close:function(){this.$popupParams.reject(!1),this.$popup.close()},select:function(e){void 0!==e&&(this.value=[e]),this.$popupParams.resolve(this.value),this.close()}}};const a=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-xl ns-box w-6/7-screen md:w-4/7-screen lg:w-3/7-screen max-h-5/6-screen overflow-hidden flex flex-col"},[s("div",{staticClass:"p-2 flex justify-between border-b items-center ns-box-header"},[s("span",{staticClass:"text-semibold text-primary"},[e._v("\n "+e._s(e.label)+"\n ")]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex flex-col overflow-hidden"},[e.description.length>0?s("p",{staticClass:"p-2 text-center text-sm bg-info-primary"},[e._v(e._s(e.description))]):e._e(),e._v(" "),s("div",{staticClass:"overflow-y-auto"},[s("ul",{staticClass:"ns-vertical-menu"},["select"===e.type?e._l(e.options,(function(t){return s("li",{key:t.value,staticClass:"p-2 border-b border-box-edge text-primary cursor-pointer",on:{click:function(s){return e.select(t)}}},[e._v(e._s(t.label))])})):e._e(),e._v(" "),"multiselect"===e.type?e._l(e.options,(function(t){return s("li",{key:t.value,staticClass:"p-2 border-b text-primary cursor-pointer",class:e.isSelected(t)?"active":"",on:{click:function(s){return e.toggle(t)}}},[e._v(e._s(t.label))])})):e._e()],2)])]),e._v(" "),"multiselect"===e.type?s("div",{staticClass:"flex justify-between"},[s("div"),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.select()}}},[e._v(e._s(e.__("Select")))])],1)]):e._e()])}),[],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=3823,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/public/js/pos-init.min.js b/public/js/pos-init.min.js index 9c2f3a101..9316f4f74 100644 --- a/public/js/pos-init.min.js +++ b/public/js/pos-init.min.js @@ -1 +1 @@ -(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[443,198,89,110,4],{9671:(e,t,s)=>{"use strict";s.d(t,{l:()=>R,kq:()=>X,ih:()=>L,kX:()=>I});var n=s(6486),r=s(9669),i=s(6300),o=s(8345),a=s(9624),l=s(9248),c=s(230);function u(e,t){for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,s)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,s)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var s=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=X.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:n}),new c.y((function(i){s._client[e](t,n,Object.assign(Object.assign({},s._client.defaults[e]),r)).then((function(e){s._lastRequestData=e,i.next(e.data),i.complete(),s._subject.next({identifier:"async.stop"})})).catch((function(e){var t;i.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),s._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,s=e.value;this._subject.next({identifier:t,value:s})}}],s&&u(t.prototype,s),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),p=s(3);function f(e,t){for(var s=0;s=1e3){for(var s,n=Math.floor((""+e).length/3),r=2;r>=1;r--){if(((s=parseFloat((0!=n?e/Math.pow(1e3,n):e).toPrecision(r)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}s%1!=0&&(s=s.toFixed(1)),t=s+["","k","m","b","t"][n]}return t})),O=s(1356),S=s(9698);function $(e,t){for(var s=0;s0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&q(t.prototype,s),n&&q(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()),U=new _({sidebar:["xs","sm","md"].includes(Y.breakpoint)?"hidden":"visible"});L.defineClient(r),window.nsEvent=R,window.nsHttpClient=L,window.nsSnackBar=I,window.nsCurrency=O.W,window.nsTruncate=S.b,window.nsRawCurrency=O.f,window.nsAbbreviate=j,window.nsState=U,window.nsUrl=H,window.nsScreen=Y,window.ChartJS=i,window.EventEmitter=v,window.Popup=x.G,window.RxJS=y,window.FormValidation=C.Z,window.nsCrudHandler=M},7975:(e,t,s)=>{"use strict";s.r(t),s.d(t,{nsAvatar:()=>G,nsButton:()=>a,nsCheckbox:()=>f,nsCkeditor:()=>E,nsCloseButton:()=>P,nsCrud:()=>N,nsCrudForm:()=>b,nsDate:()=>w,nsDateRangePicker:()=>K.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>g.P,nsIconButton:()=>j,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>k,nsMenu:()=>i,nsMultiselect:()=>x,nsNotice:()=>J.Z,nsNumpad:()=>z.Z,nsPaginate:()=>te.Z,nsSearch:()=>ne,nsSelect:()=>d,nsSelectAudio:()=>p,nsSpinner:()=>m,nsSubmenu:()=>o,nsSwitch:()=>F.Z,nsTableRow:()=>h,nsTabs:()=>D,nsTabsItem:()=>V,nsTextarea:()=>y});var n=s(538),r=s(9671),i=n.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,r.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&r.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,s){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),o=n.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),a=n.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=n.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=n.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),u=s(7389),d=n.default.component("ns-select",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},mounted:function(){},methods:{__:u.__},template:'\n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),p=n.default.component("ns-select-audio",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__:u.__,playSelectedSound:function(){this.field.value.length>0&&new Audio(this.field.value).play()}},template:'\n
    \n \n
    \n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),f=n.default.component("ns-checkbox",{data:function(){return{}},props:["checked","field","label"],template:'\n
    \n
    \n \n
    \n {{ label }}\n {{ field.label }}\n
    \n ',computed:{isChecked:function(){return this.field?this.field.value:this.checked}},methods:{toggleIt:function(){void 0!==this.field&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}}),v=s(2242),h=n.default.component("ns-table-row",{props:["options","row","columns","prependOptions","showOptions"],data:function(){return{optionsToggled:!1}},mounted:function(){},methods:{__:u.__,sanitizeHTML:function(e){var t=document.createElement("div");t.innerHTML=e;for(var s=t.getElementsByTagName("script"),n=s.length;n--;)s[n].parentNode.removeChild(s[n]);return t.innerHTML},getElementOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu:function(e){var t=this;if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout((function(){var e=t.$el.querySelectorAll(".relative > .absolute")[0],s=t.$el.querySelectorAll(".relative")[0],n=t.getElementOffset(s);e.style.top=n.top+"px",e.style.left=n.left+"px",s.classList.remove("relative"),s.classList.add("dropdown-holder")}),100);else{var s=this.$el.querySelectorAll(".dropdown-holder")[0];s.classList.remove("dropdown-holder"),s.classList.add("relative")}},handleChanged:function(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync:function(e){var t=this;e.confirm?confirm(e.confirm.message)&&r.ih[e.type.toLowerCase()](e.url).subscribe((function(e){r.kX.success(e.message).subscribe(),t.$emit("reload",t.row)}),(function(e){t.toggleMenu(),r.kX.error(e.message).subscribe()})):(r.l.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup:function(e,t){var s=window.nsExtraComponents[e.component];if(e.component)return s?new Promise((function(n,r){v.G.show(s,{resolve:n,reject:r,row:t,action:e})})):r.kX.error((0,u.__)('Unable to load the component "'.concat(e.component,'". Make sure the component is registered to "nsExtraComponents".'))).subscribe();this.triggerAsync(e)}},template:'\n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n '}),m=n.default.component("ns-spinner",{data:function(){return{}},mounted:function(){},computed:{validatedSize:function(){return this.size||24},validatedBorder:function(){return this.border||8},validatedAnimation:function(){return this.animation||"fast"}},props:["color","size","border"],template:"\n
    \n
    \n
    \n "}),_=s(7266),b=n.default.component("ns-crud-form",{data:function(){return{form:{},globallyChecked:!1,formValidation:new _.Z,rows:[]}},mounted:function(){this.loadForm()},props:["src","create-url","field-class","return-url","submit-url","submit-method","disable-tabs"],computed:{activeTabFields:function(){for(var e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]}},methods:{__:u.__,toggle:function(e){for(var t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},handleShowOptions:function(e){this.rows.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},submit:function(){var e=this;return this.formValidation.validateForm(this.form).length>0?r.kX.error(this.$slots["error-invalid"]?this.$slots["error-invalid"][0].text:"No error message provided for having an invalid form.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():(this.formValidation.disableForm(this.form),void 0===this.submitUrl?r.kX.error(this.$slots["error-no-submit-url"]?this.$slots["error-no-submit-url"][0].text:"No error message provided for not having a valid submit url.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():void r.ih[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,this.formValidation.extractForm(this.form)).subscribe((function(t){if("success"===t.status){if(e.submitMethod&&"post"===e.submitMethod.toLowerCase()&&!1!==e.returnUrl)return document.location=t.data.editUrl||e.returnUrl;r.kX.info(t.message,(0,u.__)("Okay"),{duration:3e3}).subscribe(),e.$emit("save",t)}e.formValidation.enableForm(e.form)}),(function(t){r.kX.error(t.message,void 0,{duration:5e3}).subscribe(),void 0!==t.data&&e.formValidation.triggerError(e.form,t.data),e.formValidation.enableForm(e.form)})))},handleGlobalChange:function(e){this.globallyChecked=e,this.rows.forEach((function(t){return t.$checked=e}))},loadForm:function(){var e=this;r.ih.get("".concat(this.src)).subscribe({next:function(t){e.form=e.parseForm(t.form),r.kq.doAction("ns-crud-form-loaded",e),e.$emit("updated",e.form)},error:function(e){r.kX.error(e.message,"OKAY",{duration:0}).subscribe()}})},parseForm:function(e){e.main.value=void 0===e.main.value?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];var t=0;for(var s in e.tabs)0===t&&(e.tabs[s].active=!0),e.tabs[s].active=void 0!==e.tabs[s].active&&e.tabs[s].active,e.tabs[s].fields=this.formValidation.createFields(e.tabs[s].fields),t++;return e}},template:'\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n
    {{ tab.label }}
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n '}),y=n.default.component("ns-textarea",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),g=s(8737),x=n.default.component("ns-multiselect",{data:function(){return{showPanel:!1,search:""}},props:["field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=void 0!==t.selected&&t.selected,e.field.value&&e.field.value.includes(t.value)&&(t.selected=!0),t}))}},methods:{__:u.__,addOption:function(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout((function(){}),100))},removeOption:function(e,t){var s=this;if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout((function(){s.search=""}),100),!1}},mounted:function(){var e=this;this.field.value&&this.field.value.reverse().forEach((function(t){var s=e.field.options.filter((function(e){return e.value===t}));s.length>=0&&e.addOption(s[0])}))},template:'\n
    \n \n
    \n
    \n
    \n
    \n
    \n {{ option.label }}\n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n
    \n '}),w=n.default.component("ns-date",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),C=s(4255),k=n.default.component("ns-media-input",{template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n ',computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},data:function(){return{}},props:["placeholder","leading","type","field"],mounted:function(){},methods:{toggleMedia:function(){var e=this;new Promise((function(t,s){v.G.show(C.default,Object.assign({resolve:t,reject:s},e.field.data||{}))})).then((function(t){"use-selected"===t.event&&(e.field.data&&"url"!==e.field.data.type?e.field.data&&"model"!==e.field.data.type||(e.field.value=t.value[0]):e.field.value=t.value[0].sizes.original,e.$forceUpdate())}))}}}),P=n.default.component("ns-close-button",{template:'\n \n ',methods:{clicked:function(e){this.$emit("click",e)}}}),j=n.default.component("ns-icon-button",{template:'\n \n ',props:["className","buttonClass","type"],methods:{clicked:function(e){this.$emit("click",e)}}}),O=s(1272),S=s.n(O),$=s(5234),T=s.n($),E=n.default.component("ns-ckeditor",{data:function(){return{editor:T()}},components:{ckeditor:S().component},mounted:function(){},methods:{__:u.__},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),D=n.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),V=n.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),F=s(9408),A=s(2744),q=s(7757),Z=s.n(q),R=s(3601),L=s(8603),I=s(6386);const H={data:function(){return{fields:[],validation:new _.Z}},methods:{__:u.__,popupCloser:L.Z,popupResolver:I.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var M=s(1900);const X=(0,M.Z)(H,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[s("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[s("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[s("div",[s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var Y=function(e,t,s,n){return new(s||(s=Promise))((function(r,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))};const U={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,u.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:u.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var s=[];t-3>1&&s.push(1,"...");for(var n=1;n<=e;n++)t+3>n&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),r.kX.success((0,u.__)("The document has been generated.")).subscribe()}),(function(e){r.kX.error(e.message||(0,u.__)("Unexpected error occured.")).subscribe()}))},clearSelectedEntries:function(){var e=this;v.G.show(R.default,{title:(0,u.__)("Clear Selected Entries ?"),message:(0,u.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var s=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(s,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(s){s.$checked=e,t.refreshRow(s)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){r.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,u.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){r.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){r.kX.error(e.message).subscribe()}}):void 0:r.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,u.__)("No selection has been made.")).subscribe():r.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,u.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return Y(this,void 0,void 0,Z().mark((function e(){var t,s=this;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(X),e.next=4,new Promise((function(e,t){v.G.show(X,{resolve:e,reject:t,queryFilters:s.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,r.kX.error(t.message).subscribe()}))}}};const N=(0,M.Z)(U,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?s("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[s("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?s("div",{staticClass:"px-2 flex items-center justify-center"},[s("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[s("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),s("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[s("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?s("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[s("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2 flex items-center justify-center"},[s("button",{staticClass:"rounded-full\n text-sm\n h-10\n px-3\n outline-none\n border\n ns-crud-button\n ",on:{click:function(t){return e.refresh()}}},[s("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?s("div",{staticClass:"px-2 flex items-center"},[s("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none ",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():s("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?s("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():s("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?s("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),s("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?s("div",{staticClass:"px-1 flex items-center"},[s("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[s("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),s("div",{staticClass:"px-1 flex items-center"},[s("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[s("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),s("div",{staticClass:"flex"},[s("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",[s("th",{staticClass:"text-center px-2 border w-16 py-2"},[s("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?s("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,n){return s("th",{key:n,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(n)}}},[s("div",{staticClass:"w-full flex justify-between items-center"},[s("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),s("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?s("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?s("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?s("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),s("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,n){return s("ns-table-row",{key:n,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():s("tr",[s("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?s("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?s:s[0]}}},[s("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,n){return s("option",{key:n,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),s("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),s("div",{staticClass:"flex"},[s("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),s("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[s("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,n){return["..."!==e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(s){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[s("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var z=s(4864),Q=s(1726),W=s(7259);const B=n.default.extend({methods:{__:u.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,Q.createAvatar)(W,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const G=(0,M.Z)(B,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[s("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),s("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?s("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?s("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var K=s(4806),J=s(1828),ee=s(1544),te=s(3506);const se={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:u.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,s,n;e.searchText.length>0&&r.ih[e.method||"post"](e.url,(t={},s=e.searchArgument||"search",n=e.searchText,s in t?Object.defineProperty(t,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[s]=n,t)).subscribe({next:function(t){e.results=t},error:function(e){r.kX.error(e.message||(0,u.__)("An unexpected error occured.")).subscribe()}})}),1e3)}},mounted:function(){}};const ne=(0,M.Z)(se,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-search"},[s("div",{staticClass:"input-group info border-2"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),s("div",{staticClass:"relative"},[s("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?s("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,n){return s("li",{key:n,staticClass:"border-b p-2 cursor-pointer",on:{click:function(s){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},8737:(e,t,s)=>{"use strict";s.d(t,{P:()=>a});var n=s(538),r=s(4806),i=s(2744),o=s(9408),a=n.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:r.Z,nsDateTimePicker:i.Z,nsSwitch:o.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\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 '})},1356:(e,t,s)=>{"use strict";s.d(t,{W:()=>c,f:()=>u});var n=s(2077),r=s.n(n),i=s(538),o=s(6740),a=s.n(o),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=i.default.filter("currency",(function(e){var t,s,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===n){var i={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};s=a()(e,i).format()}else s=r()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(s).concat("after"===ns.currency.ns_currency_position?t:"")})),u=function(e){var t="0.".concat(l);return parseFloat(r()(e).format(t))}},9698:(e,t,s)=>{"use strict";s.d(t,{b:()=>n});var n=s(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,s)=>{"use strict";function n(e,t){for(var s=0;sr});var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,s,r;return t=e,s=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var s in e.tabs)if(e.tabs[s].fields){var n=[],r=this.validateFieldsErrors(e.tabs[s].fields);r.length>0&&n.push(r),e.tabs[s].errors=n.flat(),t.push(n.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var s in e)0===t&&(e[s].active=!0),e[s].active=void 0!==e[s].active&&e[s].active,e[s].fields=this.createFields(e[s].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var s=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(s,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(s){t.fieldPassCheck(e,s)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var s in e.tabs)void 0===t[s]&&(t[s]={}),t[s]=this.extractFields(e.tabs[s].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var s=function(s){var n=s.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===n.length&&e.tabs[n[0]].fields.forEach((function(e){e.name===n[1]&&t.errors[s].forEach((function(t){var s={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(s)}))})),s===e.main.name&&t.errors[s].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var n in t.errors)s(n)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var s=function(s){e.forEach((function(e){e.name===s&&t.errors[s].forEach((function(t){var s={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(s)}))}))};for(var n in t.errors)s(n)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(s,n){s.identifier===t.identifier&&!0===s.invalid&&e.errors.splice(n,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(s,n){!0===s[t.identifier]&&e.errors.splice(n,1)}))}return e}}],s&&n(t.prototype,s),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,s)=>{"use strict";s.d(t,{__:()=>n,c:()=>r});var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},r=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},8603:(e,t,s)=>{"use strict";function n(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var s=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(s+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}s.d(t,{Z:()=>n})},6386:(e,t,s)=>{"use strict";function n(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}s.d(t,{Z:()=>n})},2242:(e,t,s)=>{"use strict";s.d(t,{G:()=>c});var n=s(7757),r=s.n(n),i=s(9248);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var s=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[s-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new i.x}var t,s,n;return t=e,s=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s=0;s<10;s++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,s,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,r().mark((function o(){var a,l,c,u=this;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("function"!=typeof e){r.next=9;break}return r.prev=1,r.next=4,e();case 4:e=r.sent.default,r.next=9;break;case 7:r.prev=7,r.t0=r.catch(1);case 9:a=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",a.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){u.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=i,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return r.stop()}}),o,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var s="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(s),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],n=[{key:"show",value:function(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=new e(n);return r.open(t,s),r}}],s&&a(t.prototype,s),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1703:(e,t,s)=>{"use strict";function n(e,t){for(var s=0;sr});var r=function(){function e(t){var s=t.settings,n=t.options,r=t.type;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.printingURL={refund:"refund_printing_url",sale:"sale_printing_url",payment:"payment_printing_url"},this.settings=s,this.options=n,this.type=r||"refund"}var t,s,r;return t=e,(s=[{key:"processRegularPrinting",value:function(e){var t=document.querySelector("printing-section");t&&t.remove();var s=this.settings[this.printingURL[this.type]].replace("{reference_id}",e),n=document.createElement("iframe");n.id="printing-section",n.className="hidden",n.src=s,document.body.appendChild(n),setTimeout((function(){document.querySelector("#printing-section").remove()}),5e3)}},{key:"printOrder",value:function(e){"default"===this.options.ns_pos_printing_gateway?this.processRegularPrinting(e):this.processCustomPrinting(e,this.options.ns_pos_printing_gateway)}},{key:"processCustomPrinting",value:function(e,t){nsHooks.applyFilters("ns-order-custom-refund-print",{printed:!1,reference_id:e,gateway:t}).printed||nsSnackBar.error(__("Unsupported print gateway.")).subscribe()}}])&&n(t.prototype,s),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,s)=>{"use strict";s.d(t,{S:()=>i});var n=s(3260);function r(e,t){for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return n.Observable.create((function(n){var i=s.__createSnack({message:e,label:t,type:r.type}),o=i.buttonNode,a=(i.textNode,i.snackWrapper,i.sampleSnack);o.addEventListener("click",(function(e){n.onNext(o),n.onCompleted(),a.remove()})),s.__startTimer(r.duration,a)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var s,n=function(){e>0&&!1!==e&&(s=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(s)})),t.addEventListener("mouseleave",(function(){n()})),n()}},{key:"__createSnack",value:function(e){var t=e.message,s=e.label,n=e.type,r=void 0===n?"info":n,i=document.getElementById("snack-wrapper")||document.createElement("div"),o=document.createElement("div"),a=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),u="",d="";switch(r){case"info":u="",d="info";break;case"error":u="",d="error";break;case"success":u="",d="success"}return a.textContent=t,a.setAttribute("class","pr-2"),s&&(l.setAttribute("class","ns-button default"),c.textContent=s,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(u)),l.appendChild(c)),o.appendChild(a),o.appendChild(l),o.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(d)),i.appendChild(o),null===document.getElementById("snack-wrapper")&&(i.setAttribute("id","snack-wrapper"),i.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(i)),{snackWrapper:i,sampleSnack:o,buttonsWrapper:l,buttonNode:c,textNode:a}}}],s&&r(t.prototype,s),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},279:(e,t,s)=>{"use strict";s.d(t,{$:()=>l});var n=s(9671),r=s(7389),i=s(2242),o=s(4492);function a(e,t){for(var s=0;sparseFloat(e.$quantities().quantity)-u)return n.kX.error((0,r.__)("Unable to add the product, there is not enough stock. Remaining %s").replace("%s",(e.$quantities().quantity-u).toString())).subscribe()}s({quantity:1})}else l.open(o.Z,{resolve:s,reject:a,product:c,data:e})}))}}])&&a(t.prototype,s),l&&a(t,l),Object.defineProperty(t,"prototype",{writable:!1}),e}()},6086:(e,t,s)=>{"use strict";var n=s(7757),r=s.n(n),i=s(279),o=s(2242),a=s(9671),l=s(7389);const c={data:function(){return{unitsQuantities:[],loadsUnits:!1,options:null,optionsSubscriber:null}},beforeDestroy:function(){this.optionsSubscriber.unsubscribe()},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams.reject(!1),e.$popup.close())})),this.optionsSubscriber=POS.options.subscribe((function(t){e.options=t})),void 0!==this.$popupParams.product.$original().selectedUnitQuantity?this.selectUnit(this.$popupParams.product.$original().selectedUnitQuantity):void 0!==this.$popupParams.product.$original().unit_quantities&&1===this.$popupParams.product.$original().unit_quantities.length?this.selectUnit(this.$popupParams.product.$original().unit_quantities[0]):(this.loadsUnits=!0,this.loadUnits())},methods:{__:l.__,displayRightPrice:function(e){return POS.getSalePrice(e,this.$popupParams.product.$original())},loadUnits:function(){var e=this;a.ih.get("/api/nexopos/v4/products/".concat(this.$popupParams.product.$original().id,"/units/quantities")).subscribe((function(t){if(0===t.length)return e.$popup.close(),a.kX.error((0,l.__)("This product doesn't have any unit defined for selling.")).subscribe();e.unitsQuantities=t,1===e.unitsQuantities.length&&e.selectUnit(e.unitsQuantities[0])}))},selectUnit:function(e){if(null===e.unit)return a.kX.error((0,l.__)('The unit attached to this product is missing or not assigned. Please review the "Unit" tab for this product.')).subscribe(),this.$popup.close();this.$popupParams.resolve({unit_quantity_id:e.id,unit_name:e.unit.name,$quantities:function(){return e}}),this.$popup.close()}}};const u=(0,s(1900).Z)(c,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-full w-full flex items-center justify-center",attrs:{id:"ns-units-selector"}},[e.unitsQuantities.length>0?s("div",{staticClass:"ns-box w-2/3-screen lg:w-1/3-screen overflow-hidden flex flex-col"},[s("div",{staticClass:"h-16 flex justify-center items-center flex-shrink-0",attrs:{id:"header"}},[s("h3",{staticClass:"font-bold text-primary"},[e._v(e._s(e.__("Choose Selling Unit")))])]),e._v(" "),e.unitsQuantities.length>0?s("div",{staticClass:"grid grid-flow-row grid-cols-2 overflow-y-auto"},e._l(e.unitsQuantities,(function(t){return s("div",{key:t.id,staticClass:"ns-numpad-key info cursor-pointer border flex-shrink-0 flex flex-col items-center justify-center",on:{click:function(s){return e.selectUnit(t)}}},[s("div",{staticClass:"h-40 w-full flex items-center justify-center overflow-hidden"},[t.preview_url?s("img",{staticClass:"object-cover h-full",attrs:{src:t.preview_url,alt:t.unit.name}}):e._e(),e._v(" "),t.preview_url?e._e():s("div",{staticClass:"h-40 flex items-center justify-center"},[s("i",{staticClass:"las la-image text-primary text-6xl"})])]),e._v(" "),s("div",{staticClass:"h-0 w-full"},[s("div",{staticClass:"relative w-full flex items-center justify-center -top-10 h-20 py-2 flex-col overlay"},[s("h3",{staticClass:"font-bold text-primary py-2 text-center"},[e._v(e._s(t.unit.name)+" ("+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-sm font-medium text-primary"},[e._v(e._s(e._f("currency")(e.displayRightPrice(t))))])])])])})),0):e._e()]):e._e(),e._v(" "),0===e.unitsQuantities.length?s("div",{staticClass:"h-56 flex items-center justify-center"},[s("ns-spinner")],1):e._e()])}),[],!1,null,null,null).exports;function d(e,t){for(var s=0;s=544&&window.innerWidth<768?this.screenIs="sm":window.innerWidth>=768&&window.innerWidth<992?this.screenIs="md":window.innerWidth>=992&&window.innerWidth<1200?this.screenIs="lg":window.innerWidth>=1200&&(this.screenIs="xl")}},{key:"is",value:function(e){return void 0===e?this.screenIs:this.screenIs===e}}])&&h(t.prototype,s),n&&h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),_=s(1356),b=s(381),y=s.n(b);function g(e,t){for(var s=0;s0)return(0,l.__)("Some products has been added to the cart. Would youl ike to discard this order ?")},a.kq.addAction("ns-after-cart-changed","listen-add-to-cart",(function(){return e.refreshCart()})),this.types.subscribe((function(t){var s=Object.values(t).filter((function(e){return e.selected}));if(s.length>0){var n=e.order.getValue();n.type=s[0],e.order.next(n)}})),window.addEventListener("resize",(function(){e._responsive.detect(),e.defineCurrentScreen()})),window.onbeforeunload=function(){if(e.products.getValue().length>0)return(0,l.__)("Some products has been added to the cart. Would youl ike to discard this order ?")}}},{key:"getSalePrice",value:function(e,t){return"yes"===this.options.getValue().ns_pos_price_with_tax?(0,_.f)(e.sale_price_with_tax):(0,_.f)(e.sale_price_without_tax)}},{key:"getCustomPrice",value:function(e,t){return"yes"===this.options.getValue().ns_pos_price_with_tax?(0,_.f)(e.custom_price_with_tax):(0,_.f)(e.custom_price_without_tax)}},{key:"getWholesalePrice",value:function(e,t){return"yes"===this.options.getValue().ns_pos_price_with_tax?(0,_.f)(e.wholesale_price_with_tax):(0,_.f)(e.wholesale_price_without_tax)}},{key:"setHoldPopupEnabled",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._holdPopupEnabled=e}},{key:"getHoldPopupEnabled",value:function(){return this._holdPopupEnabled}},{key:"processInitialQueue",value:function(){return x(this,void 0,void 0,r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=r().keys(this._initialQueue);case 1:if((e.t1=e.t0()).done){e.next=14;break}return t=e.t1.value,e.prev=3,e.next=6,this._initialQueue[t]();case 6:e.sent,e.next=12;break;case 9:e.prev=9,e.t2=e.catch(3),a.kX.error(e.t2.message).subscribe();case 12:e.next=1;break;case 14:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"removeCoupon",value:function(e){var t=this.order.getValue(),s=t.coupons,n=s.indexOf(e);s.splice(n,1),t.coupons=s,this.order.next(t)}},{key:"pushCoupon",value:function(e){var t=this.order.getValue();t.coupons.forEach((function(t){if(t.code===e.code){var s=(0,l.__)("This coupon is already added to the cart");throw a.kX.error(s).subscribe(),s}})),t.coupons.push(e),this.order.next(t),this.refreshCart()}},{key:"header",get:function(){var e={buttons:{nsPosDashboardButton:w,nsPosPendingOrderButton:C,nsPosOrderTypeButton:k,nsPosCustomersButton:P,nsPosResetButton:j}};return"yes"===this.options.getValue().ns_pos_registers_enabled&&(e.buttons.nsPosCashRegister=O),a.kq.doAction("ns-pos-header",e),e}},{key:"defineOptions",value:function(e){this._options.next(e)}},{key:"defineCurrentScreen",value:function(){this._visibleSection.next(["xs","sm"].includes(this._responsive.is())?"grid":"both"),this._screen.next(this._responsive.is())}},{key:"changeVisibleSection",value:function(e){["both","cart","grid"].includes(e)&&(["cart","both"].includes(e)&&this.refreshCart(),this._visibleSection.next(e))}},{key:"addPayment",value:function(e){if(e.value>0){var t=this._order.getValue();return t.payments.push(e),this._order.next(t),this.computePaid()}return a.kX.error("Invalid amount.").subscribe()}},{key:"removePayment",value:function(e){if(void 0!==e.id)return a.kX.error((0,l.__)("Unable to delete a payment attached to the order.")).subscribe();var t=this._order.getValue(),s=t.payments.indexOf(e);t.payments.splice(s,1),this._order.next(t),a.l.emit({identifier:"ns.pos.remove-payment",value:e}),this.updateCustomerAccount(e),this.computePaid()}},{key:"updateCustomerAccount",value:function(e){if("account-payment"===e.identifier){var t=this.order.getValue().customer;t.account_amount+=e.value,this.selectCustomer(t)}}},{key:"getPriceWithoutTax",value:function(e,t,s){return"inclusive"===s?e/(t+100)*100:"exclusive"===s?e:void 0}},{key:"getPriceWithTax",value:function(e,t,s){return"inclusive"===s?e:"exclusive"===s?e/100*(t+100):void 0}},{key:"getVatValue",value:function(e,t,s){return"inclusive"===s?e-this.getPriceWithoutTax(e,t,s):"exclusive"===s?this.getPriceWithTax(e,t,s)-e:void 0}},{key:"computeTaxes",value:function(){var e=this;return new Promise((function(t,s){var n=e.order.getValue();if(void 0===(n=e.computeProductsTaxes(n)).tax_group_id||null===n.tax_group_id)return e.computeOrderTaxes(n),t({data:{order:n},status:"success"});var r=n.tax_groups;return Object.values(r).length>0?(void 0!==r[n.tax_group_id]&&(n.taxes=r[n.tax_group_id].taxes.map((function(t){return t.tax_value=e.getVatValue(n.subtotal-n.discount,t.rate,n.tax_type),t}))),n=e.computeOrderTaxes(n),t({status:"success",data:{tax:r[n.tax_group_id],order:n}})):void 0!==n.tax_group_id&&n.tax_group_id.toString().length>0?void a.ih.get("/api/nexopos/v4/taxes/groups/".concat(n.tax_group_id)).subscribe({next:function(s){return n=e.computeOrderTaxGroup(n,s),t({status:"success",data:{tax:s,order:n}})},error:function(e){return s(e)}}):s({status:"failed",message:(0,l.__)("No tax group assigned to the order")})}))}},{key:"computeOrderTaxGroup",value:function(e,t){var s=this;return this.options.getValue().ns_pos_vat,this.options.getValue().ns_pos_price_with_tax,t.taxes=t.taxes.map((function(t){return{tax_id:t.id,tax_name:t.name,rate:parseFloat(t.rate),tax_value:s.getVatValue(e.subtotal-e.discount,t.rate,e.tax_type)}})),0===t.taxes.length?a.kX.error((0,l.__)("The selected tax group doesn't have any assigned sub taxes. This might cause wrong figures."),(0,l.__)("Proceed"),{duration:!1}).subscribe():(e.tax_groups=e.tax_groups||[],e.taxes=t.taxes,e.tax_groups[t.id]=t,this.computeOrderTaxes(e))}},{key:"computeOrderTaxes",value:function(e){var t=this.options.getValue().ns_pos_vat,s="yes"===this.options.getValue().ns_pos_price_with_tax;return["flat_vat","variable_vat","products_variable_vat","products_flat_vat"].includes(t)&&e.taxes&&e.taxes.length>0&&(e.tax_value+=e.taxes.map((function(e){return e.tax_value})).reduce((function(e,t){return e+t}))),e.total_tax_value=e.tax_value,["products_variable_vat","products_flat_vat","products_vat"].includes(t)&&!s&&(e.total_tax_value=e.products_tax_value+e.tax_value),e}},{key:"computeProductsTaxes",value:function(e){var t=this.products.getValue(),s=t.map((function(e){return e.tax_value}));e.products_tax_value=0;var n=this.options.getValue().ns_pos_vat;return["products_flat_vat","products_variable_vat","products_vat"].includes(n)&&s.length>0&&(e.products_tax_value+=s.reduce((function(e,t){return e+t}))),e.products=t,e.total_products=t.length,e}},{key:"canProceedAsLaidAway",value:function(e){var t=this;return new Promise((function(s,n){return x(t,void 0,void 0,r().mark((function t(){var i,a,c,u,d,p,f,h=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.customer.group.minimal_credit_payment,a=(e.total*i/100).toFixed(ns.currency.ns_currency_precision),a=parseFloat(a),t.prev=3,t.next=6,new Promise((function(t,s){o.G.show(E,{order:e,reject:s,resolve:t})}));case 6:if(!(0===(c=t.sent).order.instalments.length&&c.order.tendered=a&&y()(e.date).isSame(ns.date.moment.startOf("day"),"day")}))).length){t.next=17;break}return t.abrupt("return",s({status:"success",message:(0,l.__)("Layaway defined"),data:{order:c.order}}));case 17:(f=p[0].amount)>0?o.G.show($,{title:(0,l.__)("Initial Payment"),message:(0,l.__)('In order to proceed, an initial payment of {amount} is required for the selected payment type "{paymentType}". Would you like to proceed ?').replace("{amount}",v.default.filter("currency")(f)).replace("{paymentType}",d.label),onAction:function(e){if(e){var t={identifier:d.identifier,label:d.label,value:f,readonly:!1,selected:!0};h.addPayment(t),p[0].paid=!0,s({status:"success",message:(0,l.__)("Layaway defined"),data:{order:c.order}})}else n({status:"failed",message:(0,l.__)("The request was canceled")})}}):s({status:"success",message:(0,l.__)("Layaway defined"),data:{order:c.order}});case 19:t.next=24;break;case 21:return t.prev=21,t.t0=t.catch(3),t.abrupt("return",n(t.t0));case 24:case"end":return t.stop()}}),t,this,[[3,21]])})))}))}},{key:"submitOrder",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise((function(s,n){return x(e,void 0,void 0,r().mark((function e(){var i,o,c,u,d,p=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=Object.assign(Object.assign({},this.order.getValue()),t),o=i.customer.group.minimal_credit_payment,"hold"===i.payment_status){e.next=20;break}if(!(0===i.payments.length&&i.total>0&&i.total>i.tendered)){e.next=20;break}if("no"!==this.options.getValue().ns_orders_allow_partial){e.next=9;break}return c=(0,l.__)("Partially paid orders are disabled."),e.abrupt("return",n({status:"failed",message:c}));case 9:if(!(o>=0)){e.next=20;break}return e.prev=10,e.next=13,this.canProceedAsLaidAway(i);case 13:u=e.sent,i=u.data.order,e.next=20;break;case 17:return e.prev=17,e.t0=e.catch(10),e.abrupt("return",n(e.t0));case 20:if(this._isSubmitting){e.next=24;break}return d=void 0!==i.id?"put":"post",this._isSubmitting=!0,e.abrupt("return",a.ih[d]("/api/nexopos/v4/orders".concat(void 0!==i.id?"/"+i.id:""),i).subscribe({next:function(e){s(e),p.reset(),a.kq.doAction("ns-order-submit-successful",e),p._isSubmitting=!1;var t=p.options.getValue().ns_pos_complete_sale_audio;t.length>0&&new Audio(t).play()},error:function(e){p._isSubmitting=!1,n(e),a.kq.doAction("ns-order-submit-failed",e)}}));case 24:return e.abrupt("return",n({status:"failed",message:(0,l.__)("An order is currently being processed.")}));case 25:case"end":return e.stop()}}),e,this,[[10,17]])})))}))}},{key:"defineQuantities",value:function(e){var t=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new Promise((function(n,r){var i={unit:s.filter((function(t){return t.id===e.unit_id}))[0]||{},sale_price_with_tax:"normal"===e.mode?parseFloat(e.price_with_tax):0,sale_price_without_tax:"normal"===e.mode?parseFloat(e.price_without_tax):0,sale_price:"normal"===e.mode?parseFloat(e.unit_price):0,sale_price_tax:"normal"===e.mode?e.tax_value:0,sale_price_edit:0,wholesale_price_with_tax:"wholesale"===e.mode?parseFloat(e.price_with_tax):0,wholesale_price_without_tax:"wholesale"===e.mode?parseFloat(e.price_without_tax):0,wholesale_price:"wholesale"===e.mode?parseFloat(e.unit_price):0,wholesale_price_tax:"wholesale"===e.mode?e.tax_value:0,wholesale_price_edit:0,custom_price_with_tax:"custom"===e.mode?parseFloat(e.price_with_tax):0,custom_price_without_tax:"custom"===e.mode?parseFloat(e.price_without_tax):0,custom_price:"custom"===e.mode?parseFloat(e.unit_price):0,custom_price_tax:"custom"===e.mode?e.tax_value:0,custom_price_edit:"custom"===e.mode?parseFloat(e.unit_price):0};if(["inclusive","exclusive"].includes(e.tax_type))try{if(!e.tax_group_id)return i.sale_price_tax=0,i.wholesale_price_tax=0,i.sale_price_without_tax=e.unit_price,n(i);a.ih.get("/api/nexopos/v4/taxes/groups/".concat(e.tax_group_id)).subscribe({next:function(s){return["sale","wholesale","custom"].forEach((function(n){i[n+"_price_tax"]=s.taxes.map((function(s){return t.getVatValue(i[n+"_price"],s.rate,e.tax_type)})).reduce((function(e,t){return e+t})),i["gross_"+n+"_price"]=i[n+"_price"]+i[n+"_price_tax"],i["net_"+n+"_price"]=i[n+"_price"]-i[n+"_price_tax"]})),n(i)},error:function(e){r(!1)}})}catch(e){return a.kX.error((0,l.__)("An error has occured while computing the product.")).subscribe()}return n(i)}))}},{key:"loadOrder",value:function(e){var t=this;return new Promise((function(s,n){a.ih.get("/api/nexopos/v4/orders/".concat(e,"/pos")).subscribe({next:function(e){return x(t,void 0,void 0,r().mark((function t(){var i,o,l,c,u=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,a.kq.doAction("ns-before-load-order",{order:e}),t.next=7;break;case 4:return t.prev=4,t.t0=t.catch(0),t.abrupt("return",n(t.t0));case 7:i=this.options.getValue(),e=Object.assign(Object.assign({},this.defaultOrder()),e),o=[],l=r().mark((function t(s){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==(n=e.products[s]).product){t.next=9;break}return t.t0=n.name,t.t1=n.unit_id,t.next=6,u.defineQuantities(n);case 6:t.t2=t.sent,t.t3=[t.t2],n.product={mode:"custom",name:t.t0,unit_id:t.t1,unit_quantities:t.t3};case 9:n.$original=function(){return n.product},n.$quantities=function(){var e=n.product.unit_quantities.filter((function(e){return+e.id==+n.unit_quantity_id||void 0===e.id}))[0];return"custom"===n.mode&&"yes"===i.ns_pos_price_with_tax&&(e.custom_price_edit=n.unit_price),e},o.push(n);case 12:case"end":return t.stop()}}),t)})),c=0;case 12:if(!(c1&&void 0!==arguments[1])||arguments[1],s=this.options.getValue();if("disabled"===s.ns_pos_printing_enabled_for)return!1;"default"===s.ns_pos_printing_gateway?this.processRegularPrinting(e):this.processCustomPrinting(e,s.ns_pos_printing_gateway,t)}},{key:"processCustomPrinting",value:function(e,t){var s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return x(this,void 0,void 0,r().mark((function n(){return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:!1===a.kq.applyFilters(s?"ns-order-custom-print":"ns-order-custom-print-aloud",{printed:!1,order_id:e,gateway:t}).printed&&a.kX.error((0,l.__)("Unsupported print gateway.")).subscribe();case 2:case"end":return n.stop()}}),n)})))}},{key:"processRegularPrinting",value:function(e){var t=document.querySelector("printing-section");t&&t.remove();var s=document.createElement("iframe");s.id="printing-section",s.className="hidden",s.src=this.settings.getValue().urls.sale_printing_url.replace("{id}",e),document.body.appendChild(s)}},{key:"computePaid",value:function(){var e=this._order.getValue();e.tendered=0,e.payments.length>0&&(e.tendered=e.payments.map((function(e){return e.value})).reduce((function(e,t){return t+e}))),e.tendered>=e.total?e.payment_status="paid":e.tendered>0&&e.tendered0&&(t.products.filter((function(t){return e.products.map((function(e){return e.product_id})).includes(t.product_id)})).length>0||-1!==s.indexOf(e)||s.push(e)),e.categories.length>0&&(t.products.filter((function(t){return e.categories.map((function(e){return e.category_id})).includes(t.$original().category_id)})).length>0||-1!==s.indexOf(e)||s.push(e))})),s.forEach((function(t){a.kX.error((0,l.__)('The coupons "%s" has been removed from the cart, as it\'s required conditions are no more meet.').replace("%s",t.name),(0,l.__)("Okay"),{duration:6e3}).subscribe(),e.removeCoupon(t)}))}},{key:"refreshCart",value:function(){return x(this,void 0,void 0,r().mark((function e(){var t,s,n,i,o,c,u,d,p,f,v,h,m;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.checkCart(),t=this.products.getValue(),s=this.order.getValue(),n=this.options.getValue().ns_pos_price_with_tax,(i=t.filter((function(e){return"dynamic"!==e.product_type})).map((function(e){return"yes"===n?e.total_price_with_tax:e.total_price_without_tax}))).length>0?(o=i.reduce((function(e,t){return e+t})),c=0,(u=t.filter((function(e){return"dynamic"===e.product_type})).map((function(e){return e.unit_price=o*e.rate/100,e.total_price=e.unit_price*e.quantity,e.total_price}))).length>0&&(c=u.reduce((function(e,t){return e+t}))),s.subtotal=o+c):s.subtotal=0,d=s.coupons.map((function(e){return"percentage_discount"===e.type?(e.value=s.subtotal*e.discount_value/100,e.value):(e.value=e.discount_value,e.value)})),s.total_coupons=0,d.length>0&&(s.total_coupons=d.reduce((function(e,t){return e+t}))),"percentage"===s.discount_type&&(s.discount=s.discount_percentage*s.subtotal/100),s.discount>s.subtotal&&0===s.total_coupons&&(s.discount=s.subtotal,a.kX.info((0,l.__)("The discount has been set to the cart subtotal.")).subscribe()),s.tax_value=0,s.total_tax_value=0,this.order.next(s),e.prev=14,e.next=17,this.computeTaxes();case 17:p=e.sent,s=p.data.order,e.next=24;break;case 21:e.prev=21,e.t0=e.catch(14),!1!==e.t0&&void 0!==e.t0.message&&a.kX.error(e.t0.message||(0,l.__)("An unexpected error has occured while fecthing taxes."),(0,l.__)("OKAY"),{duration:0}).subscribe();case 24:(f=t.map((function(e){return"inclusive"===e.tax_type?e.tax_value:0}))).length>0&&f.reduce((function(e,t){return e+t})),v=s.tax_type,h=this.options.getValue().ns_pos_vat,m=0,["flat_vat","variable_vat","products_vat","products_flat_vat","products_variable_vat"].includes(h)&&(m=s.total_tax_value),s.total="exclusive"===v?+(s.subtotal+(s.shipping||0)+m-s.discount-s.total_coupons).toFixed(ns.currency.ns_currency_precision):+(s.subtotal+(s.shipping||0)-s.discount-s.total_coupons).toFixed(ns.currency.ns_currency_precision),this.order.next(s),a.kq.doAction("ns-cart-after-refreshed",s);case 34:case"end":return e.stop()}}),e,this,[[14,21]])})))}},{key:"getStockUsage",value:function(e,t){var s=this._products.getValue().filter((function(s){return s.product_id===e&&s.unit_quantity_id===t})).map((function(e){return e.quantity}));return s.length>0?s.reduce((function(e,t){return e+t})):0}},{key:"addToCart",value:function(e){return x(this,void 0,void 0,r().mark((function t(){var s,n,i,o,l,c,u,d;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=new Object,n={product_id:e.id||0,name:e.name,discount_type:"percentage",discount:0,discount_percentage:0,product_type:e.product_type||"product",rate:e.rate||0,quantity:e.quantity||0,tax_group_id:e.tax_group_id,tax_type:e.tax_type||void 0,tax_value:0,unit_id:e.unit_id||0,unit_price:e.unit_price||0,price_with_tax:e.price_with_tax||0,price_without_tax:e.price_without_tax||0,unit_name:e.unit_name||"",total_price:0,total_price_without_tax:0,total_price_with_tax:0,mode:e.mode||"normal",$original:e.$original||function(){return e},$quantities:e.$quantities||void 0},this._processingAddQueue=!0,0===n.product_id){t.next=22;break}t.t0=r().keys(this.addToCartQueue);case 5:if((t.t1=t.t0()).done){t.next=22;break}return i=t.t1.value,t.prev=7,o=new this.addToCartQueue[i](n),t.next=11,o.run(s);case 11:l=t.sent,s=Object.assign(Object.assign({},s),l),t.next=20;break;case 15:if(t.prev=15,t.t2=t.catch(7),!1!==t.t2){t.next=20;break}return this._processingAddQueue=!1,t.abrupt("return",!1);case 20:t.next=5;break;case 22:this._processingAddQueue=!1,n=Object.assign(Object.assign({},n),s),c=this._products.getValue(),this.settings.getValue().ns_pos_items_merge?(u=c.filter((function(e){return e.product_id===n.product_id&&e.tax_group_id===n.tax_group_id&&e.unit_id===n.unit_id&&e.unit_quantity_id===n.unit_quantity_id})),u.length>0?u[0].quantity+=n.quantity:c.unshift(n)):c.unshift(n),this.recomputeProducts(c),this.products.next(c),(d=this.options.getValue().ns_pos_new_item_audio).length>0&&new Audio(d).play(),a.kq.doAction("ns-after-cart-changed");case 31:case"end":return t.stop()}}),t,this,[[7,15]])})))}},{key:"defineTypes",value:function(e){this._types.next(e)}},{key:"removeProduct",value:function(e){var t=this._products.getValue(),s=t.indexOf(e);t.splice(s,1),this.products.next(t),a.kq.doAction("ns-after-cart-changed")}},{key:"updateProduct",value:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=this._products.getValue();s=null===s?n.indexOf(e):s,v.default.set(n,s,Object.assign(Object.assign({},e),t)),this.recomputeProducts(n),this.products.next(n),a.kq.doAction("ns-after-cart-changed")}},{key:"recomputeProducts",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t.forEach((function(t){e.computeProduct(t)}))}},{key:"getProductUnitPrice",value:function(e,t){switch(e){case"custom":return t.custom_price_edit;case"normal":return t.sale_price_edit;case"wholesale":return t.wholesale_price_edit}}},{key:"computeProductTax",value:function(e){switch(e.mode){case"custom":return this.computeCustomProductTax(e);case"normal":return this.computeNormalProductTax(e);case"wholesale":return this.computeWholesaleProductTax(e);default:return e}}},{key:"proceedProductTaxComputation",value:function(e,t){var s=this,n=e.$original(),r=n.tax_group,i=this.getProductUnitPrice(e.mode,e.$quantities()),o=0,a=this.getProductUnitPrice(e.mode,e.$quantities());if(null!=r&&void 0!==r.taxes){var l=0;switch(r.taxes.length>0&&(l=r.taxes.map((function(e){return e.rate})).reduce((function(e,t){return e+t}))),n.tax_type){case"inclusive":i=this.getPriceWithoutTax(t,l,n.tax_type),a=t;break;case"exclusive":i=t,a=this.getPriceWithTax(t,l,n.tax_type)}var c=r.taxes.map((function(e){return s.getVatValue(t,e.rate,n.tax_type)}));c.length>0&&(o=c.reduce((function(e,t){return e+t})))}return{price_without_tax:i,tax_value:o,price_with_tax:a}}},{key:"computeCustomProductTax",value:function(e){e.$original();var t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.custom_price_edit);return t.custom_price_without_tax=s.price_without_tax,t.custom_price_with_tax=s.price_with_tax,t.custom_price_tax=s.tax_value,e.$quantities=function(){return t},e}},{key:"computeNormalProductTax",value:function(e){e.$original();var t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.sale_price_edit);return t.sale_price_without_tax=s.price_without_tax,t.sale_price_with_tax=s.price_with_tax,t.sale_price_tax=s.tax_value,e.$quantities=function(){return t},e}},{key:"computeWholesaleProductTax",value:function(e){e.$original();var t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.wholesale_price_edit);return t.wholesale_price_without_tax=s.price_without_tax,t.wholesale_price_with_tax=s.price_with_tax,t.wholesale_price_tax=s.tax_value,e.$quantities=function(){return t},e}},{key:"getPrice",value:function(e,t,s){switch(t){case"normal":return e["sale_price_"+s];case"wholesale":return e["wholesale_price_"+s];case"custom":return e["custom_price_"+s]}}},{key:"computeProduct",value:function(e){"product"===e.product_type&&("normal"===e.mode?(e.unit_price=this.getSalePrice(e.$quantities(),e.$original()),e.tax_value=e.$quantities().sale_price_tax*e.quantity):"wholesale"===e.mode&&(e.unit_price=this.getWholesalePrice(e.$quantities(),e.$original()),e.tax_value=e.$quantities().wholesale_price_tax*e.quantity),"custom"===e.mode&&(e.unit_price=this.getCustomPrice(e.$quantities(),e.$original()),e.tax_value=e.$quantities().custom_price_tax*e.quantity));var t=0,s=0,n=this.getPrice(e.$quantities(),e.mode,"with_tax"),r=this.getPrice(e.$quantities(),e.mode,"without_tax");["flat","percentage"].includes(e.discount_type)&&"percentage"===e.discount_type&&(e.discount=e.unit_price*e.discount_percentage/100*e.quantity,t=r*e.discount_percentage/100*e.quantity,s=n*e.discount_percentage/100*e.quantity),e.price_with_tax=n,e.price_without_tax=r,e.total_price=e.unit_price*e.quantity-e.discount,e.total_price_with_tax=n*e.quantity-s,e.total_price_without_tax=r*e.quantity-t,a.kq.doAction("ns-after-product-computed",e)}},{key:"loadCustomer",value:function(e){return a.ih.get("/api/nexopos/v4/customers/".concat(e))}},{key:"defineSettings",value:function(e){this._settings.next(e)}},{key:"voidOrder",value:function(e){var t=this;void 0!==e.id?["hold"].includes(e.payment_status)?o.G.show($,{title:(0,l.__)("Order Deletion"),message:(0,l.__)("The current order will be deleted as no payment has been made so far."),onAction:function(s){s&&a.ih.delete("/api/nexopos/v4/orders/".concat(e.id)).subscribe({next:function(e){a.kX.success(e.message).subscribe(),t.reset()},error:function(e){return a.kX.error(e.message).subscribe()}})}}):o.G.show(T,{title:(0,l.__)("Void The Order"),message:(0,l.__)("The current order will be void. This will cancel the transaction, but the order won't be deleted. Further details about the operation will be tracked on the report. Consider providing the reason of this operation."),onAction:function(s){!1!==s&&a.ih.post("/api/nexopos/v4/orders/".concat(e.id,"/void"),{reason:s}).subscribe({next:function(e){a.kX.success(e.message).subscribe(),t.reset()},error:function(e){return a.kX.error(e.message).subscribe()}})}}):a.kX.error((0,l.__)("Unable to void an unpaid order.")).subscribe()}},{key:"triggerOrderTypeSelection",value:function(e){return x(this,void 0,void 0,r().mark((function t(){var s;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s=0;case 1:if(!(s{var n={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function r(e){var t=i(e);return s(t)}function i(e){if(!s.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}r.keys=function(){return Object.keys(n)},r.resolve=i,e.exports=r,r.id=6700},4806:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var n=s(538),r=s(381),i=s.n(r),o=s(7144),a=s.n(o),l=(s(9095),s(7389));const c=n.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:a()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:i()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:i()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?i()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const u=(0,s(1900).Z)(c,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[s("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),s("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?s("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[s("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),s("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[s("i",{staticClass:"las la-times"})]),e._v(" "),s("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[s("div",{staticClass:"flex justify-between items-center w-full py-2"},[s("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),s("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():s("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,n){return s("p",{key:n,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},2744:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(381),r=s.n(n);const i={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:r(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return r()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?r()():r()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?r()():r()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:s(7389).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(r().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"picker mb-2"},[e.field?s("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),s("div",{staticClass:"ns-button"},[s("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[s("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?s("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?s("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?s("span",{staticClass:"mx-1 text-sm"},[null!==e.date?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?s("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?s("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?s("div",{staticClass:"relative z-10 h-0 w-0"},[s("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[s("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[s("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[s("i",{staticClass:"las la-minus"})]),e._v(" "),s("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),s("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[s("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,n){return s("div",{key:n,staticClass:"h-8 flex justify-center items-center text-sm"},[[s("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(s){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,n){return s("div",{key:n,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(n,r){return s("div",{key:r,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,r){return[t.dayOfWeek===n?s("div",{key:r,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(s){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),s("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[s("div",{staticClass:"-mx-1 flex justify-between"},[s("div",{staticClass:"px-1"},[s("div",{staticClass:"-mx-1 flex"},[e.field?s("div",{staticClass:"px-1"},[s("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[s("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?s("div",{staticClass:"px-1"},[s("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[s("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),s("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},1544:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(381),r=s.n(n);const i={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?r()():r()(this.date),this.build()},methods:{__:s(7389).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(r().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"picker"},[s("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[s("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),s("span",{staticClass:"mx-1 text-sm"},[s("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?s("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?s("div",{staticClass:"relative h-0 w-0 -mb-2"},[s("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,n){return s("div",{key:n,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(n,r){return s("div",{key:r,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,r){return[t.dayOfWeek===n?s("div",{key:r,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(s){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),s("div")])]):e._e()])}),[],!1,null,null,null).exports},1828:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});const n={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[s("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),s("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},3220:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});var n=s(7389);const r={name:"ns-numpad-plus",props:["value","currency","limit"],data:function(){return{screenValue:0,order:null,cursor:parseInt(ns.currency.ns_currency_precision),orderSubscription:null,allSelected:!0,keyRows:[[7,8,9].map((function(e){return{identifier:e,value:e}})),[4,5,6].map((function(e){return{identifier:e,value:e}})),[1,2,3].map((function(e){return{identifier:e,value:e}})),[{identifier:".",value:"."},{identifier:0,value:0},{identifier:"backspace",icon:"la-backspace"}],[{identifier:"next",value:(0,n.__)("Enter")}]]}},mounted:function(){var e=this;this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,s){e.inputValue({value:s})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-dot").whenVisible([".is-popup"]).whenPressed(".",(function(){return e.inputValue({identifier:"."})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save"),nsHotPress.destroy("numpad-dot")},methods:{increaseBy:function(e){this.screenValue=(parseFloat(e.value)+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if("."===e.identifier)this.allSelected?(this.screenValue="0.",this.allSelected=!1):null===this.screenValue.toString().match(/^[0-9][1-9]*\.[0-9]*$/)&&(this.screenValue=this.screenValue+=".");else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}this.$emit("changed",this.screenValue)}else this.$emit("next",this.screenValue)}}};const i=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"numpad-holder"}},e._l(e.keyRows,(function(t,n){return s("div",{key:n},[s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 text-lg",attrs:{id:"numpad"}},[e._l(t,(function(n,r){return s("div",{key:r,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",class:1===t.length?"col-span-3":"",on:{click:function(t){return e.inputValue(n)}}},[void 0!==n.value?s("span",[e._v(e._s(n.value))]):e._e(),e._v(" "),n.icon?s("i",{staticClass:"las",class:n.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)])})),0)}),[],!1,null,null,null).exports},4864:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(7389);function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);"Object"===s&&e.constructor&&(s=e.constructor.name);if("Map"===s||"Set"===s)return Array.from(e);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,n=new Array(t);s0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,s){e.inputValue({value:s})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var s=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",s)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const a=(0,s(1900).Z)(o,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,n){return s("div",{key:n,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(s){return e.inputValue(t)}}},[void 0!==t.value?s("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?s("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3506:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});const n={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var s=[];t-3>1&&s.push(1,"...");for(var n=1;n<=e;n++)t+3>n&&t-30||"string"==typeof e}))}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[s("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,n){return["..."!==e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(s){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[s("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},9408:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});const n={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"mb-2 ns-switch"},[s("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),s("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,n){return s("button",{key:n,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(s){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():s("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,n){return s("p",{key:n,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},4255:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var n=s(7757),r=s.n(n),i=s(9671),o=s(8603),a=s(7389),l=s(3601);function c(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}const u={name:"ns-media",props:["popup"],components:{VueUpload:s(2948)},data:function(){return{pages:[{label:(0,a.__)("Upload"),name:"upload",selected:!1},{label:(0,a.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return i.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:o.Z,__:a.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,a.__)("Confirm Your Action"),message:(0,a.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&i.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){i.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){i.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(s){t.addEventListener(s,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(s){t.addEventListener(s,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=r().mark((function e(){var s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),n=r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s[t],e.prev=1,n.progress=1,e.next=5,new Promise((function(e,t){var s=new FormData;s.append("file",n.file),i.ih.post("/api/nexopos/v4/medias",s,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){n.uploaded=!0,n.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),n.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),o=0;case 3:if(!(o0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,i.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(s,n){n!==t.response.data.indexOf(e)&&(s.selected=!1)})),e.selected=!e.selected}}};const d=(0,s(1900).Z)(u,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[s("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[s("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),s("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,n){return s("li",{key:n,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(s){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?s("div",{staticClass:"content w-full overflow-hidden flex"},[s("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[s("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),s("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),s("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[s("ul",e._l(e.files,(function(t,n){return s("li",{key:n,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[s("span",[e._v(e._s(t.file.name))]),e._v(" "),s("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?s("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?s("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[s("div"),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),s("div",{staticClass:"flex flex-auto overflow-hidden"},[s("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"p-2 overflow-x-auto"},[s("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,n){return s("div",{key:n},[s("div",{staticClass:"p-2"},[s("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(s){return e.selectResource(t)}}},[s("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?s("div",{staticClass:"flex flex-auto items-center justify-center"},[s("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),s("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0 ",attrs:{id:"preview"}},[s("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?s("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?s("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),s("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),s("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),s("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[s("div",{staticClass:"flex -mx-2 flex-shrink-0"},[s("div",{staticClass:"px-2 flex-shrink-0 flex"},[s("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[s("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[s("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?s("div",{staticClass:"ns-button error"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[s("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),s("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[s("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[s("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),s("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),s("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[s("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?s("div",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},976:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(2242),r=s(1247);const i={name:"ns-pos-customers-button",methods:{__:s(7389).__,openCustomerPopup:function(){(new n.G).open(r.Z)}},beforeDestroy:function(){nsHotPress.destroy("ns_pos_keyboard_create_customer")},mounted:function(){var e=this;for(var t in nsShortcuts)["ns_pos_keyboard_create_customer"].includes(t)&&nsHotPress.create("ns_pos_keyboard_create_customer").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[t],(function(t){t.preventDefault(),e.openCustomerPopup()}))}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button default"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.openCustomerPopup()}}},[s("i",{staticClass:"mr-1 text-xl lar la-user-circle"}),e._v(" "),s("span",[e._v(e._s(e.__("Customers")))])])])}),[],!1,null,null,null).exports},227:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});const n={name:"ns-pos-dashboard-button",methods:{__:s(7389).__,goToDashboard:function(){return document.location=POS.settings.getValue().urls.dashboard_url}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button success"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.goToDashboard()}}},[s("i",{staticClass:"mr-1 text-xl las la-tachometer-alt"}),e._v(" "),s("span",[e._v(e._s(e.__("Dashboard")))])])])}),[],!1,null,null,null).exports},3808:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(2242),r=s(664);const i={name:"ns-pos-delivery-button",methods:{__:s(7389).__,openOrderTypeSelection:function(){new n.G({primarySelector:"#pos-app",popupClass:"shadow-lg bg-white w-3/5 md:w-2/3 lg:w-2/5 xl:w-2/4"}).open(r.Z)}},beforeDestroy:function(){nsHotPress.destroy("ns_pos_keyboard_order_type")},mounted:function(){var e=this;for(var t in nsShortcuts)["ns_pos_keyboard_order_type"].includes(t)&&nsHotPress.create("ns_pos_keyboard_order_type").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[t],(function(t){t.preventDefault(),e.openOrderTypeSelection()}))}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button default"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.openOrderTypeSelection()}}},[s("i",{staticClass:"mr-1 text-xl las la-truck"}),e._v(" "),s("span",[e._v(e._s(e.__("Order Type")))])])])}),[],!1,null,null,null).exports},605:(e,t,s)=>{"use strict";s.d(t,{Z:()=>_});var n=s(2242),r=s(9671),i=s(3601),o=s(7389);const a={data:function(){return{products:[],isLoading:!1}},computed:{order:function(){return this.$popupParams.order}},mounted:function(){this.loadProducts()},methods:{__:o.__,close:function(){this.$popupParams.reject(!1),this.$popup.close()},loadProducts:function(){var e=this;this.isLoading=!0;var t=this.$popupParams.order.id;r.ih.get("/api/nexopos/v4/orders/".concat(t,"/products")).subscribe((function(t){e.isLoading=!1,e.products=t}))},openOrder:function(){this.$popup.close(),this.$popupParams.resolve(this.order)}}};var l=s(1900);const c=(0,l.Z)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg ns-box w-6/7-screen md:w-3/5-screen lg:w-2/5-screen h-6/7-screen flex flex-col overflow-hidden"},[s("div",{staticClass:"p-2 flex justify-between text-primary items-center border-b ns-box-header"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Products"))+" — "+e._s(e.order.code)+" "),e.order.title?s("span",[e._v("("+e._s(e.order.title)+")")]):e._e()]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex-auto p-2 overflow-y-auto ns-box-body"},[e.isLoading?s("div",{staticClass:"flex-auto relative"},[s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1)]):e._e(),e._v(" "),e.isLoading?e._e():e._l(e.products,(function(t){return s("div",{key:t.id,staticClass:"item"},[s("div",{staticClass:"flex-col border-b border-info-primary py-2"},[s("div",{staticClass:"title font-semibold text-primary flex justify-between"},[s("span",[e._v(e._s(t.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(t.total_price)))])]),e._v(" "),s("div",{staticClass:"text-sm text-primary"},[s("ul",[s("li",[e._v(e._s(e.__("Unit"))+" : "+e._s(t.unit.name))])])])])])}))],2),e._v(" "),s("div",{staticClass:"flex justify-end p-2 border-t ns-box-footer"},[s("div",{staticClass:"px-1"},[s("div",{staticClass:"-mx-2 flex"},[s("div",{staticClass:"px-1"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.openOrder()}}},[e._v(e._s(e.__("Open")))])],1),e._v(" "),s("div",{staticClass:"px-1"},[s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.close()}}},[e._v(e._s(e.__("Close")))])],1)])])])])}),[],!1,null,null,null).exports;const u={props:["orders"],data:function(){return{searchField:"",columns:{rightColumn:[],leftColumn:[]}}},watch:{orders:function(){r.kq.doAction("ns-pos-pending-orders-refreshed",this.orders)}},mounted:function(){this.columns.leftColumn=r.kq.applyFilters("ns-pending-orders-left-column",[{label:(0,o.__)("Code"),value:function(e){return e.code}},{label:(0,o.__)("Cashier"),value:function(e){return e.nexopos_users_username}},{label:(0,o.__)("Total"),value:function(e){return e.total}},{label:(0,o.__)("Tendered"),value:function(e){return e.tendered}}]),this.columns.rightColumn=r.kq.applyFilters("ns-pending-orders-right-column",[{label:(0,o.__)("Customer"),value:function(e){return e.nexopos_customers_name}},{label:(0,o.__)("Date"),value:function(e){return e.created_at}},{label:(0,o.__)("Type"),value:function(e){return e.type}}])},name:"ns-pos-pending-order",methods:{__:o.__,previewOrder:function(e){this.$emit("previewOrder",e)},proceedOpenOrder:function(e){this.$emit("proceedOpenOrder",e)},searchOrder:function(){this.$emit("searchOrder",this.searchField)},printOrder:function(e){this.$emit("printOrder",e)}}};const d=(0,l.Z)(u,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-auto flex-col overflow-hidden"},[s("div",{staticClass:"p-1"},[s("div",{staticClass:"flex rounded border-2 input-group info"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchField,expression:"searchField"}],staticClass:"p-2 outline-none flex-auto",attrs:{type:"text"},domProps:{value:e.searchField},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.searchOrder()},input:function(t){t.target.composing||(e.searchField=t.target.value)}}}),e._v(" "),s("button",{staticClass:"w-16 md:w-24",on:{click:function(t){return e.searchOrder()}}},[s("i",{staticClass:"las la-search"}),e._v(" "),s("span",{staticClass:"mr-1 hidden md:visible"},[e._v(e._s(e.__("Search")))])])])]),e._v(" "),s("div",{staticClass:"overflow-y-auto flex flex-auto"},[s("div",{staticClass:"flex p-2 flex-auto flex-col overflow-y-auto"},[e._l(e.orders,(function(t){return s("div",{key:t.id,staticClass:"border-b ns-box-body w-full py-2",attrs:{"data-order-id":t.id}},[s("h3",{staticClass:"text-primary"},[e._v(e._s(t.title||"Untitled Order"))]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"flex flex-wrap -mx-4"},[s("div",{staticClass:"w-full md:w-1/2 px-2"},e._l(e.columns.leftColumn,(function(n,r){return s("p",{key:r,staticClass:"text-sm text-primary"},[s("strong",[e._v(e._s(n.label))]),e._v(" : "+e._s(n.value(t)))])})),0),e._v(" "),s("div",{staticClass:"w-full md:w-1/2 px-2"},e._l(e.columns.rightColumn,(function(n,r){return s("p",{key:r,staticClass:"text-sm text-primary"},[s("strong",[e._v(e._s(n.label))]),e._v(" : "+e._s(n.value(t)))])})),0)])]),e._v(" "),s("div",{staticClass:"flex justify-end w-full mt-2"},[s("div",{staticClass:"flex rounded-lg overflow-hidden ns-buttons"},[s("button",{staticClass:"info outline-none px-2 py-1",on:{click:function(s){return e.proceedOpenOrder(t)}}},[s("i",{staticClass:"las la-lock-open"}),e._v(" "+e._s(e.__("Open")))]),e._v(" "),s("button",{staticClass:"success outline-none px-2 py-1",on:{click:function(s){return e.previewOrder(t)}}},[s("i",{staticClass:"las la-eye"}),e._v(" "+e._s(e.__("Products")))]),e._v(" "),s("button",{staticClass:"warning outline-none px-2 py-1",on:{click:function(s){return e.printOrder(t)}}},[s("i",{staticClass:"las la-print"}),e._v(" "+e._s(e.__("Print")))])])])])})),e._v(" "),0===e.orders.length?s("div",{staticClass:"h-full v-full items-center justify-center flex"},[s("h3",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Nothing to display...")))])]):e._e()],2)])])}),[],!1,null,null,null).exports;var p=s(6386),f=s(8603);const v={components:{nsPosPendingOrders:d},methods:{__:o.__,popupResolver:p.Z,popupCloser:f.Z,searchOrder:function(e){var t=this;r.ih.get("/api/nexopos/v4/crud/".concat(this.active,"?search=").concat(e)).subscribe((function(e){t.orders=e.data}))},setActiveTab:function(e){this.active=e,this.loadOrderFromType(e)},openOrder:function(e){POS.loadOrder(e.id),this.$popup.close()},loadOrderFromType:function(e){var t=this;r.ih.get("/api/nexopos/v4/crud/".concat(e)).subscribe((function(e){t.orders=e.data}))},previewOrder:function(e){var t=this;new Promise((function(t,s){Popup.show(c,{order:e,resolve:t,reject:s})})).then((function(s){t.proceedOpenOrder(e)}),(function(e){return e}))},printOrder:function(e){POS.printOrder(e.id)},proceedOpenOrder:function(e){var t=this;if(POS.products.getValue().length>0)return Popup.show(i.default,{title:"Confirm Your Action",message:"The cart is not empty. Opening an order will clear your cart would you proceed ?",onAction:function(s){s&&t.openOrder(e)}});this.openOrder(e)}},data:function(){return{active:"ns.hold-orders",searchField:"",orders:[]}},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&e.$popup.close()})),this.loadOrderFromType(this.active),this.popupCloser()}};const h=(0,l.Z)(v,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg ns-box w-6/7-screen md:w-3/5-screen lg:w-2/5-screen h-6/7-screen flex flex-col overflow-hidden"},[s("div",{staticClass:"p-2 flex justify-between text-primary items-center ns-box-header border-b"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Orders")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.$popup.close()}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 flex overflow-hidden flex-auto ns-box-body"},[s("ns-tabs",{attrs:{active:e.active},on:{changeTab:function(t){return e.setActiveTab(t)}}},[s("ns-tabs-item",{staticClass:"flex flex-col overflow-hidden",attrs:{identifier:"ns.hold-orders",label:e.__("On Hold"),padding:"p-0"}},[s("ns-pos-pending-orders",{attrs:{orders:e.orders},on:{searchOrder:function(t){return e.searchOrder(t)},previewOrder:function(t){return e.previewOrder(t)},printOrder:function(t){return e.printOrder(t)},proceedOpenOrder:function(t){return e.proceedOpenOrder(t)}}})],1),e._v(" "),s("ns-tabs-item",{staticClass:"flex flex-col overflow-hidden",attrs:{identifier:"ns.unpaid-orders",label:e.__("Unpaid"),padding:"p-0"}},[s("ns-pos-pending-orders",{attrs:{orders:e.orders},on:{searchOrder:function(t){return e.searchOrder(t)},previewOrder:function(t){return e.previewOrder(t)},printOrder:function(t){return e.printOrder(t)},proceedOpenOrder:function(t){return e.proceedOpenOrder(t)}}})],1),e._v(" "),s("ns-tabs-item",{staticClass:"flex flex-col overflow-hidden",attrs:{identifier:"ns.partially-paid-orders",label:e.__("Partially Paid"),padding:"p-0"}},[s("ns-pos-pending-orders",{attrs:{orders:e.orders},on:{searchOrder:function(t){return e.searchOrder(t)},previewOrder:function(t){return e.previewOrder(t)},printOrder:function(t){return e.printOrder(t)},proceedOpenOrder:function(t){return e.proceedOpenOrder(t)}}})],1)],1)],1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[s("div"),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"}},[e._v(e._s(e.__("Close")))])],1)])])}),[],!1,null,null,null).exports,m={name:"ns-pos-pending-orders-button",methods:{__:o.__,openPendingOrdersPopup:function(){(new n.G).open(h)}}};const _=(0,l.Z)(m,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button default"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.openPendingOrdersPopup()}}},[s("i",{staticClass:"mr-1 text-xl lar la-hand-pointer"}),e._v(" "),s("span",[e._v(e._s(e.__("Orders")))])])])}),[],!1,null,null,null).exports},9433:(e,t,s)=>{"use strict";s.d(t,{Z:()=>T});var n=s(7757),r=s.n(n),i=s(9671),o=s(4864),a=s(7266),l=s(8603),c=s(3601),u=s(7389);const d={components:{nsNumpad:o.Z},data:function(){return{amount:0,title:null,identifier:null,settingsSubscription:null,settings:null,action:null,register:null,loaded:!1,register_id:null,validation:new a.Z,fields:[]}},mounted:function(){var e=this;this.title=this.$popupParams.title,this.identifier=this.$popupParams.identifier,this.register=this.$popupParams.register,this.action=this.$popupParams.action,this.register_id=this.$popupParams.register_id,this.settingsSubscription=POS.settings.subscribe((function(t){e.settings=t})),this.loadFields()},destroyed:function(){this.settingsSubscription.unsubscribe()},methods:{popupCloser:l.Z,__:u.__,definedValue:function(e){this.amount=e},close:function(){this.$popup.close()},loadFields:function(){var e=this;this.loaded=!1,nsHttpClient.get("/api/nexopos/v4/fields/".concat(this.identifier)).subscribe((function(t){e.loaded=!0,e.fields=t}),(function(t){return e.loaded=!0,nsSnackBar.error(t.message,"OKAY",{duration:!1}).subscribe()}))},submit:function(e){var t=this;Popup.show(c.default,{title:"Confirm Your Action",message:this.$popupParams.confirmMessage||"Would you like to confirm your action.",onAction:function(e){e&&t.triggerSubmit()}})},triggerSubmit:function(){var e=this,t=this.validation.extractFields(this.fields);t.amount=""===this.amount?0:this.amount,nsHttpClient.post("/api/nexopos/v4/cash-registers/".concat(this.action,"/").concat(this.register_id||this.settings.register.id),t).subscribe({next:function(t){e.$popupParams.resolve(t),e.$popup.close(),nsSnackBar.success(t.message).subscribe()},error:function(e){nsSnackBar.error(e.message).subscribe()}})}}};var p=s(1900);const f=(0,p.Z)(d,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.loaded?s("div",{staticClass:"shadow-lg w-95vw md:w-2/5-screen ns-box"},[s("div",{staticClass:"border-b ns-box-header p-2 text-primary flex justify-between items-center"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.title))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"p-2"},[null!==e.register?s("div",{staticClass:"mb-2 p-3 elevation-surface font-bold border text-right flex justify-between"},[s("span",[e._v(e._s(e.__("Balance"))+" ")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.register.balance)))])]):e._e(),e._v(" "),s("div",{staticClass:"mb-2 p-3 elevation-surface success border font-bold text-right flex justify-between"},[s("span",[e._v(e._s(e.__("Input")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.amount)))])]),e._v(" "),s("div",{staticClass:"mb-2"},[s("ns-numpad",{attrs:{floating:!0,value:e.amount},on:{next:function(t){return e.submit(t)},changed:function(t){return e.definedValue(t)}}})],1),e._v(" "),e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})}))],2)]):e._e(),e._v(" "),e.loaded?e._e():s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1)])}),[],!1,null,null,null).exports;var v=s(6386);function h(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}const m={components:{nsNumpad:o.Z},data:function(){return{registers:[],priorVerification:!1,hasLoadedRegisters:!1,validation:new a.Z,amount:0,settings:null,settingsSubscription:null}},mounted:function(){var e=this;this.checkUsedRegister(),this.settingsSubscription=POS.settings.subscribe((function(t){e.settings=t}))},beforeDestroy:function(){this.settingsSubscription.unsubscribe()},computed:{},methods:{__:u.__,popupResolver:v.Z,selectRegister:function(e){var t,s=this;return(t=r().mark((function t(){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("closed"===e.status){t.next=2;break}return t.abrupt("return",i.kX.error((0,u.__)("Unable to open this register. Only closed register can be opened.")).subscribe());case 2:return t.prev=2,t.next=5,new Promise((function(t,s){var n=(0,u.__)("Open Register : %s").replace("%s",e.name),r=e.id;Popup.show(f,{resolve:t,reject:s,title:n,identifier:"ns.cash-registers-opening",register:e,action:"open",register_id:r})}));case 5:n=t.sent,s.popupResolver(n),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),console.log(t.t0);case 12:case"end":return t.stop()}}),t,null,[[2,9]])})),function(){var e=this,s=arguments;return new Promise((function(n,r){var i=t.apply(e,s);function o(e){h(i,n,r,o,a,"next",e)}function a(e){h(i,n,r,o,a,"throw",e)}o(void 0)}))})()},checkUsedRegister:function(){var e=this;this.priorVerification=!1,i.ih.get("/api/nexopos/v4/cash-registers/used").subscribe({next:function(t){e.$popupParams.resolve(t),e.$popup.close()},error:function(t){e.priorVerification=!0,i.kX.error(t.message).subscribe(),e.loadRegisters()}})},loadRegisters:function(){var e=this;this.hasLoadedRegisters=!1,i.ih.get("/api/nexopos/v4/cash-registers").subscribe((function(t){e.registers=t,e.hasLoadedRegisters=!0}))},getClass:function(e){switch(e.status){case"in-use":return"elevation-surface warning cursor-not-allowed";case"disabled":return"elevation-surface cursor-not-allowed";case"available":return"elevation-surface success"}return"elevation-surface hoverable cursor-pointer"}}};const _=(0,p.Z)(m,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[!1===e.priorVerification?s("div",{staticClass:"h-full w-full py-10 flex justify-center items-center"},[s("ns-spinner",{attrs:{size:"24",border:"8"}})],1):e._e(),e._v(" "),e.priorVerification?s("div",{staticClass:"w-95vw md:w-3/5-screen lg:w-3/5-screen xl:w-2/5-screen flex flex-col overflow-hidden",class:e.priorVerification?"shadow-lg ns-box":"",attrs:{id:"ns-pos-cash-registers-popup"}},[[s("div",{staticClass:"title p-2 border-b ns-box-header flex justify-between items-center"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Open The Register")))]),e._v(" "),e.settings?s("div",[s("a",{staticClass:"rounded-full border ns-close-button px-3 text-sm py-1",attrs:{href:e.settings.urls.orders_url}},[e._v(e._s(e.__("Exit To Orders")))])]):e._e()]),e._v(" "),e.hasLoadedRegisters?e._e():s("div",{staticClass:"py-10 flex-auto overflow-y-auto flex items-center justify-center"},[s("ns-spinner",{attrs:{size:"16",border:"4"}})],1),e._v(" "),e.hasLoadedRegisters?s("div",{staticClass:"flex-auto overflow-y-auto"},[s("div",{staticClass:"grid grid-cols-3"},e._l(e.registers,(function(t,n){return s("div",{key:n,staticClass:"border flex items-center justify-center flex-col p-3",class:e.getClass(t),on:{click:function(s){return e.selectRegister(t)}}},[s("i",{staticClass:"las la-cash-register text-6xl"}),e._v(" "),s("h3",{staticClass:"text-semibold text-center"},[e._v(e._s(t.name))]),e._v(" "),s("span",{staticClass:"text-sm"},[e._v("("+e._s(t.status_label)+")")])])})),0),e._v(" "),0===e.registers.length?s("div",{staticClass:"p-2 alert text-white"},[e._v("\n "+e._s(e.__("Looks like there is no registers. At least one register is required to proceed."))+" — "),s("a",{staticClass:"font-bold hover:underline",attrs:{href:e.settings.urls.registers_url}},[e._v(e._s(e.__("Create Cash Register")))])]):e._e()]):e._e()]],2):e._e()])}),[],!1,null,null,null).exports;const b={data:function(){return{totalIn:0,totalOut:0,settings:null,settingsSubscription:null,histories:[]}},mounted:function(){var e=this;this.settingsSubscription=POS.settings.subscribe((function(t){e.settings=t})),this.getHistory()},destroyed:function(){this.settingsSubscription.unsubscribe()},methods:{__:u.__,popupResolver:v.Z,closePopup:function(){this.popupResolver({status:"success"})},getHistory:function(){var e=this;i.ih.get("/api/nexopos/v4/cash-registers/session-history/".concat(this.settings.register.id)).subscribe((function(t){e.histories=t,e.totalIn=e.histories.filter((function(e){return["register-opening","register-sale","register-cash-in"].includes(e.action)})).map((function(e){return parseFloat(e.value)})).reduce((function(e,t){return e+t}),0),e.totalOut=e.histories.filter((function(e){return["register-closing","register-refund","register-cash-out"].includes(e.action)})).map((function(e){return parseFloat(e.value)})).reduce((function(e,t){return e+t}),0),console.log(e.totalOut)}))}}};const y=(0,p.Z)(b,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow-lg w-95vw md:w-4/6-screen lg:w-half overflow-hidden"},[s("div",{staticClass:"p-2 flex justify-between items-center ns-box-header",attrs:{id:"header"}},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Register History")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:e.closePopup}})],1)]),e._v(" "),s("div",{staticClass:"flex w-full ns-box-body"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"w-full md:w-1/2 text-right bg-success-primary text-white font-bold text-3xl p-3"},[e._v(e._s(e._f("currency")(e.totalIn)))]),e._v(" "),s("div",{staticClass:"w-full md:w-1/2 text-right bg-error-primary text-white font-bold text-3xl p-3"},[e._v(e._s(e._f("currency")(e.totalOut)))])])]),e._v(" "),s("div",{staticClass:"flex flex-col overflow-y-auto h-120"},[e._l(e.histories,(function(t){return[["register-sale","register-cash-in"].includes(t.action)?s("div",{key:t.id,staticClass:"flex border-b elevation-surface success"},[s("div",{staticClass:"p-2 flex-auto"},[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex-auto text-right p-2"},[e._v(e._s(e._f("currency")(t.value)))])]):e._e(),e._v(" "),["register-opening"].includes(t.action)?s("div",{key:t.id,staticClass:"flex border-b elevation-surface"},[s("div",{staticClass:"p-2 flex-auto"},[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex-auto text-right p-2"},[e._v(e._s(e._f("currency")(t.value)))])]):e._e(),e._v(" "),["register-close"].includes(t.action)?s("div",{key:t.id,staticClass:"flex border-b elevation-surface info"},[s("div",{staticClass:"p-2 flex-auto"},[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex-auto text-right p-2"},[e._v(e._s(e._f("currency")(t.value)))])]):e._e(),e._v(" "),["register-refund","register-cash-out"].includes(t.action)?s("div",{key:t.id,staticClass:"flex border-b elevation-surface error"},[s("div",{staticClass:"p-2 flex-auto"},[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex-auto text-right p-2"},[e._v(e._s(e._f("currency")(t.value)))])]):e._e()]}))],2)])}),[],!1,null,null,null).exports;function g(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function x(e){for(var t=1;t0&&i.kX.error(t.t0.message).subscribe();case 10:case"end":return t.stop()}}),t,null,[[0,7]])})))()},registerInitialQueue:function(){var e=this;POS.initialQueue.push(S(r().mark((function t(){var s;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,new Promise((function(t,s){void 0===e.settings.register&&Popup.show(_,{resolve:t,reject:s})}));case 3:return s=t.sent,POS.set("register",s.data.register),e.setRegister(s.data.register),t.abrupt("return",s);case 9:throw t.prev=9,t.t0=t.catch(0),t.t0;case 12:case"end":return t.stop()}}),t,null,[[0,9]])}))))},setButtonName:function(){if(void 0===this.settings.register)return this.name=(0,u.__)("Cash Register");this.name=(0,u.__)("Cash Register : {register}").replace("{register}",this.settings.register.name)},setRegister:function(e){if(void 0!==e){var t=POS.order.getValue();t.register_id=e.id,POS.order.next(t)}}},destroyed:function(){this.orderSubscriber.unsubscribe(),this.settingsSubscriber.unsubscribe()},mounted:function(){var e=this;this.registerInitialQueue(),this.orderSubscriber=POS.order.subscribe((function(t){e.order=t})),this.settingsSubscriber=POS.settings.subscribe((function(t){e.settings=t,e.setRegister(e.settings.register),e.setButtonName()}))}};const T=(0,p.Z)($,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button default"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.openRegisterOptions()}}},[s("i",{staticClass:"mr-1 text-xl las la-cash-register"}),e._v(" "),s("span",[e._v(e._s(e.name))])])])}),[],!1,null,null,null).exports},8149:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(2242),r=(s(1247),s(3601)),i=s(8603);const o={name:"ns-pos-customers-button",mounted:function(){this.popupCloser()},methods:{__,popupCloser:i.Z,reset:function(){n.G.show(r.default,{title:__("Confirm Your Action"),message:__("The current order will be cleared. But not deleted if it's persistent. Would you like to proceed ?"),onAction:function(e){e&&POS.reset()}})}}};const a=(0,s(1900).Z)(o,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button error"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.reset()}}},[s("i",{staticClass:"mr-1 text-xl las la-eraser"}),e._v(" "),s("span",[e._v(e._s(e.__("Reset")))])])])}),[],!1,null,null,null).exports},9110:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>r});const n={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){var e=this;this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(void 0!==e.$popupParams.onAction&&e.$popupParams.onAction(!1),e.$popup.close())}))},methods:{__:s(7389).__,emitAction:function(e){void 0!==this.$popupParams.onAction&&this.$popupParams.onAction(e),this.$popup.close()}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-6/7-screen md:w-4/7-screen lg:w-3/7-screen flex flex-col shadow-lg",class:e.size,attrs:{id:"alert-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[e.title?s("h2",{staticClass:"text-3xl font-body"},[e._v(e._s(e.title))]):e._e(),e._v(" "),s("p",{staticClass:"py-4 text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"action-buttons flex border-t justify-end items-center p-2"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Ok")))])],1)])}),[],!1,null,null,null).exports},3613:(e,t,s)=>{"use strict";s.d(t,{Z:()=>K});var n=s(7757),r=s.n(n),i=s(9671),o=s(1356),a=s(2277),l=s(7266),c=s(8603),u=s(7389);function d(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function p(e){for(var t=1;tthis.availableQuantity)return i.kX.error("Unable to proceed as the quantity provided is exceed the available quantity.").subscribe();this.product.quantity=parseFloat(e),this.$popupParams.resolve(this.product),this.$popup.close()}}};const g=(0,h.Z)(y,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-xl ns-box overflow-hidden w-95vw md:w-4/6-screen lg:w-3/7-screen"},[s("div",{staticClass:"p-2 flex justify-between ns-box-header"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Quantity")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),e.product?s("div",{staticClass:"border-t border-b ns-box-body py-2 flex items-center justify-center text-2xl font-semibold"},[s("span",[e._v(e._s(e.seeValue))]),e._v(" "),s("span",{staticClass:"text-primary text-sm"},[e._v("("+e._s(e.availableQuantity)+" "+e._s(e.__("available"))+")")])]):e._e(),e._v(" "),e.product?s("div",{staticClass:"flex-auto overflow-y-auto p-2"},[s("ns-numpad",{attrs:{value:e.product.quantity},on:{next:function(t){return e.updateQuantity(t)},changed:function(t){return e.setChangedValue(t)}}})],1):e._e()])}),[],!1,null,null,null).exports;var x=s(3296),w=s(3601),C=s(2242),k=s(1703);function P(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function j(e){for(var t=1;t0?this.refundables.map((function(e){return parseFloat(e.unit_price)*parseFloat(e.quantity)})).reduce((function(e,t){return e+t}))+this.shippingFees:0+this.shippingFees},shippingFees:function(){return this.refundShipping?this.order.shipping:0}},data:function(){return{isSubmitting:!1,formValidation:new l.Z,refundables:[],paymentOptions:[],paymentField:[],print:new k.Z({settings:systemSettings,options:systemOptions,type:"refund"}),refundShipping:!1,selectedPaymentGateway:!1,screen:0,selectFields:[{type:"select",options:this.order.products.map((function(e){return{label:"".concat(e.name," - ").concat(e.unit.name," (x").concat(e.quantity,")"),value:e.id}})),validation:"required",name:"product_id",label:(0,u.__)("Product"),description:(0,u.__)("Select the product to perform a refund.")}]}},methods:{__:u.__,updateScreen:function(e){this.screen=e},toggleRefundShipping:function(e){this.refundShipping=e,this.refundShipping},proceedPayment:function(){var e=this;return!1===this.selectedPaymentGateway?i.kX.error((0,u.__)("Please select a payment gateway before proceeding.")).subscribe():0===this.total?i.kX.error((0,u.__)("There is nothing to refund.")).subscribe():0===this.screenValue?i.kX.error((0,u.__)("Please provide a valid payment amount.")).subscribe():void C.G.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("The refund will be made on the current order."),onAction:function(t){t&&e.doProceed()}})},doProceed:function(){var e=this,t={products:this.refundables,total:this.screenValue,payment:this.selectedPaymentGateway,refund_shipping:this.refundShipping};this.isSubmitting=!0,i.ih.post("/api/nexopos/v4/orders/".concat(this.order.id,"/refund"),t).subscribe({next:function(t){e.isSubmitting=!1,e.$emit("changed",!0),"refunded"===t.data.order.payment_status&&e.$emit("loadTab","details"),e.print.printOrder(t.data.orderRefund.id),i.kX.success(t.message).subscribe()},error:function(t){e.isSubmitting=!1,i.kX.error(t.message).subscribe()}})},addProduct:function(){var e=this;if(this.formValidation.validateFields(this.selectFields),!this.formValidation.fieldsValid(this.selectFields))return i.kX.error((0,u.__)("Please select a product before proceeding.")).subscribe();var t=this.formValidation.extractFields(this.selectFields),s=this.order.products.filter((function(e){return e.id===t.product_id})),n=this.refundables.filter((function(e){return e.id===t.product_id}));if(n.length>0){var r=n.map((function(e){return parseInt(e.quantity)})).reduce((function(e,t){return e+t}));if(r===s[0].quantity)return i.kX.error((0,u.__)("Not enough quantity to proceed.")).subscribe()}if(0===s[0].quantity)return i.kX.error((0,u.__)("Not enough quantity to proceed.")).subscribe();var o=j(j({},s[0]),{condition:"",description:""});new Promise((function(e,t){C.G.show(m,{resolve:e,reject:t,product:o})})).then((function(t){t.quantity=e.getProductOriginalQuantity(t.id)-e.getProductUsedQuantity(t.id),e.refundables.push(t)}),(function(e){return e}))},getProductOriginalQuantity:function(e){var t=this.order.products.filter((function(t){return t.id===e}));return t.length>0?t.map((function(e){return parseFloat(e.quantity)})).reduce((function(e,t){return e+t})):0},getProductUsedQuantity:function(e){var t=this.refundables.filter((function(t){return t.id===e}));return t.length>0?t.map((function(e){return parseFloat(e.quantity)})).reduce((function(e,t){return e+t})):0},openSettings:function(e){var t=this;new Promise((function(t,s){C.G.show(m,{resolve:t,reject:s,product:e})})).then((function(s){var n=t.refundables.indexOf(e);t.$set(t.refundables,n,s)}),(function(e){return e}))},selectPaymentGateway:function(){var e=this;new Promise((function(t,s){C.G.show(x.Z,j({resolve:t,reject:s,value:[e.selectedPaymentOption]},e.paymentField[0]))})).then((function(t){e.selectedPaymentGateway=t[0]}),(function(e){return e}))},changeQuantity:function(e){var t=this;new Promise((function(s,n){var r=t.getProductOriginalQuantity(e.id)-t.getProductUsedQuantity(e.id)+parseFloat(e.quantity);C.G.show(g,{resolve:s,reject:n,product:e,availableQuantity:r})})).then((function(s){if(s.quantity>t.getProductUsedQuantity(e.id)-e.quantity){var n=t.refundables.indexOf(e);t.$set(t.refundables,n,s)}}))},deleteProduct:function(e){var t=this;new Promise((function(s,n){C.G.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to delete this product ?"),onAction:function(s){if(s){var n=t.refundables.indexOf(e);t.refundables.splice(n,1)}}})}))}},mounted:function(){var e=this;this.selectFields=this.formValidation.createFields(this.selectFields),i.ih.get("/api/nexopos/v4/orders/payments").subscribe((function(t){e.paymentField=t}))}};const $=(0,h.Z)(S,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-m-4 flex-auto flex flex-wrap relative"},[e.isSubmitting?s("div",{staticClass:"bg-overlay h-full w-full flex items-center justify-center absolute z-30"},[s("ns-spinner")],1):e._e(),e._v(" "),s("div",{staticClass:"px-4 w-full lg:w-1/2"},[s("h3",{staticClass:"py-2 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Refund With Products")))]),e._v(" "),s("div",{staticClass:"my-2"},[s("ul",[s("li",{staticClass:"border-b border-info-primary flex justify-between items-center mb-2"},[s("div",{staticClass:"flex-auto flex-col flex"},[s("div",{staticClass:"p-2 flex"},e._l(e.selectFields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),s("div",{staticClass:"flex justify-between p-2"},[s("div",{staticClass:"flex items-center text-primary"},[e.order.shipping>0?s("span",{staticClass:"mr-2"},[e._v(e._s(e.__("Refund Shipping")))]):e._e(),e._v(" "),e.order.shipping>0?s("ns-checkbox",{attrs:{checked:e.refundShipping},on:{change:function(t){return e.toggleRefundShipping(t)}}}):e._e()],1),e._v(" "),s("div",[s("button",{staticClass:"border rounded-full px-2 py-1 ns-inset-button info",on:{click:function(t){return e.addProduct()}}},[e._v(e._s(e.__("Add Product")))])])])])]),e._v(" "),s("li",[s("h4",{staticClass:"py-1 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Products")))])]),e._v(" "),e._l(e.refundables,(function(t){return s("li",{key:t.id,staticClass:"elevation-surface border flex justify-between items-center mb-2"},[s("div",{staticClass:"px-2 text-primary flex justify-between flex-auto"},[s("div",{staticClass:"flex flex-col"},[s("p",{staticClass:"py-2"},[s("span",[e._v(e._s(t.name))]),e._v(" "),"damaged"===t.condition?s("span",{staticClass:"rounded-full px-2 py-1 text-xs bg-error-tertiary mx-2 text-white"},[e._v(e._s(e.__("Damaged")))]):e._e(),e._v(" "),"unspoiled"===t.condition?s("span",{staticClass:"rounded-full px-2 py-1 text-xs bg-success-tertiary mx-2 text-white"},[e._v(e._s(e.__("Unspoiled")))]):e._e()]),e._v(" "),s("small",[e._v(e._s(t.unit.name))])]),e._v(" "),s("div",{staticClass:"flex items-center justify-center"},[s("span",{staticClass:"py-1 flex items-center cursor-pointer border-b border-dashed border-info-primary"},[e._v(e._s(e._f("currency")(t.unit_price*t.quantity)))])])]),e._v(" "),s("div",{staticClass:"flex"},[s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.openSettings(t)}}},[s("i",{staticClass:"las la-cog text-xl"})]),e._v(" "),s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.deleteProduct(t)}}},[s("i",{staticClass:"las la-trash"})]),e._v(" "),s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.changeQuantity(t)}}},[e._v(e._s(t.quantity))])])])}))],2)])]),e._v(" "),s("div",{staticClass:"px-4 w-full lg:w-1/2"},[s("h3",{staticClass:"py-2 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Summary")))]),e._v(" "),s("div",{staticClass:"py-2"},[s("div",{staticClass:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Total")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.total)))])]),e._v(" "),s("div",{staticClass:"elevation-surface border success font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Paid")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.tendered)))])]),e._v(" "),s("div",{staticClass:"elevation-surface border info font-semibold flex mb-2 p-2 justify-between cursor-pointer",on:{click:function(t){return e.selectPaymentGateway()}}},[s("span",[e._v(e._s(e.__("Payment Gateway")))]),e._v(" "),s("span",[e._v(e._s(e.selectedPaymentGateway?e.selectedPaymentGateway.label:"N/A"))])]),e._v(" "),s("div",{staticClass:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Screen")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.screenValue)))])]),e._v(" "),s("div",[s("ns-numpad",{attrs:{currency:!0,value:e.screen},on:{changed:function(t){return e.updateScreen(t)},next:function(t){return e.proceedPayment(t)}}})],1)])])])}),[],!1,null,null,null).exports;var T=s(9089);function E(e,t){for(var s=0;s0?t[0].label:(0,u.__)("Unknown Status")}},{key:"getDeliveryStatus",value:function(e){var t=deliveryStatuses.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,u.__)("Unknown Status")}},{key:"getProcessingStatus",value:function(e){var t=processingStatuses.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,u.__)("Unknown Status")}},{key:"getPaymentStatus",value:function(e){var t=paymentLabels.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,u.__)("Unknown Status")}}])&&E(t.prototype,s),n&&E(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function V(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function F(e){for(var t=1;t0?s("span",[e._v(e._s(e._f("currency")(e.order.total-e.order.tendered)))]):e._e(),e._v(" "),e.order.total-e.order.tendered<=0?s("span",[e._v(e._s(e._f("currency")(0)))]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2 w-full md:w-1/2"},[s("div",{staticClass:"my-1 h-12 py-1 px-2 flex justify-between items-center elevation-surface warning border text-xl font-bold"},[s("span",[e._v(e._s(e.__("Customer Account")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.customer.account_amount)))])])])]),e._v(" "),s("div",{staticClass:"flex -mx-4 flex-wrap"},[s("div",{staticClass:"px-2 w-full mb-4 md:w-1/2"},["paid"!==e.order.payment_status?s("div",[s("h3",{staticClass:"font-semibold border-b-2 border-info-primary py-2"},[e._v("\n "+e._s(e.__("Payment"))+"\n ")]),e._v(" "),s("div",{staticClass:"py-2"},[e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),e._v(" "),s("div",{staticClass:"my-2 px-2 h-12 flex justify-end items-center border elevation-surface"},[e._v("\n "+e._s(e._f("currency")(e.inputValue))+"\n ")]),e._v(" "),s("ns-numpad",{attrs:{floating:!0,value:e.inputValue},on:{next:function(t){return e.submitPayment(t)},changed:function(t){return e.updateValue(t)}}})],2)]):e._e(),e._v(" "),"paid"===e.order.payment_status?s("div",{staticClass:"flex items-center justify-center h-full"},[s("h3",{staticClass:"text-primary font-semibold"},[e._v(e._s(e.__("No payment possible for paid order.")))])]):e._e()]),e._v(" "),s("div",{staticClass:"px-2 w-full mb-4 md:w-1/2"},[s("h3",{staticClass:"font-semibold border-b-2 border-info-primary py-2 mb-2"},[e._v("\n "+e._s(e.__("Payment History"))+"\n ")]),e._v(" "),s("ul",e._l(e.order.payments,(function(t){return s("li",{key:t.id,staticClass:"p-2 flex items-center justify-between text-shite border elevation-surface mb-2"},[s("span",[e._v(e._s(e.paymentsLabels[t.identifier]||e.__("Unknown")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(t.value)))])])})),0)])])])}),[],!1,null,null,null).exports;var R=s(3306);const L={props:["order"],data:function(){return{processingStatuses,deliveryStatuses,labels:new D,showProcessingSelect:!1,showDeliverySelect:!1}},mounted:function(){},methods:{__:u.__,submitProcessingChange:function(){var e=this;C.G.show(w.default,{title:(0,u.__)("Would you proceed ?"),message:(0,u.__)("The processing status of the order will be changed. Please confirm your action."),onAction:function(t){t&&i.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/processing"),{process_status:e.order.process_status}).subscribe({next:function(t){e.showProcessingSelect=!1,i.kX.success(t.message).subscribe()},error:function(e){i.kX.error(e.message||(0,u.__)("Unexpected error occured.")).subscribe()}})}})},openRefunds:function(){var e=this;try{new Promise((function(t,s){var n=e.order;C.G.show(R.Z,{order:n,resolve:t,reject:s})}))}catch(e){}},submitDeliveryStatus:function(){var e=this;C.G.show(w.default,{title:(0,u.__)("Would you proceed ?"),message:(0,u.__)("The delivery status of the order will be changed. Please confirm your action."),onAction:function(t){t&&i.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/delivery"),{delivery_status:e.order.delivery_status}).subscribe({next:function(t){e.showDeliverySelect=!1,i.kX.success(t.message).subscribe()},error:function(e){i.kX.error(e.message||(0,u.__)("Unexpected error occured.")).subscribe()}})}})}}};const I=(0,h.Z)(L,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-mx-4 flex flex-wrap"},[s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"w-full mb-2 flex-wrap flex"},[s("div",{staticClass:"w-full mb-2 px-4"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Payment Summary")))])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"elevation-surface border p-2 flex justify-between items-start"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Sub Total")))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(e.order.subtotal)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice error"},[s("div",[s("h4",{staticClass:"text-semibold"},[s("span",{staticClass:"text-white"},[e._v(e._s(e.__("Discount")))]),e._v(" "),"percentage"===e.order.discount_type?s("span",{staticClass:"text-white ml-1"},[e._v("("+e._s(e.order.discount_percentage)+"%)")]):e._e(),e._v(" "),"flat"===e.order.discount_type?s("span",{staticClass:"text-white ml-1"},[e._v("(Flat)")]):e._e()])]),e._v(" "),s("div",{staticClass:"font-semibold"},[s("span",[e._v(e._s(e._f("currency")(e.order.discount)))])])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Shipping")))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(e.order.shipping)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice error"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v("\n "+e._s(e.__("Coupons"))+"\n ")])]),e._v(" "),s("div",{staticClass:"font-semibold"},[s("span",[e._v(e._s(e._f("currency")(e.order.total_coupons)))])])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice info"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Total")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.total)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice warning"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Taxes")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.tax_value)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start text-primary elevation-surface error border"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Change")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.change)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Paid")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.tendered)))])])])])]),e._v(" "),s("div",{staticClass:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},[s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Order Status")))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Customer")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.order.nexopos_customers_name))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Type")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.labels.getTypeLabel(e.order.type)))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Delivery Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},[s("div",{staticClass:"w-full text-center"},[e.showDeliverySelect?e._e():s("span",{staticClass:"font-semibold text-secondary border-b border-info-primary cursor-pointer border-dashed",on:{click:function(t){e.showDeliverySelect=!0}}},[e._v(e._s(e.labels.getDeliveryStatus(e.order.delivery_status)))])]),e._v(" "),e.showDeliverySelect?s("div",{staticClass:"flex-auto flex"},[s("div",{staticClass:"ns-select flex items-center justify-center"},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.order.delivery_status,expression:"order.delivery_status"}],ref:"process_status",staticClass:"flex-auto border-info-primary rounded-lg",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.order,"delivery_status",t.target.multiple?s:s[0])}}},e._l(e.deliveryStatuses,(function(t,n){return s("option",{key:n,domProps:{value:t.value}},[e._v(e._s(t.label))])})),0)]),e._v(" "),s("div",{staticClass:"pl-2 flex"},[s("ns-close-button",{on:{click:function(t){e.showDeliverySelect=!1}}}),e._v(" "),s("button",{staticClass:"bg-success-primary text-white rounded-full px-2 py-1",on:{click:function(t){return e.submitDeliveryStatus(e.order)}}},[e._v(e._s(e.__("Save")))])],1)]):e._e()])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex flex-col md:flex-row justify-between items-center elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Processing Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},[s("div",{staticClass:"w-full text-center"},[e.showProcessingSelect?e._e():s("span",{staticClass:"border-b border-info-primary cursor-pointer border-dashed",on:{click:function(t){e.showProcessingSelect=!0}}},[e._v(e._s(e.labels.getProcessingStatus(e.order.process_status)))])]),e._v(" "),e.showProcessingSelect?s("div",{staticClass:"flex-auto flex"},[s("div",{staticClass:"ns-select flex items-center justify-center"},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.order.process_status,expression:"order.process_status"}],ref:"process_status",staticClass:"flex-auto border-info-primary rounded-lg",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.order,"process_status",t.target.multiple?s:s[0])}}},e._l(e.processingStatuses,(function(t,n){return s("option",{key:n,domProps:{value:t.value}},[e._v(e._s(t.label))])})),0)]),e._v(" "),s("div",{staticClass:"pl-2 flex"},[s("ns-close-button",{on:{click:function(t){e.showProcessingSelect=!1}}}),e._v(" "),s("button",{staticClass:"bg-success-primary text-white rounded-full px-2 py-1",on:{click:function(t){return e.submitProcessingChange(e.order)}}},[e._v(e._s(e.__("Save")))])],1)]):e._e()])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Payment Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.labels.getPaymentStatus(e.order.payment_status)))])])]),e._v(" "),s("div",{staticClass:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},[s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Products")))])]),e._v(" "),e._l(e.order.products,(function(t){return s("div",{key:t.id,staticClass:"p-2 flex justify-between items-start elevation-surface border mb-6"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(t.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-secondary text-sm"},[e._v(e._s(t.unit.name||"N/A"))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(t.total_price)))])])})),e._v(" "),s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary flex justify-between"},[s("span",[e._v(e._s(e.__("Refunded Products")))]),e._v(" "),s("a",{staticClass:"border-b border-info-primary border-dashed",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.openRefunds()}}},[e._v(e._s(e.__("All Refunds")))])])]),e._v(" "),e._l(e.order.refunded_products,(function(t){return s("div",{key:t.id,staticClass:"p-2 flex justify-between items-start elevation-surface border mb-6"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(t.order_product.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-secondary text-sm"},[e._v(e._s(t.unit.name||"N/A")+" | "),s("span",{staticClass:"rounded-full px-2",class:"damaged"===t.condition?"bg-error-tertiary text-white":"bg-info-tertiary text-white"},[e._v(e._s(t.condition))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(t.total_price)))])])}))],2)])}),[],!1,null,null,null).exports;function H(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function M(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const X={name:"ns-order-instalments-payment",components:{nsNotice:s(7975).nsNotice},data:function(){return{paymentTypes,fields:[{type:"select",name:"payment_type",description:(0,u.__)("Select the payment type that must apply to the current order."),label:(0,u.__)("Payment Type"),validation:"required",options:paymentTypes}],print:new k.Z({settings:systemSettings,options:systemOptions,type:"payment"}),validation:new l.Z,order:null,instalment:null}},methods:{__:u.__,popupResolver:_.Z,popupCloser:c.Z,close:function(){this.popupResolver(!1)},updateInstalmentAsDue:function(e){var t=this;nsHttpClient.put("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments/").concat(this.instalment.id,"/"),{instalment:{date:ns.date.moment.format("YYYY-MM-DD HH:mm:ss")}}).subscribe({next:function(e){t.submitPayment()},error:function(e){i.kX.error(e.message||(0,u.__)("An unexpected error has occured")).subscribe()}})},submitPayment:function(){var e=this;if(!this.validation.validateFields(this.fields))return i.kX.error(__m("The form is not valid.")).subcribe();nsHttpClient.post("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments/").concat(this.instalment.id,"/pay"),function(e){for(var t=1;t0?this.instalments.map((function(e){return e.amount})).reduce((function(e,t){return parseFloat(e)+parseFloat(t)})):0}},methods:{__:u.__,loadInstalments:function(){var e=this;i.ih.get("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments")).subscribe((function(t){e.original=t,e.instalments=t.map((function(e){return e.price_clicked=!1,e.date_clicked=!1,e.date=moment(e.date).format("YYYY-MM-DD"),e}))}))},showReceipt:function(e){if(null===e.payment_id)return i.kX.error((0,u.__)("This instalment doesn't have any payment attached.")).subscribe();this.print.printOrder(e.payment_id)},addInstalment:function(){this.instalments.push({date:ns.date.moment.format("YYYY-MM-DD"),amount:this.order.total-this.totalInstalments,paid:!1})},createInstalment:function(e){var t=this;Popup.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to create this instalment ?"),onAction:function(s){s&&i.ih.post("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments"),{instalment:e}).subscribe({next:function(e){t.loadInstalments(),i.kX.success(e.message).subscribe()},error:function(e){i.kX.error(e.message||(0,u.__)("An unexpected error has occured")).subscribe()}})}})},deleteInstalment:function(e){var t=this;Popup.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to delete this instalment ?"),onAction:function(s){s&&i.ih.delete("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments/").concat(e.id)).subscribe({next:function(s){var n=t.instalments.indexOf(e);t.instalments.splice(n,1),i.kX.success(s.message).subscribe()},error:function(e){i.kX.error(e.message||(0,u.__)("An unexpected error has occured")).subscribe()}})}})},markAsPaid:function(e){var t,s=this;return(t=r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,new Promise((function(t,n){Popup.show(Y,{order:s.order,instalment:e,resolve:t,reject:n})}));case 3:t.sent,s.loadInstalments(),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})),function(){var e=this,s=arguments;return new Promise((function(n,r){var i=t.apply(e,s);function o(e){U(i,n,r,o,a,"next",e)}function a(e){U(i,n,r,o,a,"throw",e)}o(void 0)}))})()},togglePriceEdition:function(e){var t=this;e.paid||(e.price_clicked=!e.price_clicked,this.$forceUpdate(),e.price_clicked&&setTimeout((function(){t.$refs.amount[0].select()}),100))},updateInstalment:function(e){var t=this;Popup.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to update that instalment ?"),onAction:function(s){s&&i.ih.put("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments/").concat(e.id),{instalment:e}).subscribe({next:function(e){i.kX.success(e.message).subscribe()},error:function(e){i.kX.error(e.message||(0,u.__)("An unexpected error has occured")).subscribe()}})}})},toggleDateEdition:function(e){var t=this;e.paid||(e.date_clicked=!e.date_clicked,this.$forceUpdate(),e.date_clicked&&setTimeout((function(){t.$refs.date[0].select()}),200))}}};const z=(0,h.Z)(N,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-mx-4 flex-auto flex flex-wrap"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"w-full mb-2 flex-wrap"},[s("div",{staticClass:"w-full mb-2 px-4"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Instalments")))])]),e._v(" "),s("div",{staticClass:"px-4"},[s("ul",{staticClass:"border-table-th-edge border-t text-primary"},[e._l(e.instalments,(function(t){return s("li",{key:t.id,staticClass:"border-b border-l flex justify-between elevation-surface",class:t.paid?"success":"info"},[s("span",{staticClass:"p-2"},[t.date_clicked?e._e():s("span",{on:{click:function(s){return e.toggleDateEdition(t)}}},[e._v(e._s(t.date))]),e._v(" "),t.date_clicked?s("span",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.date,expression:"instalment.date"}],ref:"date",refInFor:!0,staticClass:"border border-info-primary rounded",attrs:{type:"date"},domProps:{value:t.date},on:{blur:function(s){return e.toggleDateEdition(t)},input:function(s){s.target.composing||e.$set(t,"date",s.target.value)}}})]):e._e()]),e._v(" "),s("div",{staticClass:"flex items-center"},[s("div",{staticClass:"flex items-center px-2 h-full border-r"},[t.price_clicked?e._e():s("span",{on:{click:function(s){return e.togglePriceEdition(t)}}},[e._v(e._s(e._f("currency")(t.amount)))]),e._v(" "),t.price_clicked?s("span",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.amount,expression:"instalment.amount"}],ref:"amount",refInFor:!0,staticClass:"border border-info-primary p-1",attrs:{type:"text"},domProps:{value:t.amount},on:{blur:function(s){return e.togglePriceEdition(t)},input:function(s){s.target.composing||e.$set(t,"amount",s.target.value)}}})]):e._e()]),e._v(" "),!t.paid&&t.id?s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full border-r"},[s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"success",className:"la-money-bill-wave-alt"},on:{click:function(s){return e.markAsPaid(t)}}})],1),e._v(" "),s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"info",className:"la-save"},on:{click:function(s){return e.updateInstalment(t)}}})],1),e._v(" "),s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"error",className:"la-trash-alt"},on:{click:function(s){return e.deleteInstalment(t)}}})],1)]):e._e(),e._v(" "),t.paid||t.id?e._e():s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full border-r"},[s("div",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"px-3 py-1 rounded-full",on:{click:function(s){return e.createInstalment(t)}}},[s("i",{staticClass:"las la-plus"}),e._v("\n "+e._s(e.__("Create"))+"\n ")])])])]),e._v(" "),t.paid?s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"px-3 text-xs py-1 rounded-full",on:{click:function(s){return e.showReceipt(t)}}},[s("i",{staticClass:"las la-print"}),e._v("\n "+e._s(e.__("Receipt"))+"\n ")])])]):e._e()])])})),e._v(" "),s("li",{staticClass:"flex justify-between p-2 border-r border-b border-l elevation-surface"},[s("div",{staticClass:"flex items-center justify-center"},[s("span",[e._v("\n "+e._s(e.__("Total :"))+" "+e._s(e._f("currency")(e.order.total))+"\n ")]),e._v(" "),s("span",{staticClass:"ml-1 text-sm"},[e._v("\n ("+e._s(e.__("Remaining :"))+" "+e._s(e._f("currency")(e.order.total-e.totalInstalments))+")\n ")])]),e._v(" "),s("div",{staticClass:"-mx-2 flex flex-wrap items-center"},[s("span",{staticClass:"px-2"},[e._v("\n "+e._s(e.__("Instalments:"))+" "+e._s(e._f("currency")(e.totalInstalments))+"\n ")]),e._v(" "),s("span",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"rounded-full px-3 py-1",on:{click:function(t){return e.addInstalment()}}},[e._v(e._s(e.__("Add Instalment")))])])])])])],2)])])])])}),[],!1,null,null,null).exports;function Q(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}function W(e){return function(){var t=this,s=arguments;return new Promise((function(n,r){var i=e.apply(t,s);function o(e){Q(i,n,r,o,a,"next",e)}function a(e){Q(i,n,r,o,a,"throw",e)}o(void 0)}))}}var B={filters:{nsCurrency:o.W},name:"ns-preview-popup",data:function(){return{active:"details",order:new Object,products:[],payments:[],options:null,settings:null}},components:{nsOrderRefund:$,nsOrderPayment:Z,nsOrderDetails:I,nsOrderInstalments:z},computed:{isVoidable:function(){return["paid","partially_paid","unpaid"].includes(this.order.payment_status)},isDeleteAble:function(){return["hold"].includes(this.order.payment_status)}},methods:{__:u.__,popupResolver:_.Z,popupCloser:c.Z,closePopup:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.popupResolver(e)},setActive:function(e){this.active=e},refresh:function(){this.$popupParams.component.$emit("updated"),this.loadOrderDetails(this.order.id)},printOrder:function(){if("default"===this.options.ns_pos_printing_gateway)this.processRegularPrinting(this.order.id);else this.processCustomPrinting(this.order.id,this.options.ns_pos_printing_gateway,!1)},processCustomPrinting:function(e,t){var s=arguments;return W(r().mark((function n(){var o;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o=!(s.length>2&&void 0!==s[2])||s[2],!1===nsHooks.applyFilters(o?"ns-order-custom-print":"ns-order-custom-print-aloud",{printed:!1,order_id:e,gateway:t}).printed&&i.kX.error((0,u.__)("Unsupported print gateway.")).subscribe();case 3:case"end":return n.stop()}}),n)})))()},processRegularPrinting:function(e){var t=document.querySelector("printing-section");t&&t.remove();var s=document.createElement("iframe");s.id="printing-section",s.className="hidden",s.src=this.settings.sale_printing_url.replace("{reference_id}",e),document.body.appendChild(s)},loadOrderDetails:function(e){var t=this;(0,a.D)([i.ih.get("/api/nexopos/v4/orders/".concat(e)),i.ih.get("/api/nexopos/v4/orders/".concat(e,"/products")),i.ih.get("/api/nexopos/v4/orders/".concat(e,"/payments"))]).subscribe((function(e){t.order=e[0],t.products=e[1],t.payments=e[2]}))},deleteOrder:function(){var e=this;Popup.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to delete this order"),onAction:function(t){t&&i.ih.delete("/api/nexopos/v4/orders/".concat(e.order.id)).subscribe({next:function(t){i.kX.success(t.message).subscribe(),e.refreshCrudTable(),e.closePopup(!0)},error:function(e){i.kX.error(e.message).subscribe()}})}})},voidOrder:function(){var e=this;try{new Promise((function(t,s){Popup.show(T.default,{resolve:t,reject:s,title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("The current order will be void. This action will be recorded. Consider providing a reason for this operation"),onAction:function(t){!1!==t&&i.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/void"),{reason:t}).subscribe({next:function(t){i.kX.success(t.message).subscribe(),e.refreshCrudTable(),e.closePopup(!0)},error:function(e){i.kX.error(e.message).subscribe()}})}})}))}catch(e){console.log(e)}},refreshCrudTable:function(){this.$popupParams.component.$emit("updated",!0)}},watch:{active:function(){"details"===this.active&&this.loadOrderDetails(this.order.id)}},mounted:function(){this.order=this.$popupParams.order,this.options=systemOptions,this.settings=systemSettings,this.loadOrderDetails(this.order.id),this.popupCloser()}};window.nsOrderPreviewPopup=B;const G=B;const K=(0,h.Z)(G,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-95vh w-95vw md:h-6/7-screen md:w-6/7-screen overflow-hidden shadow-xl ns-box flex flex-col"},[s("div",{staticClass:"border-b ns-box-header p-3 flex items-center justify-between"},[s("div",[s("h3",[e._v(e._s(e.__("Order Options")))])]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup(!0)}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 overflow-scroll ns-box-body flex flex-auto"},[e.order.id?s("ns-tabs",{attrs:{active:e.active},on:{active:function(t){return e.setActive(t)}}},[s("ns-tabs-item",{staticClass:"overflow-y-auto",attrs:{label:e.__("Details"),identifier:"details"}},[s("ns-order-details",{attrs:{order:e.order}})],1),e._v(" "),["order_void","hold","refunded","partially_refunded"].includes(e.order.payment_status)?e._e():s("ns-tabs-item",{staticClass:"overflow-y-auto",attrs:{label:e.__("Payments"),identifier:"payments"}},[s("ns-order-payment",{attrs:{order:e.order},on:{changed:function(t){return e.refresh()}}})],1),e._v(" "),["order_void","hold","refunded"].includes(e.order.payment_status)?e._e():s("ns-tabs-item",{staticClass:"flex overflow-y-auto",attrs:{label:e.__("Refund & Return"),identifier:"refund"}},[s("ns-order-refund",{attrs:{order:e.order},on:{loadTab:function(t){return e.setActive(t)},changed:function(t){return e.refresh()}}})],1),e._v(" "),["partially_paid","unpaid"].includes(e.order.payment_status)&&e.order.support_instalments?s("ns-tabs-item",{staticClass:"flex overflow-y-auto",attrs:{label:e.__("Installments"),identifier:"instalments"}},[s("ns-order-instalments",{attrs:{order:e.order},on:{changed:function(t){return e.refresh()}}})],1):e._e()],1):e._e(),e._v(" "),e.order.id?e._e():s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1)],1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between border-t ns-box-footer"},[s("div",[e.isVoidable?s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.voidOrder()}}},[s("i",{staticClass:"las la-ban"}),e._v("\n "+e._s(e.__("Void"))+"\n ")]):e._e(),e._v(" "),e.isDeleteAble?s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.deleteOrder()}}},[s("i",{staticClass:"las la-trash"}),e._v("\n "+e._s(e.__("Delete"))+"\n ")]):e._e()],1),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.printOrder()}}},[s("i",{staticClass:"las la-print"}),e._v("\n "+e._s(e.__("Print"))+"\n ")])],1)])])}),[],!1,null,null,null).exports},3306:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var n=s(7389),r=s(8603),i=s(6386),o=s(9671),a=s(1703);const l={name:"ns-orders-refund-popup",data:function(){return{order:null,refunds:[],view:"summary",previewed:null,loaded:!1,options:systemOptions,settings:systemSettings,print:new a.Z({settings:systemSettings,options:systemOptions,type:"refund"})}},methods:{__:n.__,popupCloser:r.Z,popupResolver:i.Z,toggleProductView:function(e){this.view="details",this.previewed=e},loadOrderRefunds:function(){var e=this;nsHttpClient.get("/api/nexopos/v4/orders/".concat(this.order.id,"/refunds")).subscribe((function(t){e.loaded=!0,e.refunds=t.refunds}),(function(e){o.kX.error(e.message).subscribe()}))},close:function(){this.$popup.close()},printRefundReceipt:function(e){this.print.printOrder(e.id)}},mounted:function(){this.order=this.$popupParams.order,this.popupCloser(),this.loadOrderRefunds()}};const c=(0,s(1900).Z)(l,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg w-95vw h-95vh md:w-3/5-screen md:h-3/5-screen ns-box flex flex-col overflow-hidden"},[s("div",{staticClass:"border-b p-2 flex items-center justify-between ns-box-header"},[s("h3",[e._v(e._s(e.__("Order Refunds")))]),e._v(" "),s("div",{staticClass:"flex"},["details"===e.view?s("div",{staticClass:"flex items-center justify-center cursor-pointer rounded-full px-3 border hover:bg-info-primary hover:text-white mr-1",on:{click:function(t){e.view="summary"}}},[e._v(e._s(e.__("Go Back")))]):e._e(),e._v(" "),s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"overflow-auto flex-auto ns-box-body"},["summary"===e.view?[e.loaded?e._e():s("div",{staticClass:"flex h-full w-full items-center justify-center"},[s("ns-spinner",{attrs:{size:"24"}})],1),e._v(" "),e.loaded&&0===e.refunds.length?s("div",{staticClass:"flex h-full w-full items-center justify-center"},[s("i",{staticClass:"lar la-frown-open"})]):e._e(),e._v(" "),e.loaded&&e.refunds.length>0?e._l(e.refunds,(function(t){return s("div",{key:t.id,staticClass:"border-b flex flex-col md:flex-row"},[s("div",{staticClass:"w-full md:flex-auto p-2"},[s("h3",{staticClass:"font-semibold mb-1"},[e._v(e._s(e.order.code))]),e._v(" "),s("div",[s("ul",{staticClass:"flex -mx-1 text-sm text-primary"},[s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Total"))+" : "+e._s(e._f("currency")(t.total)))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("By"))+" : "+e._s(t.author.username))])])])]),e._v(" "),s("div",{staticClass:"w-full md:w-16 cursor-pointer hover:bg-info-primary hover:border-info-primary hover:text-white text-lg flex items-center justify-center md:border-l",on:{click:function(s){return e.toggleProductView(t)}}},[s("i",{staticClass:"las la-eye"})]),e._v(" "),s("div",{staticClass:"w-full md:w-16 cursor-pointer hover:bg-info-primary hover:border-info-primary hover:text-white text-lg flex items-center justify-center md:border-l",on:{click:function(s){return e.printRefundReceipt(t)}}},[s("i",{staticClass:"las la-print"})])])})):e._e()]:e._e(),e._v(" "),"details"===e.view?e._l(e.previewed.refunded_products,(function(t){return s("div",{key:t.id,staticClass:"border-b flex flex-col md:flex-row"},[s("div",{staticClass:"w-full md:flex-auto p-2"},[s("h3",{staticClass:"font-semibold mb-1"},[e._v(e._s(t.product.name))]),e._v(" "),s("div",[s("ul",{staticClass:"flex -mx-1 text-sm text-primary"},[s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Condition"))+" : "+e._s(t.condition))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Quantity"))+" : "+e._s(t.quantity))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Total"))+" : "+e._s(e._f("currency")(t.total_price)))])])])])])})):e._e()],2)])}),[],!1,null,null,null).exports},3601:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});var n=s(7389),r=s(6386),i=s(8603);const o={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:n.__,popupResolver:r.Z,popupCloser:i.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const a=(0,s(1900).Z)(o,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[s("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),s("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"action-buttons flex border-t"},[s("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),s("hr",{staticClass:"border-r h-16"}),e._v(" "),s("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports},241:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var n=s(8603),r=s(6386),i=s(9671),o=s(7389),a=s(9510);s(9624);const l={name:"ns-pos-coupons-load-popup",components:{nsNotice:s(1828).Z},data:function(){return{placeHolder:(0,o.__)("Coupon Code"),couponCode:null,order:null,activeTab:"apply-coupon",orderSubscriber:null,customerCoupon:null}},mounted:function(){var e=this;this.popupCloser(),this.$refs.coupon.select(),this.orderSubscriber=POS.order.subscribe((function(t){e.order=t,e.order.coupons.length>0&&(e.activeTab="active-coupons")})),this.$popupParams&&this.$popupParams.apply_coupon&&(this.couponCode=this.$popupParams.apply_coupon,this.getCoupon(this.couponCode).subscribe({next:function(t){e.customerCoupon=t,e.apply()}}))},destroyed:function(){this.orderSubscriber.unsubscribe()},methods:{__:o.__,popupCloser:n.Z,popupResolver:r.Z,selectCustomer:function(){Popup.show(a.Z)},cancel:function(){this.customerCoupon=null,this.couponCode=null},removeCoupon:function(e){this.order.coupons.splice(e,1),POS.refreshCart()},apply:function(){var e=this;try{var t=this.customerCoupon;if(null!==this.customerCoupon.coupon.valid_hours_start&&!ns.date.moment.isAfter(this.customerCoupon.coupon.valid_hours_start)&&this.customerCoupon.coupon.valid_hours_start.length>0)return i.kX.error((0,o.__)("The coupon is out from validity date range.")).subscribe();if(null!==this.customerCoupon.coupon.valid_hours_end&&!ns.date.moment.isBefore(this.customerCoupon.coupon.valid_hours_end)&&this.customerCoupon.coupon.valid_hours_end.length>0)return i.kX.error((0,o.__)("The coupon is out from validity date range.")).subscribe();var s=this.customerCoupon.coupon.products;if(s.length>0){var n=s.map((function(e){return e.product_id}));if(0===this.order.products.filter((function(e){return n.includes(e.product_id)})).length)return i.kX.error((0,o.__)("This coupon requires products that aren't available on the cart at the moment.")).subscribe()}var r=this.customerCoupon.coupon.categories;if(r.length>0){var a=r.map((function(e){return e.category_id}));if(0===this.order.products.filter((function(e){return a.includes(e.$original().category_id)})).length)return i.kX.error((0,o.__)("This coupon requires products that belongs to specific categories that aren't included at the moment.").replace("%s")).subscribe()}this.cancel();var l={active:t.coupon.active,customer_coupon_id:t.id,minimum_cart_value:t.coupon.minimum_cart_value,maximum_cart_value:t.coupon.maximum_cart_value,name:t.coupon.name,type:t.coupon.type,value:0,limit_usage:t.coupon.limit_usage,code:t.coupon.code,discount_value:t.coupon.discount_value,categories:t.coupon.categories,products:t.coupon.products};POS.pushCoupon(l),this.activeTab="active-coupons",setTimeout((function(){e.popupResolver(l)}),500),i.kX.success((0,o.__)("The coupon has applied to the cart.")).subscribe()}catch(e){console.log(e)}},getCouponType:function(e){switch(e){case"percentage_discount":return(0,o.__)("Percentage");case"flat_discount":return(0,o.__)("Flat");default:return(0,o.__)("Unknown Type")}},getDiscountValue:function(e){switch(e.type){case"percentage_discount":return e.discount_value+"%";case"flat_discount":return this.$options.filters.currency(e.discount_value)}},closePopup:function(){this.popupResolver(!1)},setActiveTab:function(e){this.activeTab=e},getCoupon:function(e){return!this.order.customer_id>0?i.kX.error((0,o.__)("You must select a customer before applying a coupon.")).subscribe():i.ih.post("/api/nexopos/v4/customers/coupons/".concat(e),{customer_id:this.order.customer_id})},loadCoupon:function(){var e=this,t=this.couponCode;this.getCoupon(t).subscribe({next:function(t){e.customerCoupon=t,i.kX.success((0,o.__)("The coupon has been loaded.")).subscribe()},error:function(e){i.kX.error(e.message||(0,o.__)("An unexpected error occured.")).subscribe()}})}}};const c=(0,s(1900).Z)(l,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg ns-box w-95vw md:w-3/6-screen lg:w-2/6-screen"},[s("div",{staticClass:"border-b ns-box-header p-2 flex justify-between items-center"},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Load Coupon")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"p-1 ns-box-body"},[s("ns-tabs",{attrs:{active:e.activeTab},on:{changeTab:function(t){return e.setActiveTab(t)}}},[s("ns-tabs-item",{attrs:{label:e.__("Apply A Coupon"),padding:"p-2",identifier:"apply-coupon"}},[s("div",{staticClass:"border-2 input-group info rounded flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.couponCode,expression:"couponCode"}],ref:"coupon",staticClass:"w-full text-primary p-2 outline-none",attrs:{type:"text",placeholder:e.placeHolder},domProps:{value:e.couponCode},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.loadCoupon()},input:function(t){t.target.composing||(e.couponCode=t.target.value)}}}),e._v(" "),s("button",{staticClass:"px-3 py-2",on:{click:function(t){return e.loadCoupon()}}},[e._v(e._s(e.__("Load")))])]),e._v(" "),s("div",{staticClass:"pt-2"},[s("ns-notice",{attrs:{color:"info"},scopedSlots:e._u([{key:"description",fn:function(){return[e._v(e._s(e.__("Input the coupon code that should apply to the POS. If a coupon is issued for a customer, that customer must be selected priorly.")))]},proxy:!0}])})],1),e._v(" "),e.order&&void 0===e.order.customer_id?s("div",{staticClass:"pt-2 flex"},[s("button",{staticClass:"w-full border p-2 outline-none ns-numpad-key info cursor-pointer text-center",on:{click:function(t){return e.selectCustomer()}}},[e._v(e._s(e.__("Click here to choose a customer.")))])]):e._e(),e._v(" "),e.order&&void 0!==e.order.customer_id?s("div",{staticClass:"pt-2"},[s("ns-notice",{attrs:{color:"success"},scopedSlots:e._u([{key:"description",fn:function(){return[e._v(e._s(e.__("Loading Coupon For : ")+e.order.customer.name+" "+e.order.customer.surname))]},proxy:!0}],null,!1,2531213351)})],1):e._e(),e._v(" "),s("div",{staticClass:"overflow-hidden"},[e.customerCoupon?s("div",{staticClass:"pt-2 fade-in-entrance anim-duration-500 overflow-y-auto ns-scrollbar h-64"},[s("table",{staticClass:"w-full ns-table"},[s("tbody",[s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Coupon Name")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.customerCoupon.name))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Discount"))+" ("+e._s(e.getCouponType(e.customerCoupon.coupon.type))+")")]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.getDiscountValue(e.customerCoupon.coupon)))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Usage")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.customerCoupon.usage+"/"+(e.customerCoupon.limit_usage||e.__("Unlimited"))))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Valid From")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.customerCoupon.coupon.valid_hours_start||e.__("N/A")))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Valid Till")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.customerCoupon.coupon.valid_hours_end||e.__("N/A")))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Categories")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[s("ul",[e._l(e.customerCoupon.coupon.categories,(function(t){return s("li",{key:t.id,staticClass:"rounded-full px-3 py-1 border"},[e._v(e._s(t.category.name))])})),e._v(" "),0===e.customerCoupon.coupon.categories.length?s("li",[e._v(e._s(e.__("Not applicable")))]):e._e()],2)])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Products")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[s("ul",[e._l(e.customerCoupon.coupon.products,(function(t){return s("li",{key:t.id,staticClass:"rounded-full px-3 py-1 border"},[e._v(e._s(t.product.name))])})),e._v(" "),0===e.customerCoupon.coupon.products.length?s("li",[e._v(e._s(e.__("Not applicable")))]):e._e()],2)])])])])]):e._e()])]),e._v(" "),s("ns-tabs-item",{attrs:{label:e.__("Active Coupons"),padding:"p-1",identifier:"active-coupons"}},[e.order?s("ul",[e._l(e.order.coupons,(function(t,n){return s("li",{key:n,staticClass:"flex justify-between elevation-surface border items-center px-2 py-1"},[s("div",{staticClass:"flex-auto"},[s("h3",{staticClass:"font-semibold text-primary p-2 flex justify-between"},[s("span",[e._v(e._s(t.name))]),e._v(" "),s("span",[e._v(e._s(e.getDiscountValue(t)))])])]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.removeCoupon(n)}}})],1)])})),e._v(" "),0===e.order.coupons.length?s("li",{staticClass:"flex justify-between elevation-surface border items-center p-2"},[e._v("\n "+e._s(e.__("No coupons applies to the cart."))+"\n ")]):e._e()],2):e._e()])],1)],1),e._v(" "),e.customerCoupon?s("div",{staticClass:"flex"},[s("button",{staticClass:"w-1/2 px-3 py-2 bg-success-tertiary text-white font-bold",on:{click:function(t){return e.apply()}}},[e._v("\n "+e._s(e.__("Apply"))+"\n ")]),e._v(" "),s("button",{staticClass:"w-1/2 px-3 py-2 bg-error-tertiary text-white font-bold",on:{click:function(t){return e.cancel()}}},[e._v("\n "+e._s(e.__("Cancel"))+"\n ")])]):e._e()])}),[],!1,null,null,null).exports},9510:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var n=s(9671),r=s(6386),i=s(2242),o=s(1247);const a={data:function(){return{searchCustomerValue:"",orderSubscription:null,order:{},debounceSearch:null,customers:[],isLoading:!1}},computed:{customerSelected:function(){return!1}},watch:{searchCustomerValue:function(e){var t=this;clearTimeout(this.debounceSearch),this.debounceSearch=setTimeout((function(){t.searchCustomer(e)}),500)}},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&e.resolveIfQueued(!1)})),this.orderSubscription=POS.order.subscribe((function(t){e.order=t})),this.getRecentCustomers(),this.$refs.searchField.focus()},destroyed:function(){this.orderSubscription.unsubscribe()},methods:{__:s(7389).__,resolveIfQueued:r.Z,attemptToChoose:function(){if(1===this.customers.length)return this.selectCustomer(this.customers[0]);n.kX.info("Too many result.").subscribe()},openCustomerHistory:function(e,t){t.stopImmediatePropagation(),this.$popup.close(),i.G.show(o.Z,{customer:e,activeTab:"account-payment"})},selectCustomer:function(e){var t=this;this.customers.forEach((function(e){return e.selected=!1})),e.selected=!0,this.isLoading=!0,POS.selectCustomer(e).then((function(s){t.isLoading=!1,t.resolveIfQueued(e)})).catch((function(e){t.isLoading=!1}))},searchCustomer:function(e){var t=this;n.ih.post("/api/nexopos/v4/customers/search",{search:e}).subscribe((function(e){e.forEach((function(e){return e.selected=!1})),t.customers=e}))},createCustomerWithMatch:function(e){this.resolveIfQueued(!1),i.G.show(o.Z,{name:e})},getRecentCustomers:function(){var e=this;this.isLoading=!0,n.ih.get("/api/nexopos/v4/customers/recently-active").subscribe({next:function(t){e.isLoading=!1,t.forEach((function(e){return e.selected=!1})),e.customers=t},error:function(t){e.isLoading=!1}})}}};const l=(0,s(1900).Z)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow-xl w-4/5-screen md:w-2/5-screen xl:w-108",attrs:{id:"ns-pos-customer-select-popup"}},[s("div",{staticClass:"border-b ns-box-header text-center font-semibold text-2xl py-2",attrs:{id:"header"}},[s("h2",[e._v(e._s(e.__("Select Customer")))])]),e._v(" "),s("div",{staticClass:"relative"},[s("div",{staticClass:"p-2 border-b ns-box-body items-center flex justify-between"},[s("span",[e._v(e._s(e.__("Selected"))+" : ")]),e._v(" "),s("div",{staticClass:"flex items-center justify-between"},[s("span",[e._v(e._s(e.order.customer?e.order.customer.name:"N/A"))]),e._v(" "),e.order.customer?s("button",{staticClass:"mx-2 rounded-full h-8 w-8 flex items-center justify-center border ns-inset-button hover:border-transparent",on:{click:function(t){return e.openCustomerHistory(e.order.customer,t)}}},[s("i",{staticClass:"las la-eye"})]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 border-b ns-box-body flex justify-between text-primary"},[s("div",{staticClass:"input-group flex-auto border-2 rounded"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchCustomerValue,expression:"searchCustomerValue"}],ref:"searchField",staticClass:"outline-none w-full p-2",attrs:{placeholder:"Search Customer",type:"text"},domProps:{value:e.searchCustomerValue},on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.attemptToChoose()},input:function(t){t.target.composing||(e.searchCustomerValue=t.target.value)}}})])]),e._v(" "),s("div",{staticClass:"h-3/5-screen xl:h-2/5-screen overflow-y-auto ns-scrollbar"},[s("ul",{staticClass:"ns-vertical-menu"},[e.customers&&0===e.customers.length?s("li",{staticClass:"p-2 text-center text-primary"},[e._v("\n "+e._s(e.__("No customer match your query..."))+"\n ")]):e._e(),e._v(" "),e.customers&&0===e.customers.length?s("li",{staticClass:"p-2 cursor-pointer text-center text-primary",on:{click:function(t){return e.createCustomerWithMatch(e.searchCustomerValue)}}},[s("span",{staticClass:"border-b border-dashed border-info-primary"},[e._v(e._s(e.__("Create a customer")))])]):e._e(),e._v(" "),e._l(e.customers,(function(t){return s("li",{key:t.id,staticClass:"cursor-pointer p-2 border-b text-primary flex justify-between items-center",on:{click:function(s){return e.selectCustomer(t)}}},[s("span",[e._v(e._s(t.name))]),e._v(" "),s("p",{staticClass:"flex items-center"},[t.owe_amount>0?s("span",{staticClass:"text-error-primary"},[e._v("-"+e._s(e._f("currency")(t.owe_amount)))]):e._e(),e._v(" "),t.owe_amount>0?s("span",[e._v("/")]):e._e(),e._v(" "),s("span",{staticClass:"purchase-amount"},[e._v(e._s(e._f("currency")(t.purchases_amount)))]),e._v(" "),s("button",{staticClass:"mx-2 rounded-full h-8 w-8 flex items-center justify-center border ns-inset-button info",on:{click:function(s){return e.openCustomerHistory(t,s)}}},[s("i",{staticClass:"las la-eye"})])])])}))],2)]),e._v(" "),e.isLoading?s("div",{staticClass:"z-10 top-0 absolute w-full h-full flex items-center justify-center"},[s("ns-spinner",{attrs:{size:"24",border:"8"}})],1):e._e()])])}),[],!1,null,null,null).exports},1247:(e,t,s)=>{"use strict";s.d(t,{Z:()=>x});var n=s(7757),r=s.n(n),i=s(8603),o=s(9671),a=s(2242),l=s(9510),c=s(7266),u=s(7389);const d={mounted:function(){this.closeWithOverlayClicked(),this.loadTransactionFields()},data:function(){return{fields:[],isSubmiting:!1,formValidation:new c.Z}},methods:{__:u.__,closeWithOverlayClicked:i.Z,proceed:function(){var e=this,t=this.$popupParams.customer,s=this.formValidation.extractFields(this.fields);this.isSubmiting=!0,o.ih.post("/api/nexopos/v4/customers/".concat(t.id,"/account-history"),s).subscribe({next:function(t){e.isSubmiting=!1,o.kX.success(t.message).subscribe(),e.$popupParams.resolve(t),e.$popup.close()},error:function(t){e.isSubmiting=!1,o.kX.error(t.message).subscribe(),e.$popupParams.reject(t)}})},close:function(){this.$popup.close(),this.$popupParams.reject(!1)},loadTransactionFields:function(){var e=this;o.ih.get("/api/nexopos/v4/fields/ns.customers-account").subscribe({next:function(t){e.fields=e.formValidation.createFields(t)}})}}};var p=s(1900);const f=(0,p.Z)(d,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-6/7-screen md:w-5/7-screen lg:w-4/7-screen h-6/7-screen md:h-5/7-screen lg:h-5/7-screen overflow-hidden shadow-lg ns-box flex flex-col relative"},[s("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[s("h2",{staticClass:"font-semibold"},[e._v(e._s(e.__("New Transaction")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex-auto overflow-y-auto"},[0===e.fields.length?s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1):e._e(),e._v(" "),e.fields.length>0?s("div",{staticClass:"p-2"},e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1):e._e()]),e._v(" "),s("div",{staticClass:"p-2 ns-box-footer justify-between border-t flex"},[s("div"),e._v(" "),s("div",{staticClass:"px-1"},[s("div",{staticClass:"-mx-2 flex flex-wrap"},[s("div",{staticClass:"px-1"},[s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.close()}}},[e._v(e._s(e.__("Close")))])],1),e._v(" "),s("div",{staticClass:"px-1"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.proceed()}}},[e._v(e._s(e.__("Proceed")))])],1)])])]),e._v(" "),0===e.isSubmiting?s("div",{staticClass:"h-full w-full absolute flex items-center justify-center",staticStyle:{background:"rgb(0 98 171 / 45%)"}},[s("ns-spinner")],1):e._e()])}),[],!1,null,null,null).exports;var v=s(241),h=s(3601),m=s(6386),_=s(3506),b=s(3613);function y(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}const g={name:"ns-pos-customers",data:function(){return{activeTab:"create-customers",customer:null,subscription:null,orders:[],options:{},optionsSubscriber:null,selectedTab:"orders",isLoadingCoupons:!1,isLoadingRewards:!1,isLoadingHistory:!1,isLoadingOrders:!1,coupons:[],rewardsResponse:[],order:null,walletHistories:[]}},components:{nsPaginate:_.Z},destroyed:function(){this.subscription.unsubscribe(),this.optionsSubscriber.unsubscribe()},mounted:function(){var e=this;this.closeWithOverlayClicked(),this.optionsSubscriber=POS.options.subscribe((function(t){e.options=t})),this.subscription=POS.order.subscribe((function(t){e.order=t,void 0!==e.$popupParams.customer?(e.activeTab="account-payment",e.customer=e.$popupParams.customer,e.loadCustomerOrders()):void 0!==t.customer&&(e.activeTab="account-payment",e.customer=t.customer,e.loadCustomerOrders())})),this.popupCloser()},methods:{__:u.__,reload:function(){this.loadCustomerOrders()},popupResolver:m.Z,popupCloser:i.Z,getWalletHistoryLabel:function(e){switch(e){case"add":return(0,u.__)("Crediting");case"deduct":return(0,u.__)("Removing");case"refund":return(0,u.__)("Refunding");case"payment":return(0,u.__)("Payment");default:return(0,u.__)("Unknow")}},getType:function(e){switch(e){case"percentage_discount":return(0,u.__)("Percentage Discount");case"flat_discount":return(0,u.__)("Flat Discount")}},closeWithOverlayClicked:i.Z,openOrderOptions:function(e){var t,s=this;return(t=r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,new Promise((function(t,s){a.G.show(b.Z,{order:e,resolve:t,reject:s})}));case 3:t.sent,s.reload(),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),o.kX.error((0,u.__)("An error occured while opening the order options")).subscribe();case 10:case"end":return t.stop()}}),t,null,[[0,7]])})),function(){var e=this,s=arguments;return new Promise((function(n,r){var i=t.apply(e,s);function o(e){y(i,n,r,o,a,"next",e)}function a(e){y(i,n,r,o,a,"throw",e)}o(void 0)}))})()},doChangeTab:function(e){this.selectedTab=e,"coupons"===e&&this.loadCoupons(),"rewards"===e&&this.loadRewards(),"wallet-history"===e&&this.loadAccounHistory(),"orders"===e&&this.loadCustomerOrders()},loadAccounHistory:function(){var e=this;this.isLoadingHistory=!0,o.ih.get("/api/nexopos/v4/customers/".concat(this.customer.id,"/account-history")).subscribe({next:function(t){e.walletHistories=t.data,e.isLoadingHistory=!1},error:function(t){e.isLoadingHistory=!1}})},loadCoupons:function(){var e=this;this.isLoadingCoupons=!0,o.ih.get("/api/nexopos/v4/customers/".concat(this.customer.id,"/coupons")).subscribe({next:function(t){e.coupons=t,e.isLoadingCoupons=!1},error:function(t){e.isLoadingCoupons=!1}})},loadRewards:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/api/nexopos/v4/customers/".concat(this.customer.id,"/rewards");this.isLoadingRewards=!0,o.ih.get(t).subscribe({next:function(t){e.rewardsResponse=t,e.isLoadingRewards=!1},error:function(t){e.isLoadingRewards=!1}})},prefillForm:function(e){void 0!==this.$popupParams.name&&(e.main.value=this.$popupParams.name)},openCustomerSelection:function(){this.$popup.close(),a.G.show(l.Z)},loadCustomerOrders:function(){var e=this;this.isLoadingOrders=!0,o.ih.get("/api/nexopos/v4/customers/".concat(this.customer.id,"/orders")).subscribe({next:function(t){e.orders=t,e.isLoadingOrders=!1},error:function(t){e.isLoadingOrders=!1}})},newTransaction:function(e){new Promise((function(t,s){a.G.show(f,{customer:e,resolve:t,reject:s})})).then((function(t){POS.loadCustomer(e.id).subscribe((function(e){POS.selectCustomer(e)}))}))},applyCoupon:function(e){var t=this;void 0===this.order.customer?a.G.show(h.default,{title:(0,u.__)("Use Customer ?"),message:(0,u.__)("No customer is selected. Would you like to proceed with this customer ?"),onAction:function(s){s&&POS.selectCustomer(t.customer).then((function(s){t.proceedApplyingCoupon(e)}))}}):this.order.customer.id===this.customer.id?this.proceedApplyingCoupon(e):this.order.customer.id!==this.customer.id&&a.G.show(h.default,{title:(0,u.__)("Change Customer ?"),message:(0,u.__)("Would you like to assign this customer to the ongoing order ?"),onAction:function(s){s&&POS.selectCustomer(t.customer).then((function(s){t.proceedApplyingCoupon(e)}))}})},proceedApplyingCoupon:function(e){var t=this;new Promise((function(t,s){a.G.show(v.Z,{apply_coupon:e.code,resolve:t,reject:s})})).then((function(e){t.popupResolver(!1)})).catch((function(e){}))},handleSavedCustomer:function(e){o.kX.success(e.message).subscribe(),POS.selectCustomer(e.entry),this.$popup.close()}}};const x=(0,p.Z)(g,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg rounded w-95vw h-95vh lg:w-3/5-screen flex flex-col overflow-hidden",attrs:{id:"ns-pos-customers"}},[s("div",{staticClass:"ns-header p-2 flex justify-between items-center border-b"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Customers")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.$popup.close()}}})],1)]),e._v(" "),s("div",{staticClass:"ns-body flex-auto flex p-2 overflow-y-auto"},[s("ns-tabs",{attrs:{active:e.activeTab},on:{active:function(t){e.activeTab=t}}},[s("ns-tabs-item",{attrs:{identifier:"create-customers",label:"New Customer"}},["yes"===e.options.ns_pos_customers_creation_enabled?s("ns-crud-form",{attrs:{"submit-url":"/api/nexopos/v4/crud/ns.customers",src:"/api/nexopos/v4/crud/ns.customers/form-config"},on:{updated:function(t){return e.prefillForm(t)},save:function(t){return e.handleSavedCustomer(t)}},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(e._s(e.__("Customer Name")))]},proxy:!0},{key:"save",fn:function(){return[e._v(e._s(e.__("Save Customer")))]},proxy:!0}],null,!1,2432171054)}):e._e(),e._v(" "),"yes"!==e.options.ns_pos_customers_creation_enabled?s("div",{staticClass:"h-full flex-col w-full flex items-center justify-center text-primary"},[s("i",{staticClass:"lar la-hand-paper ns-icon text-6xl"}),e._v(" "),s("h3",{staticClass:"font-medium text-2xl"},[e._v(e._s(e.__("Not Authorized")))]),e._v(" "),s("p",[e._v(e._s(e.__("Creating customers has been explicitly disabled from the settings.")))])]):e._e()],1),e._v(" "),s("ns-tabs-item",{staticClass:"flex",staticStyle:{padding:"0!important"},attrs:{identifier:"account-payment",label:e.__("Customer Account")}},[null===e.customer?s("div",{staticClass:"flex-auto w-full flex items-center justify-center flex-col p-4"},[s("i",{staticClass:"lar la-frown text-6xl"}),e._v(" "),s("h3",{staticClass:"font-medium text-2xl"},[e._v(e._s(e.__("No Customer Selected")))]),e._v(" "),s("p",[e._v(e._s(e.__("In order to see a customer account, you need to select one customer.")))]),e._v(" "),s("div",{staticClass:"my-2"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.openCustomerSelection()}}},[e._v(e._s(e.__("Select Customer")))])],1)]):e._e(),e._v(" "),e.customer?s("div",{staticClass:"flex flex-col flex-auto"},[s("div",{staticClass:"flex-auto p-2 flex flex-col"},[s("div",{staticClass:"-mx-4 flex flex-wrap ns-tab-cards"},[s("div",{staticClass:"px-4 mb-4 w-full"},[s("h2",{staticClass:"font-semibold"},[e._v(e._s(e.__("Summary For"))+" : "+e._s(e.customer.name))])]),e._v(" "),s("div",{staticClass:"px-4 mb-4 w-full md:w-1/4"},[s("div",{staticClass:"rounded-lg shadow bg-transparent bg-gradient-to-br from-success-secondary to-green-700 p-2 flex flex-col text-white"},[s("h3",{staticClass:"font-medium text-lg"},[e._v(e._s(e.__("Total Purchases")))]),e._v(" "),s("div",{staticClass:"w-full flex justify-end"},[s("h2",{staticClass:"font-bold"},[e._v(e._s(e._f("currency")(e.customer.purchases_amount)))])])])]),e._v(" "),s("div",{staticClass:"px-4 mb-4 w-full md:w-1/4"},[s("div",{staticClass:"rounded-lg shadow bg-transparent bg-gradient-to-br from-error-secondary to-red-700 p-2 text-white"},[s("h3",{staticClass:"font-medium text-lg"},[e._v(e._s(e.__("Total Owed")))]),e._v(" "),s("div",{staticClass:"w-full flex justify-end"},[s("h2",{staticClass:"text-2xl font-bold"},[e._v(e._s(e._f("currency")(e.customer.owed_amount)))])])])]),e._v(" "),s("div",{staticClass:"px-4 mb-4 w-full md:w-1/4"},[s("div",{staticClass:"rounded-lg shadow bg-transparent bg-gradient-to-br from-blue-500 to-blue-700 p-2 text-white"},[s("h3",{staticClass:"font-medium text-lg"},[e._v(e._s(e.__("Wallet Amount")))]),e._v(" "),s("div",{staticClass:"w-full flex justify-end"},[s("h2",{staticClass:"text-2xl font-bold"},[e._v(e._s(e._f("currency")(e.customer.account_amount)))])])])]),e._v(" "),s("div",{staticClass:"px-4 mb-4 w-full md:w-1/4"},[s("div",{staticClass:"rounded-lg shadow bg-transparent bg-gradient-to-br from-teal-500 to-teal-700 p-2 text-white"},[s("h3",{staticClass:"font-medium text-lg"},[e._v(e._s(e.__("Credit Limit")))]),e._v(" "),s("div",{staticClass:"w-full flex justify-end"},[s("h2",{staticClass:"text-2xl font-bold"},[e._v(e._s(e._f("currency")(e.customer.credit_limit_amount)))])])])])]),e._v(" "),s("div",{staticClass:"flex flex-auto flex-col overflow-hidden"},[s("ns-tabs",{attrs:{active:e.selectedTab},on:{changeTab:function(t){return e.doChangeTab(t)}}},[s("ns-tabs-item",{attrs:{identifier:"orders",label:e.__("Orders")}},[e.isLoadingOrders?s("div",{staticClass:"flex-auto h-full justify-center flex items-center"},[s("ns-spinner",{attrs:{size:"36"}})],1):e._e(),e._v(" "),e.isLoadingOrders?e._e():[s("div",{staticClass:"py-2 w-full"},[s("h2",{staticClass:"font-semibold text-primary"},[e._v(e._s(e.__("Last Purchases")))])]),e._v(" "),s("div",{staticClass:"flex-auto flex-col flex overflow-hidden"},[s("div",{staticClass:"flex-auto overflow-y-auto"},[s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",{staticClass:"text-primary"},[s("th",{staticClass:"p-2 border font-semibold",attrs:{colspan:"3",width:"150"}},[e._v(e._s(e.__("Order")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold",attrs:{width:"50"}},[e._v(e._s(e.__("Options")))])])]),e._v(" "),s("tbody",{staticClass:"text-primary"},[0===e.orders.length?s("tr",[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"4"}},[e._v(e._s(e.__("No orders...")))])]):e._e(),e._v(" "),e._l(e.orders,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"3"}},[s("div",{staticClass:"flex flex-col items-start"},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Code"))+": "+e._s(t.code))]),e._v(" "),s("div",{staticClass:"md:-mx-2 w-full flex flex-col md:flex-row"},[s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/4"},[s("small",[e._v(e._s(e.__("Total"))+": "+e._s(e._f("currency")(t.total)))])]),e._v(" "),s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/4"},[s("small",[e._v(e._s(e.__("Status"))+": "+e._s(t.human_status))])]),e._v(" "),s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/4"},[s("small",[e._v(e._s(e.__("Delivery"))+": "+e._s(t.human_delivery_status))])])])])]),e._v(" "),s("td",{staticClass:"border p-2 text-center"},[s("button",{staticClass:"rounded-full h-8 px-2 flex items-center justify-center border border-gray ns-inset-button success",on:{click:function(s){return e.openOrderOptions(t)}}},[s("i",{staticClass:"las la-wallet"}),e._v(" "),s("span",{staticClass:"ml-1"},[e._v(e._s(e.__("Options")))])])])])}))],2)])])])]],2),e._v(" "),s("ns-tabs-item",{attrs:{identifier:"wallet-history",label:e.__("Wallet History")}},[e.isLoadingHistory?s("div",{staticClass:"flex-auto h-full justify-center flex items-center"},[s("ns-spinner",{attrs:{size:"36"}})],1):e._e(),e._v(" "),e.isLoadingHistory?e._e():[s("div",{staticClass:"py-2 w-full"},[s("h2",{staticClass:"font-semibold text-primary"},[e._v(e._s(e.__("Wallet History")))])]),e._v(" "),s("div",{staticClass:"flex-auto flex-col flex overflow-hidden"},[s("div",{staticClass:"flex-auto overflow-y-auto"},[s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",{staticClass:"text-primary"},[s("th",{staticClass:"p-2 border font-semibold",attrs:{colspan:"3",width:"150"}},[e._v(e._s(e.__("Transaction")))])])]),e._v(" "),s("tbody",{staticClass:"text-primary"},[0===e.walletHistories.length?s("tr",[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"3"}},[e._v(e._s(e.__("No History...")))])]):e._e(),e._v(" "),e._l(e.walletHistories,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"3"}},[s("div",{staticClass:"flex flex-col items-start"},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Transaction"))+": "+e._s(e.getWalletHistoryLabel(t.operation)))]),e._v(" "),s("div",{staticClass:"md:-mx-2 w-full flex flex-col md:flex-row"},[s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/3"},[s("small",[e._v(e._s(e.__("Amount"))+": "+e._s(e._f("currency")(t.amount)))])]),e._v(" "),s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/3"},[s("small",[e._v(e._s(e.__("Date"))+": "+e._s(t.created_at))])])])])])])}))],2)])])])]],2),e._v(" "),s("ns-tabs-item",{attrs:{identifier:"coupons",label:e.__("Coupons")}},[e.isLoadingCoupons?s("div",{staticClass:"flex-auto h-full justify-center flex items-center"},[s("ns-spinner",{attrs:{size:"36"}})],1):e._e(),e._v(" "),e.isLoadingCoupons?e._e():[s("div",{staticClass:"py-2 w-full"},[s("h2",{staticClass:"font-semibold text-primary"},[e._v(e._s(e.__("Coupons")))])]),e._v(" "),s("div",{staticClass:"flex-auto flex-col flex overflow-hidden"},[s("div",{staticClass:"flex-auto overflow-y-auto"},[s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",{staticClass:"text-primary"},[s("th",{staticClass:"p-2 border font-semibold",attrs:{width:"150"}},[e._v(e._s(e.__("Name")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold"},[e._v(e._s(e.__("Type")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold"})])]),e._v(" "),s("tbody",{staticClass:"text-primary text-sm"},[0===e.coupons.length?s("tr",[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"4"}},[e._v(e._s(e.__("No coupons for the selected customer...")))])]):e._e(),e._v(" "),e._l(e.coupons,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"border p-2",attrs:{width:"300"}},[s("h3",[e._v(e._s(t.name))]),e._v(" "),s("div",{},[s("ul",{staticClass:"-mx-2 flex"},[s("li",{staticClass:"text-xs text-primary px-2"},[e._v(e._s(e.__("Usage :"))+" "+e._s(t.usage)+"/"+e._s(t.limit_usage))]),e._v(" "),s("li",{staticClass:"text-xs text-primary px-2"},[e._v(e._s(e.__("Code :"))+" "+e._s(t.code))])])])]),e._v(" "),s("td",{staticClass:"border p-2 text-center"},[e._v(e._s(e.getType(t.coupon.type))+" \n "),"percentage_discount"===t.coupon.type?s("span",[e._v("\n ("+e._s(t.coupon.discount_value)+"%)\n ")]):e._e(),e._v(" "),"flat_discount"===t.coupon.type?s("span",[e._v("\n ("+e._s(e._f("currency")(t.coupon.discount_value))+")\n ")]):e._e()]),e._v(" "),s("td",{staticClass:"border p-2 text-right"},[s("ns-button",{attrs:{type:"info"},on:{click:function(s){return e.applyCoupon(t)}}},[e._v(e._s(e.__("Use Coupon")))])],1)])}))],2)])])])]],2),e._v(" "),s("ns-tabs-item",{attrs:{identifier:"rewards",label:e.__("Rewards")}},[e.isLoadingRewards?s("div",{staticClass:"flex-auto h-full justify-center flex items-center"},[s("ns-spinner",{attrs:{size:"36"}})],1):e._e(),e._v(" "),e.isLoadingRewards?e._e():[s("div",{staticClass:"py-2 w-full"},[s("h2",{staticClass:"font-semibold text-primary"},[e._v(e._s(e.__("Rewards")))])]),e._v(" "),s("div",{staticClass:"flex-auto flex-col flex overflow-hidden"},[s("div",{staticClass:"flex-auto overflow-y-auto"},[s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",{staticClass:"text-primary"},[s("th",{staticClass:"p-2 border font-semibold",attrs:{width:"150"}},[e._v(e._s(e.__("Name")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold"},[e._v(e._s(e.__("Points")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold"},[e._v(e._s(e.__("Target")))])])]),e._v(" "),e.rewardsResponse.data?s("tbody",{staticClass:"text-primary text-sm"},[0===e.rewardsResponse.data.length?s("tr",[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"4"}},[e._v(e._s(e.__("No rewards available the selected customer...")))])]):e._e(),e._v(" "),e._l(e.rewardsResponse.data,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"border p-2",attrs:{width:"300"}},[s("h3",{staticClass:"text-center"},[e._v(e._s(t.reward_name))])]),e._v(" "),s("td",{staticClass:"border p-2",attrs:{width:"300"}},[s("h3",{staticClass:"text-center"},[e._v(e._s(t.points))])]),e._v(" "),s("td",{staticClass:"border p-2",attrs:{width:"300"}},[s("h3",{staticClass:"text-center"},[e._v(e._s(t.target))])])])}))],2):e._e()])])]),e._v(" "),s("div",{staticClass:"py-1 flex justify-end"},[s("ns-paginate",{attrs:{pagination:e.rewardsResponse},on:{load:function(t){return e.loadRewards(t)}}})],1)]],2)],1)],1)]),e._v(" "),s("div",{staticClass:"p-2 border-t border-box-edge flex justify-between"},[s("div"),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.newTransaction(e.customer)}}},[e._v(e._s(e.__("Account Transaction")))])],1)])]):e._e()])],1)],1)])}),[],!1,null,null,null).exports},7146:(e,t,s)=>{"use strict";s.d(t,{Z:()=>d});var n=s(7266),r=s(9671),i=s(7389);function o(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function a(e){for(var t=1;t0){var e=nsRawCurrency(this.order.instalments.map((function(e){return parseFloat(e.amount.value)||0})).reduce((function(e,t){return parseFloat(e)+parseFloat(t)})));this.totalPayments=this.order.total-e}else this.totalPayments=0},removeInstalment:function(e){var t=this.order.instalments.indexOf(e);this.order.instalments.splice(t,1),this.$forceUpdate()},generatePaymentFields:function(e){var t=this;this.order.instalments=new Array(parseInt(e)).fill("").map((function(e,s){return{date:{type:"date",name:"date",label:"Date",value:0===s?ns.date.moment.format("YYYY-MM-DD"):""},amount:{type:"number",name:"amount",label:"Amount",value:0===s?t.expectedPayment:0},readonly:{type:"hidden",name:"readonly",value:t.expectedPayment>0&&0===s}}})),this.$forceUpdate(),this.refreshTotalPayments()},close:function(){this.$popupParams.reject({status:"failed",message:(0,i.__)("You must define layaway settings before proceeding.")}),this.$popup.close()},skipInstalments:function(){this.expectedPayment>0?(this.order.instalments=[{amount:this.expectedPayment,date:ns.date.current}],this.order.final_payment_date=this.order.instalments.reverse()[0].date,this.order.total_instalments=this.order.instalments.length,this.order.support_instalments=!1):(this.order.final_payment_date=ns.date.current,this.order.total_instalments=0,this.order.support_instalments=!1),this.$popup.close(),POS.order.next(this.order);var e=this.$popupParams,t=e.resolve;e.reject;return t({order:this.order,skip_layaway:!0})},updateOrder:function(){var e=this;if(0===this.order.instalments.length)return r.kX.error((0,i.__)("Please provide instalments before proceeding.")).subscribe();if(this.fields.forEach((function(t){return e.formValidation.validateField(t)})),!this.formValidation.fieldsValid(this.fields))return r.kX.error((0,i.__)("Unable to procee the form is not valid")).subscribe();this.$forceUpdate();var t=this.order.instalments.map((function(e){return{amount:parseFloat(e.amount.value),date:e.date.value}})),s=nsRawCurrency(t.map((function(e){return e.amount})).reduce((function(e,t){return parseFloat(e)+parseFloat(t)})));if(t.filter((function(e){return void 0===e.date||""===e.date})).length>0)return r.kX.error((0,i.__)("One or more instalments has an invalid date.")).subscribe();if(t.filter((function(e){return!(e.amount>0)})).length>0)return r.kX.error((0,i.__)("One or more instalments has an invalid amount.")).subscribe();if(t.filter((function(e){return moment(e.date).isBefore(ns.date.moment.startOf("day"))})).length>0)return r.kX.error((0,i.__)("One or more instalments has a date prior to the current date.")).subscribe();var n=t.filter((function(e){return moment(e.date).isSame(ns.date.moment.startOf("day"),"day")})),o=0;if(n.forEach((function(e){o+=parseFloat(e.amount)})),o{"use strict";s.r(t),s.d(t,{default:()=>r});const n={name:"ns-pos-loading-popup"};const r=(0,s(1900).Z)(n,(function(){var e=this.$createElement;return(this._self._c||e)("ns-spinner")}),[],!1,null,null,null).exports},664:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var n=s(7757),r=s.n(n),i=s(6386),o=s(7389),a=s(8603);function l(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}const c={data:function(){return{types:[],typeSubscription:null}},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&e.resolveIfQueued(!1)})),this.typeSubscription=POS.types.subscribe((function(t){e.types=t,1===Object.values(e.types).length&&e.select(Object.keys(e.types)[0])})),this.popupCloser()},destroyed:function(){this.typeSubscription.unsubscribe()},methods:{__:o.__,popupCloser:a.Z,popupResolver:i.Z,resolveIfQueued:i.Z,select:function(e){var t,s=this;return(t=r().mark((function t(){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Object.values(s.types).forEach((function(e){return e.selected=!1})),s.types[e].selected=!0,n=s.types[e],t.prev=3,t.next=6,POS.triggerOrderTypeSelection(n);case 6:t.sent,POS.types.next(s.types),s.resolveIfQueued(n),t.next=13;break;case 11:t.prev=11,t.t0=t.catch(3);case 13:case"end":return t.stop()}}),t,null,[[3,11]])})),function(){var e=this,s=arguments;return new Promise((function(n,r){var i=t.apply(e,s);function o(e){l(i,n,r,o,a,"next",e)}function a(e){l(i,n,r,o,a,"throw",e)}o(void 0)}))})()}}};const u=(0,s(1900).Z)(c,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-full w-4/5-screen md:w-2/5-screen lg:w-2/5-screen xl:w-2/6-screen shadow-lg",attrs:{id:"ns-order-type"}},[s("div",{staticClass:"h-16 flex justify-center items-center",attrs:{id:"header"}},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Define The Order Type")))])]),e._v(" "),0===Object.values(e.types).length?s("div",{staticClass:"ns-box-body grid grid-flow-row grid-cols-1 grid-rows-1"},[s("div",{staticClass:"h-full w-full flex items-center justify-center flex-col"},[s("i",{staticClass:"las la-frown text-7xl"}),e._v(" "),s("div",{staticClass:"p-4 md:w-2/3"},[s("p",{staticClass:"text-center "},[e._v(e._s(e.__("No payment type has been selected on the settings. Please check your POS features and choose the supported order type")))]),e._v(" "),s("div",{staticClass:"flex justify-center py-1"},[s("ns-link",{attrs:{target:"_blank",type:"info",href:"https://my.nexopos.com/en/documentation/components/order-types"}},[e._v(e._s(e.__("Read More")))])],1)])])]):e._e(),e._v(" "),Object.values(e.types).length>0?s("div",{staticClass:"ns-box-body grid grid-flow-row grid-cols-2 grid-rows-2"},e._l(e.types,(function(t){return s("div",{key:t.identifier,staticClass:"ns-numpad-key info h-56 flex items-center justify-center flex-col cursor-pointer border",class:t.selected?"active":"",on:{click:function(s){return e.select(t.identifier)}}},[s("img",{staticClass:"w-32 h-32",attrs:{src:t.icon,alt:""}}),e._v(" "),s("h4",{staticClass:"font-semibold text-xl my-2"},[e._v(e._s(t.label))])])})),0):e._e()])}),[],!1,null,null,null).exports},4492:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var n=s(9671),r=s(7389),i=s(8603),o=s(4864),a=s(3220);const l={components:{nsNumpad:o.Z,nsNumpadPlus:a.Z},data:function(){return{finalValue:1,virtualStock:null,options:{},optionsSubscription:null,allSelected:!0,isLoading:!1}},beforeDestroy:function(){this.optionsSubscription.unsubscribe()},mounted:function(){var e=this;this.optionsSubscription=POS.options.subscribe((function(t){e.options=t})),this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams.reject(!1),e.$popup.close())})),this.$popupParams.product.quantity&&(this.finalValue=this.$popupParams.product.quantity),this.popupCloser()},destroyed:function(){nsHotPress.destroy("pos-quantity-numpad"),nsHotPress.destroy("pos-quantity-backspace"),nsHotPress.destroy("pos-quantity-enter")},methods:{__:r.__,popupCloser:i.Z,closePopup:function(){this.$popupParams.reject(!1),this.$popup.close()},updateQuantity:function(e){this.finalValue=e},defineQuantity:function(e){var t=this.$popupParams,s=t.product,i=t.data;if(0===e)return n.kX.error((0,r.__)("Please provide a quantity")).subscribe();if("enabled"===s.$original().stock_management&&"materialized"===s.$original().type){var o=POS.getStockUsage(s.$original().id,i.unit_quantity_id)-(s.quantity||0);if(e>parseFloat(i.$quantities().quantity)-o)return n.kX.error((0,r.__)("Unable to add the product, there is not enough stock. Remaining %s").replace("%s",i.$quantities().quantity-o)).subscribe()}this.resolve({quantity:e})},resolve:function(e){this.$popupParams.resolve(e),this.$popup.close()}}};const c=(0,s(1900).Z)(l,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow min-h-2/5-screen w-3/4-screen md:w-3/5-screen lg:w-2/5-screen xl:w-2/5-screen relative"},[e.isLoading?s("div",{staticClass:"flex w-full h-full absolute top-O left-0 items-center justify-center",staticStyle:{background:"rgb(202 202 202 / 49%)"},attrs:{id:"loading-overlay"}},[s("ns-spinner")],1):e._e(),e._v(" "),s("div",{staticClass:"flex-shrink-0 flex justify-between items-center p-2 border-b ns-box-header"},[s("div",[s("h1",{staticClass:"text-xl font-bold text-primary text-center"},[e._v(e._s(e.__("Define Quantity")))])]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"h-24 border-b primary ns-box-body flex items-center justify-center",attrs:{id:"screen"}},[s("h1",{staticClass:"font-bold text-3xl"},[e._v(e._s(e.finalValue))])]),e._v(" "),"default"===e.options.ns_pos_numpad?s("ns-numpad",{attrs:{floating:e.options.ns_pos_allow_decimal_quantities,value:e.finalValue},on:{changed:function(t){return e.updateQuantity(t)},next:function(t){return e.defineQuantity(t)}}}):e._e(),e._v(" "),"advanced"===e.options.ns_pos_numpad?s("ns-numpad-plus",{attrs:{value:e.finalValue},on:{changed:function(t){return e.updateQuantity(t)},next:function(t){return e.defineQuantity(t)}}}):e._e()],1)}),[],!1,null,null,null).exports},9702:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var n=s(9671),r=s(6386),i=s(7266);function o(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function a(e){for(var t=1;t{"use strict";s.r(t),s.d(t,{default:()=>r});const n={data:function(){return{title:"",message:"",input:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){var e=this;this.input=this.$popupParams.input||"",this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams.reject(!1),e.$popup.close())}))},methods:{__:s(7389).__,emitAction:function(e){this.$popupParams.onAction(e?this.input:e),this.$popup.close()},reject:function(e){void 0!==this.$popupParams.reject&&this.$popupParams.reject(e),this.$popup.close()}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-5/7-screen md:w-3/7-screen flex flex-col shadow-lg",class:e.size,attrs:{id:"prompt-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-2"},[s("h2",{staticClass:"text-3xl font-body"},[e._v(e._s(e.title))]),e._v(" "),s("p",{staticClass:"w-full md:mx-auto md:w-2/3 py-4 text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"p-2"},[s("div",{staticClass:"ns-input"},[s("textarea",{directives:[{name:"model",rawName:"v-model",value:e.input,expression:"input"}],staticClass:"w-full border-2 p-2",attrs:{name:"",id:"",cols:"30",rows:"10"},domProps:{value:e.input},on:{input:function(t){t.target.composing||(e.input=t.target.value)}}})])]),e._v(" "),s("div",{staticClass:"flex border-t action-buttons"},[s("button",{staticClass:"flex-auto w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Ok")))]),e._v(" "),s("hr",{staticClass:"border-r"}),e._v(" "),s("button",{staticClass:"flex-auto w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.reject(!1)}}},[e._v(e._s(e.__("Cancel")))])])])}),[],!1,null,null,null).exports},3296:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(8603),r=s(7389);const i={data:function(){return{value:[],options:[],description:"",label:null,type:"select"}},computed:{},mounted:function(){this.popupCloser(),this.value=this.$popupParams.value||[],this.options=this.$popupParams.options,this.label=this.$popupParams.label,this.description=this.$popupParams.description||"",this.type=this.$popupParams.type||this.type},methods:{popupCloser:n.Z,__:r.__,toggle:function(e){var t=this.value.indexOf(e);-1===t?this.value.unshift(e):this.value.splice(t,1)},isSelected:function(e){return this.value.indexOf(e)>=0},close:function(){this.$popupParams.reject(!1),this.$popup.close()},select:function(e){void 0!==e&&(this.value=[e]),this.$popupParams.resolve(this.value),this.close()}}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-xl ns-box w-6/7-screen md:w-4/7-screen lg:w-3/7-screen max-h-5/6-screen overflow-hidden flex flex-col"},[s("div",{staticClass:"p-2 flex justify-between border-b items-center ns-box-header"},[s("span",{staticClass:"text-semibold text-primary"},[e._v("\n "+e._s(e.label)+"\n ")]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex flex-col overflow-hidden"},[e.description.length>0?s("p",{staticClass:"p-2 text-center text-sm bg-info-primary"},[e._v(e._s(e.description))]):e._e(),e._v(" "),s("div",{staticClass:"overflow-y-auto"},[s("ul",{staticClass:"ns-vertical-menu"},["select"===e.type?e._l(e.options,(function(t){return s("li",{key:t.value,staticClass:"p-2 border-b border-box-edge text-primary cursor-pointer",on:{click:function(s){return e.select(t)}}},[e._v(e._s(t.label))])})):e._e(),e._v(" "),"multiselect"===e.type?e._l(e.options,(function(t){return s("li",{key:t.value,staticClass:"p-2 border-b text-primary cursor-pointer",class:e.isSelected(t)?"active":"",on:{click:function(s){return e.toggle(t)}}},[e._v(e._s(t.label))])})):e._e()],2)])]),e._v(" "),"multiselect"===e.type?s("div",{staticClass:"flex justify-between"},[s("div"),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.select()}}},[e._v(e._s(e.__("Select")))])],1)]):e._e()])}),[],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=6086,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[443,198,89,110,4],{9671:(e,t,s)=>{"use strict";s.d(t,{l:()=>R,kq:()=>X,ih:()=>L,kX:()=>I});var n=s(6486),r=s(9669),i=s(6300),o=s(8345),a=s(9624),l=s(9248),c=s(230);function u(e,t){for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,s)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,s)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var s=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=X.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:n}),new c.y((function(i){s._client[e](t,n,Object.assign(Object.assign({},s._client.defaults[e]),r)).then((function(e){s._lastRequestData=e,i.next(e.data),i.complete(),s._subject.next({identifier:"async.stop"})})).catch((function(e){var t;i.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),s._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,s=e.value;this._subject.next({identifier:t,value:s})}}],s&&u(t.prototype,s),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),p=s(3);function f(e,t){for(var s=0;s=1e3){for(var s,n=Math.floor((""+e).length/3),r=2;r>=1;r--){if(((s=parseFloat((0!=n?e/Math.pow(1e3,n):e).toPrecision(r)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}s%1!=0&&(s=s.toFixed(1)),t=s+["","k","m","b","t"][n]}return t})),O=s(1356),S=s(9698);function $(e,t){for(var s=0;s0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&q(t.prototype,s),n&&q(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()),U=new _({sidebar:["xs","sm","md"].includes(Y.breakpoint)?"hidden":"visible"});L.defineClient(r),window.nsEvent=R,window.nsHttpClient=L,window.nsSnackBar=I,window.nsCurrency=O.W,window.nsTruncate=S.b,window.nsRawCurrency=O.f,window.nsAbbreviate=j,window.nsState=U,window.nsUrl=H,window.nsScreen=Y,window.ChartJS=i,window.EventEmitter=v,window.Popup=x.G,window.RxJS=y,window.FormValidation=C.Z,window.nsCrudHandler=M},7975:(e,t,s)=>{"use strict";s.r(t),s.d(t,{nsAvatar:()=>G,nsButton:()=>a,nsCheckbox:()=>f,nsCkeditor:()=>E,nsCloseButton:()=>P,nsCrud:()=>N,nsCrudForm:()=>b,nsDate:()=>w,nsDateRangePicker:()=>K.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>g.P,nsIconButton:()=>j,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>k,nsMenu:()=>i,nsMultiselect:()=>x,nsNotice:()=>J.Z,nsNumpad:()=>z.Z,nsPaginate:()=>te.Z,nsSearch:()=>ne,nsSelect:()=>d,nsSelectAudio:()=>p,nsSpinner:()=>m,nsSubmenu:()=>o,nsSwitch:()=>F.Z,nsTableRow:()=>h,nsTabs:()=>D,nsTabsItem:()=>V,nsTextarea:()=>y});var n=s(538),r=s(9671),i=n.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,r.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&r.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,s){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),o=n.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),a=n.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=n.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=n.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),u=s(7389),d=n.default.component("ns-select",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},mounted:function(){},methods:{__:u.__},template:'\n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),p=n.default.component("ns-select-audio",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__:u.__,playSelectedSound:function(){this.field.value.length>0&&new Audio(this.field.value).play()}},template:'\n
    \n \n
    \n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),f=n.default.component("ns-checkbox",{data:function(){return{}},props:["checked","field","label"],template:'\n
    \n
    \n \n
    \n {{ label }}\n {{ field.label }}\n
    \n ',computed:{isChecked:function(){return this.field?this.field.value:this.checked}},methods:{toggleIt:function(){void 0!==this.field&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}}),v=s(2242),h=n.default.component("ns-table-row",{props:["options","row","columns","prependOptions","showOptions"],data:function(){return{optionsToggled:!1}},mounted:function(){},methods:{__:u.__,sanitizeHTML:function(e){var t=document.createElement("div");t.innerHTML=e;for(var s=t.getElementsByTagName("script"),n=s.length;n--;)s[n].parentNode.removeChild(s[n]);return t.innerHTML},getElementOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu:function(e){var t=this;if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout((function(){var e=t.$el.querySelectorAll(".relative > .absolute")[0],s=t.$el.querySelectorAll(".relative")[0],n=t.getElementOffset(s);e.style.top=n.top+"px",e.style.left=n.left+"px",s.classList.remove("relative"),s.classList.add("dropdown-holder")}),100);else{var s=this.$el.querySelectorAll(".dropdown-holder")[0];s.classList.remove("dropdown-holder"),s.classList.add("relative")}},handleChanged:function(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync:function(e){var t=this;e.confirm?confirm(e.confirm.message)&&r.ih[e.type.toLowerCase()](e.url).subscribe((function(e){r.kX.success(e.message).subscribe(),t.$emit("reload",t.row)}),(function(e){t.toggleMenu(),r.kX.error(e.message).subscribe()})):(r.l.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup:function(e,t){var s=window.nsExtraComponents[e.component];if(e.component)return s?new Promise((function(n,r){v.G.show(s,{resolve:n,reject:r,row:t,action:e})})):r.kX.error((0,u.__)('Unable to load the component "'.concat(e.component,'". Make sure the component is registered to "nsExtraComponents".'))).subscribe();this.triggerAsync(e)}},template:'\n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n '}),m=n.default.component("ns-spinner",{data:function(){return{}},mounted:function(){},computed:{validatedSize:function(){return this.size||24},validatedBorder:function(){return this.border||8},validatedAnimation:function(){return this.animation||"fast"}},props:["color","size","border"],template:"\n
    \n
    \n
    \n "}),_=s(7266),b=n.default.component("ns-crud-form",{data:function(){return{form:{},globallyChecked:!1,formValidation:new _.Z,rows:[]}},mounted:function(){this.loadForm()},props:["src","create-url","field-class","return-url","submit-url","submit-method","disable-tabs"],computed:{activeTabFields:function(){for(var e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]}},methods:{__:u.__,toggle:function(e){for(var t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},handleShowOptions:function(e){this.rows.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},submit:function(){var e=this;return this.formValidation.validateForm(this.form).length>0?r.kX.error(this.$slots["error-invalid"]?this.$slots["error-invalid"][0].text:"No error message provided for having an invalid form.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():(this.formValidation.disableForm(this.form),void 0===this.submitUrl?r.kX.error(this.$slots["error-no-submit-url"]?this.$slots["error-no-submit-url"][0].text:"No error message provided for not having a valid submit url.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():void r.ih[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,this.formValidation.extractForm(this.form)).subscribe((function(t){if("success"===t.status){if(e.submitMethod&&"post"===e.submitMethod.toLowerCase()&&!1!==e.returnUrl)return document.location=t.data.editUrl||e.returnUrl;r.kX.info(t.message,(0,u.__)("Okay"),{duration:3e3}).subscribe(),e.$emit("save",t)}e.formValidation.enableForm(e.form)}),(function(t){r.kX.error(t.message,void 0,{duration:5e3}).subscribe(),void 0!==t.data&&e.formValidation.triggerError(e.form,t.data),e.formValidation.enableForm(e.form)})))},handleGlobalChange:function(e){this.globallyChecked=e,this.rows.forEach((function(t){return t.$checked=e}))},loadForm:function(){var e=this;r.ih.get("".concat(this.src)).subscribe({next:function(t){e.form=e.parseForm(t.form),r.kq.doAction("ns-crud-form-loaded",e),e.$emit("updated",e.form)},error:function(e){r.kX.error(e.message,"OKAY",{duration:0}).subscribe()}})},parseForm:function(e){e.main.value=void 0===e.main.value?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];var t=0;for(var s in e.tabs)0===t&&(e.tabs[s].active=!0),e.tabs[s].active=void 0!==e.tabs[s].active&&e.tabs[s].active,e.tabs[s].fields=this.formValidation.createFields(e.tabs[s].fields),t++;return e}},template:'\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n
    {{ tab.label }}
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n '}),y=n.default.component("ns-textarea",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),g=s(8737),x=n.default.component("ns-multiselect",{data:function(){return{showPanel:!1,search:""}},props:["field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=void 0!==t.selected&&t.selected,e.field.value&&e.field.value.includes(t.value)&&(t.selected=!0),t}))}},methods:{__:u.__,addOption:function(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout((function(){}),100))},removeOption:function(e,t){var s=this;if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout((function(){s.search=""}),100),!1}},mounted:function(){var e=this;this.field.value&&this.field.value.reverse().forEach((function(t){var s=e.field.options.filter((function(e){return e.value===t}));s.length>=0&&e.addOption(s[0])}))},template:'\n
    \n \n
    \n
    \n
    \n
    \n
    \n {{ option.label }}\n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n
    \n '}),w=n.default.component("ns-date",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),C=s(4255),k=n.default.component("ns-media-input",{template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n ',computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},data:function(){return{}},props:["placeholder","leading","type","field"],mounted:function(){},methods:{toggleMedia:function(){var e=this;new Promise((function(t,s){v.G.show(C.default,Object.assign({resolve:t,reject:s},e.field.data||{}))})).then((function(t){"use-selected"===t.event&&(e.field.data&&"url"!==e.field.data.type?e.field.data&&"model"!==e.field.data.type||(e.field.value=t.value[0]):e.field.value=t.value[0].sizes.original,e.$forceUpdate())}))}}}),P=n.default.component("ns-close-button",{template:'\n \n ',methods:{clicked:function(e){this.$emit("click",e)}}}),j=n.default.component("ns-icon-button",{template:'\n \n ',props:["className","buttonClass","type"],methods:{clicked:function(e){this.$emit("click",e)}}}),O=s(1272),S=s.n(O),$=s(5234),T=s.n($),E=n.default.component("ns-ckeditor",{data:function(){return{editor:T()}},components:{ckeditor:S().component},mounted:function(){},methods:{__:u.__},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),D=n.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),V=n.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),F=s(9408),A=s(2744),q=s(7757),Z=s.n(q),R=s(3601),L=s(8603),I=s(6386);const H={data:function(){return{fields:[],validation:new _.Z}},methods:{__:u.__,popupCloser:L.Z,popupResolver:I.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var M=s(1900);const X=(0,M.Z)(H,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[s("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[s("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[s("div",[s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var Y=function(e,t,s,n){return new(s||(s=Promise))((function(r,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))};const U={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,u.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:u.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var s=[];t-3>1&&s.push(1,"...");for(var n=1;n<=e;n++)t+3>n&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),r.kX.success((0,u.__)("The document has been generated.")).subscribe()}),(function(e){r.kX.error(e.message||(0,u.__)("Unexpected error occured.")).subscribe()}))},clearSelectedEntries:function(){var e=this;v.G.show(R.default,{title:(0,u.__)("Clear Selected Entries ?"),message:(0,u.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var s=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(s,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(s){s.$checked=e,t.refreshRow(s)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){r.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,u.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){r.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){r.kX.error(e.message).subscribe()}}):void 0:r.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,u.__)("No selection has been made.")).subscribe():r.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,u.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return Y(this,void 0,void 0,Z().mark((function e(){var t,s=this;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(X),e.next=4,new Promise((function(e,t){v.G.show(X,{resolve:e,reject:t,queryFilters:s.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,r.kX.error(t.message).subscribe()}))}}};const N=(0,M.Z)(U,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?s("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[s("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?s("div",{staticClass:"px-2 flex items-center justify-center"},[s("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[s("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),s("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[s("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?s("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[s("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2 flex items-center justify-center"},[s("button",{staticClass:"rounded-full\n text-sm\n h-10\n px-3\n outline-none\n border\n ns-crud-button\n ",on:{click:function(t){return e.refresh()}}},[s("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?s("div",{staticClass:"px-2 flex items-center"},[s("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none ",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():s("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?s("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():s("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?s("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),s("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?s("div",{staticClass:"px-1 flex items-center"},[s("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[s("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),s("div",{staticClass:"px-1 flex items-center"},[s("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[s("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),s("div",{staticClass:"flex"},[s("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",[s("th",{staticClass:"text-center px-2 border w-16 py-2"},[s("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?s("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,n){return s("th",{key:n,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(n)}}},[s("div",{staticClass:"w-full flex justify-between items-center"},[s("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),s("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?s("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?s("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?s("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),s("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,n){return s("ns-table-row",{key:n,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():s("tr",[s("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?s("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?s:s[0]}}},[s("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,n){return s("option",{key:n,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),s("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),s("div",{staticClass:"flex"},[s("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),s("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[s("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,n){return["..."!==e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(s){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[s("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var z=s(4864),Q=s(1726),W=s(7259);const B=n.default.extend({methods:{__:u.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,Q.createAvatar)(W,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const G=(0,M.Z)(B,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[s("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),s("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?s("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?s("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var K=s(4806),J=s(1828),ee=s(1544),te=s(3506);const se={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:u.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,s,n;e.searchText.length>0&&r.ih[e.method||"post"](e.url,(t={},s=e.searchArgument||"search",n=e.searchText,s in t?Object.defineProperty(t,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[s]=n,t)).subscribe({next:function(t){e.results=t},error:function(e){r.kX.error(e.message||(0,u.__)("An unexpected error occured.")).subscribe()}})}),1e3)}},mounted:function(){}};const ne=(0,M.Z)(se,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-search"},[s("div",{staticClass:"input-group info border-2"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),s("div",{staticClass:"relative"},[s("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?s("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,n){return s("li",{key:n,staticClass:"border-b p-2 cursor-pointer",on:{click:function(s){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},8737:(e,t,s)=>{"use strict";s.d(t,{P:()=>a});var n=s(538),r=s(4806),i=s(2744),o=s(9408),a=n.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:r.Z,nsDateTimePicker:i.Z,nsSwitch:o.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\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 '})},1356:(e,t,s)=>{"use strict";s.d(t,{W:()=>c,f:()=>u});var n=s(2077),r=s.n(n),i=s(538),o=s(6740),a=s.n(o),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=i.default.filter("currency",(function(e){var t,s,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===n){var i={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};s=a()(e,i).format()}else s=r()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(s).concat("after"===ns.currency.ns_currency_position?t:"")})),u=function(e){var t="0.".concat(l);return parseFloat(r()(e).format(t))}},9698:(e,t,s)=>{"use strict";s.d(t,{b:()=>n});var n=s(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,s)=>{"use strict";function n(e,t){for(var s=0;sr});var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,s,r;return t=e,s=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var s in e.tabs)if(e.tabs[s].fields){var n=[],r=this.validateFieldsErrors(e.tabs[s].fields);r.length>0&&n.push(r),e.tabs[s].errors=n.flat(),t.push(n.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var s in e)0===t&&(e[s].active=!0),e[s].active=void 0!==e[s].active&&e[s].active,e[s].fields=this.createFields(e[s].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var s=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(s,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(s){t.fieldPassCheck(e,s)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var s in e.tabs)void 0===t[s]&&(t[s]={}),t[s]=this.extractFields(e.tabs[s].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var s=function(s){var n=s.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===n.length&&e.tabs[n[0]].fields.forEach((function(e){e.name===n[1]&&t.errors[s].forEach((function(t){var s={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(s)}))})),s===e.main.name&&t.errors[s].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var n in t.errors)s(n)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var s=function(s){e.forEach((function(e){e.name===s&&t.errors[s].forEach((function(t){var s={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(s)}))}))};for(var n in t.errors)s(n)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(s,n){s.identifier===t.identifier&&!0===s.invalid&&e.errors.splice(n,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(s,n){!0===s[t.identifier]&&e.errors.splice(n,1)}))}return e}}],s&&n(t.prototype,s),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,s)=>{"use strict";s.d(t,{__:()=>n,c:()=>r});var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},r=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},8603:(e,t,s)=>{"use strict";function n(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var s=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(s+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}s.d(t,{Z:()=>n})},6386:(e,t,s)=>{"use strict";function n(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}s.d(t,{Z:()=>n})},2242:(e,t,s)=>{"use strict";s.d(t,{G:()=>c});var n=s(7757),r=s.n(n),i=s(9248);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var s=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[s-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new i.x}var t,s,n;return t=e,s=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s=0;s<10;s++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,s,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,r().mark((function o(){var a,l,c,u=this;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("function"!=typeof e){r.next=9;break}return r.prev=1,r.next=4,e();case 4:e=r.sent.default,r.next=9;break;case 7:r.prev=7,r.t0=r.catch(1);case 9:a=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",a.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){u.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=i,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return r.stop()}}),o,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var s="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(s),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],n=[{key:"show",value:function(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=new e(n);return r.open(t,s),r}}],s&&a(t.prototype,s),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1703:(e,t,s)=>{"use strict";function n(e,t){for(var s=0;sr});var r=function(){function e(t){var s=t.settings,n=t.options,r=t.type;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.printingURL={refund:"refund_printing_url",sale:"sale_printing_url",payment:"payment_printing_url"},this.settings=s,this.options=n,this.type=r||"refund"}var t,s,r;return t=e,(s=[{key:"processRegularPrinting",value:function(e){var t=document.querySelector("printing-section");t&&t.remove();var s=this.settings[this.printingURL[this.type]].replace("{reference_id}",e),n=document.createElement("iframe");n.id="printing-section",n.className="hidden",n.src=s,document.body.appendChild(n),setTimeout((function(){document.querySelector("#printing-section").remove()}),5e3)}},{key:"printOrder",value:function(e){"default"===this.options.ns_pos_printing_gateway?this.processRegularPrinting(e):this.processCustomPrinting(e,this.options.ns_pos_printing_gateway)}},{key:"processCustomPrinting",value:function(e,t){nsHooks.applyFilters("ns-order-custom-refund-print",{printed:!1,reference_id:e,gateway:t}).printed||nsSnackBar.error(__("Unsupported print gateway.")).subscribe()}}])&&n(t.prototype,s),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,s)=>{"use strict";s.d(t,{S:()=>i});var n=s(3260);function r(e,t){for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return n.Observable.create((function(n){var i=s.__createSnack({message:e,label:t,type:r.type}),o=i.buttonNode,a=(i.textNode,i.snackWrapper,i.sampleSnack);o.addEventListener("click",(function(e){n.onNext(o),n.onCompleted(),a.remove()})),s.__startTimer(r.duration,a)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},s),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var s,n=function(){e>0&&!1!==e&&(s=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(s)})),t.addEventListener("mouseleave",(function(){n()})),n()}},{key:"__createSnack",value:function(e){var t=e.message,s=e.label,n=e.type,r=void 0===n?"info":n,i=document.getElementById("snack-wrapper")||document.createElement("div"),o=document.createElement("div"),a=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),u="",d="";switch(r){case"info":u="",d="info";break;case"error":u="",d="error";break;case"success":u="",d="success"}return a.textContent=t,a.setAttribute("class","pr-2"),s&&(l.setAttribute("class","ns-button default"),c.textContent=s,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(u)),l.appendChild(c)),o.appendChild(a),o.appendChild(l),o.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(d)),i.appendChild(o),null===document.getElementById("snack-wrapper")&&(i.setAttribute("id","snack-wrapper"),i.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(i)),{snackWrapper:i,sampleSnack:o,buttonsWrapper:l,buttonNode:c,textNode:a}}}],s&&r(t.prototype,s),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},279:(e,t,s)=>{"use strict";s.d(t,{$:()=>l});var n=s(9671),r=s(7389),i=s(2242),o=s(4492);function a(e,t){for(var s=0;sparseFloat(e.$quantities().quantity)-u)return n.kX.error((0,r.__)("Unable to add the product, there is not enough stock. Remaining %s").replace("%s",(e.$quantities().quantity-u).toString())).subscribe()}s({quantity:1})}else l.open(o.Z,{resolve:s,reject:a,product:c,data:e})}))}}])&&a(t.prototype,s),l&&a(t,l),Object.defineProperty(t,"prototype",{writable:!1}),e}()},6086:(e,t,s)=>{"use strict";var n=s(7757),r=s.n(n),i=s(279),o=s(2242),a=s(9671),l=s(7389);const c={data:function(){return{unitsQuantities:[],loadsUnits:!1,options:null,optionsSubscriber:null}},beforeDestroy:function(){this.optionsSubscriber.unsubscribe()},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams.reject(!1),e.$popup.close())})),this.optionsSubscriber=POS.options.subscribe((function(t){e.options=t})),void 0!==this.$popupParams.product.$original().selectedUnitQuantity?this.selectUnit(this.$popupParams.product.$original().selectedUnitQuantity):void 0!==this.$popupParams.product.$original().unit_quantities&&1===this.$popupParams.product.$original().unit_quantities.length?this.selectUnit(this.$popupParams.product.$original().unit_quantities[0]):(this.loadsUnits=!0,this.loadUnits())},methods:{__:l.__,displayRightPrice:function(e){return POS.getSalePrice(e,this.$popupParams.product.$original())},loadUnits:function(){var e=this;a.ih.get("/api/nexopos/v4/products/".concat(this.$popupParams.product.$original().id,"/units/quantities")).subscribe((function(t){if(0===t.length)return e.$popup.close(),a.kX.error((0,l.__)("This product doesn't have any unit defined for selling.")).subscribe();e.unitsQuantities=t,1===e.unitsQuantities.length&&e.selectUnit(e.unitsQuantities[0])}))},selectUnit:function(e){if(null===e.unit)return a.kX.error((0,l.__)('The unit attached to this product is missing or not assigned. Please review the "Unit" tab for this product.')).subscribe(),this.$popup.close();this.$popupParams.resolve({unit_quantity_id:e.id,unit_name:e.unit.name,$quantities:function(){return e}}),this.$popup.close()}}};const u=(0,s(1900).Z)(c,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-full w-full flex items-center justify-center",attrs:{id:"ns-units-selector"}},[e.unitsQuantities.length>0?s("div",{staticClass:"ns-box w-2/3-screen lg:w-1/3-screen overflow-hidden flex flex-col"},[s("div",{staticClass:"h-16 flex justify-center items-center flex-shrink-0",attrs:{id:"header"}},[s("h3",{staticClass:"font-bold text-primary"},[e._v(e._s(e.__("Choose Selling Unit")))])]),e._v(" "),e.unitsQuantities.length>0?s("div",{staticClass:"grid grid-flow-row grid-cols-2 overflow-y-auto"},e._l(e.unitsQuantities,(function(t){return s("div",{key:t.id,staticClass:"ns-numpad-key info cursor-pointer border flex-shrink-0 flex flex-col items-center justify-center",on:{click:function(s){return e.selectUnit(t)}}},[s("div",{staticClass:"h-40 w-full flex items-center justify-center overflow-hidden"},[t.preview_url?s("img",{staticClass:"object-cover h-full",attrs:{src:t.preview_url,alt:t.unit.name}}):e._e(),e._v(" "),t.preview_url?e._e():s("div",{staticClass:"h-40 flex items-center justify-center"},[s("i",{staticClass:"las la-image text-primary text-6xl"})])]),e._v(" "),s("div",{staticClass:"h-0 w-full"},[s("div",{staticClass:"relative w-full flex items-center justify-center -top-10 h-20 py-2 flex-col overlay"},[s("h3",{staticClass:"font-bold text-primary py-2 text-center"},[e._v(e._s(t.unit.name)+" ("+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-sm font-medium text-primary"},[e._v(e._s(e._f("currency")(e.displayRightPrice(t))))])])])])})),0):e._e()]):e._e(),e._v(" "),0===e.unitsQuantities.length?s("div",{staticClass:"h-56 flex items-center justify-center"},[s("ns-spinner")],1):e._e()])}),[],!1,null,null,null).exports;function d(e,t){for(var s=0;s=544&&window.innerWidth<768?this.screenIs="sm":window.innerWidth>=768&&window.innerWidth<992?this.screenIs="md":window.innerWidth>=992&&window.innerWidth<1200?this.screenIs="lg":window.innerWidth>=1200&&(this.screenIs="xl")}},{key:"is",value:function(e){return void 0===e?this.screenIs:this.screenIs===e}}])&&h(t.prototype,s),n&&h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),_=s(1356),b=s(381),y=s.n(b);function g(e,t){for(var s=0;s0)return(0,l.__)("Some products has been added to the cart. Would youl ike to discard this order ?")},a.kq.addAction("ns-after-cart-changed","listen-add-to-cart",(function(){return e.refreshCart()})),this.types.subscribe((function(t){var s=Object.values(t).filter((function(e){return e.selected}));if(s.length>0){var n=e.order.getValue();n.type=s[0],e.order.next(n)}})),window.addEventListener("resize",(function(){e._responsive.detect(),e.defineCurrentScreen()})),window.onbeforeunload=function(){if(e.products.getValue().length>0)return(0,l.__)("Some products has been added to the cart. Would youl ike to discard this order ?")}}},{key:"getSalePrice",value:function(e,t){return"yes"===this.options.getValue().ns_pos_price_with_tax?(0,_.f)(e.sale_price_with_tax):(0,_.f)(e.sale_price_without_tax)}},{key:"getCustomPrice",value:function(e,t){return"yes"===this.options.getValue().ns_pos_price_with_tax?(0,_.f)(e.custom_price_with_tax):(0,_.f)(e.custom_price_without_tax)}},{key:"getWholesalePrice",value:function(e,t){return"yes"===this.options.getValue().ns_pos_price_with_tax?(0,_.f)(e.wholesale_price_with_tax):(0,_.f)(e.wholesale_price_without_tax)}},{key:"setHoldPopupEnabled",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._holdPopupEnabled=e}},{key:"getHoldPopupEnabled",value:function(){return this._holdPopupEnabled}},{key:"processInitialQueue",value:function(){return x(this,void 0,void 0,r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=r().keys(this._initialQueue);case 1:if((e.t1=e.t0()).done){e.next=14;break}return t=e.t1.value,e.prev=3,e.next=6,this._initialQueue[t]();case 6:e.sent,e.next=12;break;case 9:e.prev=9,e.t2=e.catch(3),a.kX.error(e.t2.message).subscribe();case 12:e.next=1;break;case 14:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"removeCoupon",value:function(e){var t=this.order.getValue(),s=t.coupons,n=s.indexOf(e);s.splice(n,1),t.coupons=s,this.order.next(t)}},{key:"pushCoupon",value:function(e){var t=this.order.getValue();t.coupons.forEach((function(t){if(t.code===e.code){var s=(0,l.__)("This coupon is already added to the cart");throw a.kX.error(s).subscribe(),s}})),t.coupons.push(e),this.order.next(t),this.refreshCart()}},{key:"header",get:function(){var e={buttons:{nsPosDashboardButton:w,nsPosPendingOrderButton:C,nsPosOrderTypeButton:k,nsPosCustomersButton:P,nsPosResetButton:j}};return"yes"===this.options.getValue().ns_pos_registers_enabled&&(e.buttons.nsPosCashRegister=O),a.kq.doAction("ns-pos-header",e),e}},{key:"defineOptions",value:function(e){this._options.next(e)}},{key:"defineCurrentScreen",value:function(){this._visibleSection.next(["xs","sm"].includes(this._responsive.is())?"grid":"both"),this._screen.next(this._responsive.is())}},{key:"changeVisibleSection",value:function(e){["both","cart","grid"].includes(e)&&(["cart","both"].includes(e)&&this.refreshCart(),this._visibleSection.next(e))}},{key:"addPayment",value:function(e){if(e.value>0){var t=this._order.getValue();return t.payments.push(e),this._order.next(t),this.computePaid()}return a.kX.error("Invalid amount.").subscribe()}},{key:"removePayment",value:function(e){if(void 0!==e.id)return a.kX.error((0,l.__)("Unable to delete a payment attached to the order.")).subscribe();var t=this._order.getValue(),s=t.payments.indexOf(e);t.payments.splice(s,1),this._order.next(t),a.l.emit({identifier:"ns.pos.remove-payment",value:e}),this.updateCustomerAccount(e),this.computePaid()}},{key:"updateCustomerAccount",value:function(e){if("account-payment"===e.identifier){var t=this.order.getValue().customer;t.account_amount+=e.value,this.selectCustomer(t)}}},{key:"getPriceWithoutTax",value:function(e,t,s){return"inclusive"===s?e/(t+100)*100:"exclusive"===s?e:void 0}},{key:"getPriceWithTax",value:function(e,t,s){return"inclusive"===s?e:"exclusive"===s?e/100*(t+100):void 0}},{key:"getVatValue",value:function(e,t,s){return"inclusive"===s?e-this.getPriceWithoutTax(e,t,s):"exclusive"===s?this.getPriceWithTax(e,t,s)-e:void 0}},{key:"computeTaxes",value:function(){var e=this;return new Promise((function(t,s){var n=e.order.getValue();if(void 0===(n=e.computeProductsTaxes(n)).tax_group_id||null===n.tax_group_id)return e.computeOrderTaxes(n),t({data:{order:n},status:"success"});var r=n.tax_groups;return Object.values(r).length>0?(void 0!==r[n.tax_group_id]&&(n.taxes=r[n.tax_group_id].taxes.map((function(t){return t.tax_value=e.getVatValue(n.subtotal-n.discount,t.rate,n.tax_type),t}))),n=e.computeOrderTaxes(n),t({status:"success",data:{tax:r[n.tax_group_id],order:n}})):void 0!==n.tax_group_id&&n.tax_group_id.toString().length>0?void a.ih.get("/api/nexopos/v4/taxes/groups/".concat(n.tax_group_id)).subscribe({next:function(s){return n=e.computeOrderTaxGroup(n,s),t({status:"success",data:{tax:s,order:n}})},error:function(e){return s(e)}}):s({status:"failed",message:(0,l.__)("No tax group assigned to the order")})}))}},{key:"computeOrderTaxGroup",value:function(e,t){var s=this;return this.options.getValue().ns_pos_vat,this.options.getValue().ns_pos_price_with_tax,t.taxes=t.taxes.map((function(t){return{tax_id:t.id,tax_name:t.name,rate:parseFloat(t.rate),tax_value:s.getVatValue(e.subtotal-e.discount,t.rate,e.tax_type)}})),0===t.taxes.length?a.kX.error((0,l.__)("The selected tax group doesn't have any assigned sub taxes. This might cause wrong figures."),(0,l.__)("Proceed"),{duration:!1}).subscribe():(e.tax_groups=e.tax_groups||[],e.taxes=t.taxes,e.tax_groups[t.id]=t,this.computeOrderTaxes(e))}},{key:"computeOrderTaxes",value:function(e){var t=this.options.getValue().ns_pos_vat,s="yes"===this.options.getValue().ns_pos_price_with_tax;return["flat_vat","variable_vat","products_variable_vat","products_flat_vat"].includes(t)&&e.taxes&&e.taxes.length>0&&(e.tax_value+=e.taxes.map((function(e){return e.tax_value})).reduce((function(e,t){return e+t}))),e.total_tax_value=e.tax_value,["products_variable_vat","products_flat_vat","products_vat"].includes(t)&&!s&&(e.total_tax_value=e.products_tax_value+e.tax_value),e}},{key:"computeProductsTaxes",value:function(e){var t=this.products.getValue(),s=t.map((function(e){return e.tax_value}));e.products_tax_value=0;var n=this.options.getValue().ns_pos_vat;return["products_flat_vat","products_variable_vat","products_vat"].includes(n)&&s.length>0&&(e.products_tax_value+=s.reduce((function(e,t){return e+t}))),e.products=t,e.total_products=t.length,e}},{key:"canProceedAsLaidAway",value:function(e){var t=this;return new Promise((function(s,n){return x(t,void 0,void 0,r().mark((function t(){var i,a,c,u,d,p,f,h=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.customer.group.minimal_credit_payment,a=(e.total*i/100).toFixed(ns.currency.ns_currency_precision),a=parseFloat(a),t.prev=3,t.next=6,new Promise((function(t,s){o.G.show(E,{order:e,reject:s,resolve:t})}));case 6:if(!(0===(c=t.sent).order.instalments.length&&c.order.tendered=a&&y()(e.date).isSame(ns.date.moment.startOf("day"),"day")}))).length){t.next=17;break}return t.abrupt("return",s({status:"success",message:(0,l.__)("Layaway defined"),data:{order:c.order}}));case 17:(f=p[0].amount)>0?o.G.show($,{title:(0,l.__)("Initial Payment"),message:(0,l.__)('In order to proceed, an initial payment of {amount} is required for the selected payment type "{paymentType}". Would you like to proceed ?').replace("{amount}",v.default.filter("currency")(f)).replace("{paymentType}",d.label),onAction:function(e){if(e){var t={identifier:d.identifier,label:d.label,value:f,readonly:!1,selected:!0};h.addPayment(t),p[0].paid=!0,s({status:"success",message:(0,l.__)("Layaway defined"),data:{order:c.order}})}else n({status:"failed",message:(0,l.__)("The request was canceled")})}}):s({status:"success",message:(0,l.__)("Layaway defined"),data:{order:c.order}});case 19:t.next=24;break;case 21:return t.prev=21,t.t0=t.catch(3),t.abrupt("return",n(t.t0));case 24:case"end":return t.stop()}}),t,this,[[3,21]])})))}))}},{key:"submitOrder",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise((function(s,n){return x(e,void 0,void 0,r().mark((function e(){var i,o,c,u,d,p=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=Object.assign(Object.assign({},this.order.getValue()),t),o=i.customer.group.minimal_credit_payment,"hold"===i.payment_status){e.next=20;break}if(!(0===i.payments.length&&i.total>0&&i.total>i.tendered)){e.next=20;break}if("no"!==this.options.getValue().ns_orders_allow_partial){e.next=9;break}return c=(0,l.__)("Partially paid orders are disabled."),e.abrupt("return",n({status:"failed",message:c}));case 9:if(!(o>=0)){e.next=20;break}return e.prev=10,e.next=13,this.canProceedAsLaidAway(i);case 13:u=e.sent,i=u.data.order,e.next=20;break;case 17:return e.prev=17,e.t0=e.catch(10),e.abrupt("return",n(e.t0));case 20:if(this._isSubmitting){e.next=24;break}return d=void 0!==i.id?"put":"post",this._isSubmitting=!0,e.abrupt("return",a.ih[d]("/api/nexopos/v4/orders".concat(void 0!==i.id?"/"+i.id:""),i).subscribe({next:function(e){s(e),p.reset(),a.kq.doAction("ns-order-submit-successful",e),p._isSubmitting=!1;var t=p.options.getValue().ns_pos_complete_sale_audio;t.length>0&&new Audio(t).play()},error:function(e){p._isSubmitting=!1,n(e),a.kq.doAction("ns-order-submit-failed",e)}}));case 24:return e.abrupt("return",n({status:"failed",message:(0,l.__)("An order is currently being processed.")}));case 25:case"end":return e.stop()}}),e,this,[[10,17]])})))}))}},{key:"defineQuantities",value:function(e){var t=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new Promise((function(n,r){var i={unit:s.filter((function(t){return t.id===e.unit_id}))[0]||{},sale_price_with_tax:"normal"===e.mode?parseFloat(e.price_with_tax):0,sale_price_without_tax:"normal"===e.mode?parseFloat(e.price_without_tax):0,sale_price:"normal"===e.mode?parseFloat(e.unit_price):0,sale_price_tax:"normal"===e.mode?e.tax_value:0,sale_price_edit:0,wholesale_price_with_tax:"wholesale"===e.mode?parseFloat(e.price_with_tax):0,wholesale_price_without_tax:"wholesale"===e.mode?parseFloat(e.price_without_tax):0,wholesale_price:"wholesale"===e.mode?parseFloat(e.unit_price):0,wholesale_price_tax:"wholesale"===e.mode?e.tax_value:0,wholesale_price_edit:0,custom_price_with_tax:"custom"===e.mode?parseFloat(e.price_with_tax):0,custom_price_without_tax:"custom"===e.mode?parseFloat(e.price_without_tax):0,custom_price:"custom"===e.mode?parseFloat(e.unit_price):0,custom_price_tax:"custom"===e.mode?e.tax_value:0,custom_price_edit:"custom"===e.mode?parseFloat(e.unit_price):0};if(["inclusive","exclusive"].includes(e.tax_type))try{if(!e.tax_group_id)return i.sale_price_tax=0,i.wholesale_price_tax=0,i.sale_price_without_tax=e.unit_price,n(i);a.ih.get("/api/nexopos/v4/taxes/groups/".concat(e.tax_group_id)).subscribe({next:function(s){return["sale","wholesale","custom"].forEach((function(n){i[n+"_price_tax"]=s.taxes.map((function(s){return t.getVatValue(i[n+"_price"],s.rate,e.tax_type)})).reduce((function(e,t){return e+t})),i["gross_"+n+"_price"]=i[n+"_price"]+i[n+"_price_tax"],i["net_"+n+"_price"]=i[n+"_price"]-i[n+"_price_tax"]})),n(i)},error:function(e){r(!1)}})}catch(e){return a.kX.error((0,l.__)("An error has occured while computing the product.")).subscribe()}return n(i)}))}},{key:"loadOrder",value:function(e){var t=this;return new Promise((function(s,n){a.ih.get("/api/nexopos/v4/orders/".concat(e,"/pos")).subscribe({next:function(e){return x(t,void 0,void 0,r().mark((function t(){var i,o,l,c,u=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,a.kq.doAction("ns-before-load-order",{order:e}),t.next=7;break;case 4:return t.prev=4,t.t0=t.catch(0),t.abrupt("return",n(t.t0));case 7:i=this.options.getValue(),e=Object.assign(Object.assign({},this.defaultOrder()),e),o=[],l=r().mark((function t(s){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==(n=e.products[s]).product){t.next=9;break}return t.t0=n.name,t.t1=n.unit_id,t.next=6,u.defineQuantities(n);case 6:t.t2=t.sent,t.t3=[t.t2],n.product={mode:"custom",name:t.t0,unit_id:t.t1,unit_quantities:t.t3};case 9:n.$original=function(){return n.product},n.$quantities=function(){var e=n.product.unit_quantities.filter((function(e){return+e.id==+n.unit_quantity_id||void 0===e.id}))[0];return"custom"===n.mode&&"yes"===i.ns_pos_price_with_tax&&(e.custom_price_edit=n.unit_price),e},o.push(n);case 12:case"end":return t.stop()}}),t)})),c=0;case 12:if(!(c1&&void 0!==arguments[1])||arguments[1],s=this.options.getValue();if("disabled"===s.ns_pos_printing_enabled_for)return!1;"default"===s.ns_pos_printing_gateway?this.processRegularPrinting(e):this.processCustomPrinting(e,s.ns_pos_printing_gateway,t)}},{key:"processCustomPrinting",value:function(e,t){var s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return x(this,void 0,void 0,r().mark((function n(){return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:!1===a.kq.applyFilters(s?"ns-order-custom-print":"ns-order-custom-print-aloud",{printed:!1,order_id:e,gateway:t}).printed&&a.kX.error((0,l.__)("Unsupported print gateway.")).subscribe();case 2:case"end":return n.stop()}}),n)})))}},{key:"processRegularPrinting",value:function(e){var t=document.querySelector("printing-section");t&&t.remove();var s=document.createElement("iframe");s.id="printing-section",s.className="hidden",s.src=this.settings.getValue().urls.sale_printing_url.replace("{id}",e),document.body.appendChild(s)}},{key:"computePaid",value:function(){var e=this._order.getValue();e.tendered=0,e.payments.length>0&&(e.tendered=e.payments.map((function(e){return e.value})).reduce((function(e,t){return t+e}))),e.tendered>=e.total?e.payment_status="paid":e.tendered>0&&e.tendered0&&(t.products.filter((function(t){return e.products.map((function(e){return e.product_id})).includes(t.product_id)})).length>0||-1!==s.indexOf(e)||s.push(e)),e.categories.length>0&&(t.products.filter((function(t){return e.categories.map((function(e){return e.category_id})).includes(t.$original().category_id)})).length>0||-1!==s.indexOf(e)||s.push(e))})),s.forEach((function(t){a.kX.error((0,l.__)('The coupons "%s" has been removed from the cart, as it\'s required conditions are no more meet.').replace("%s",t.name),(0,l.__)("Okay"),{duration:6e3}).subscribe(),e.removeCoupon(t)}))}},{key:"refreshCart",value:function(){return x(this,void 0,void 0,r().mark((function e(){var t,s,n,i,o,c,u,d,p,f,v,h,m;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.checkCart(),t=this.products.getValue(),s=this.order.getValue(),n=this.options.getValue().ns_pos_price_with_tax,(i=t.filter((function(e){return"dynamic"!==e.product_type})).map((function(e){return"yes"===n?e.total_price_with_tax:e.total_price_without_tax}))).length>0?(o=i.reduce((function(e,t){return e+t})),c=0,(u=t.filter((function(e){return"dynamic"===e.product_type})).map((function(e){return e.unit_price=o*e.rate/100,e.total_price=e.unit_price*e.quantity,e.total_price}))).length>0&&(c=u.reduce((function(e,t){return e+t}))),s.subtotal=o+c):s.subtotal=0,d=s.coupons.map((function(e){return"percentage_discount"===e.type?(e.value=s.subtotal*e.discount_value/100,e.value):(e.value=e.discount_value,e.value)})),s.total_coupons=0,d.length>0&&(s.total_coupons=d.reduce((function(e,t){return e+t}))),"percentage"===s.discount_type&&(s.discount=s.discount_percentage*s.subtotal/100),s.discount>s.subtotal&&0===s.total_coupons&&(s.discount=s.subtotal,a.kX.info((0,l.__)("The discount has been set to the cart subtotal.")).subscribe()),s.tax_value=0,s.total_tax_value=0,this.order.next(s),e.prev=14,e.next=17,this.computeTaxes();case 17:p=e.sent,s=p.data.order,e.next=24;break;case 21:e.prev=21,e.t0=e.catch(14),!1!==e.t0&&void 0!==e.t0.message&&a.kX.error(e.t0.message||(0,l.__)("An unexpected error has occured while fecthing taxes."),(0,l.__)("OKAY"),{duration:0}).subscribe();case 24:(f=t.map((function(e){return"inclusive"===e.tax_type?e.tax_value:0}))).length>0&&f.reduce((function(e,t){return e+t})),v=s.tax_type,h=this.options.getValue().ns_pos_vat,m=0,["flat_vat","variable_vat","products_vat","products_flat_vat","products_variable_vat"].includes(h)&&(m=s.total_tax_value),s.total="exclusive"===v?+(s.subtotal+(s.shipping||0)+m-s.discount-s.total_coupons).toFixed(ns.currency.ns_currency_precision):+(s.subtotal+(s.shipping||0)-s.discount-s.total_coupons).toFixed(ns.currency.ns_currency_precision),this.order.next(s),a.kq.doAction("ns-cart-after-refreshed",s);case 34:case"end":return e.stop()}}),e,this,[[14,21]])})))}},{key:"getStockUsage",value:function(e,t){var s=this._products.getValue().filter((function(s){return s.product_id===e&&s.unit_quantity_id===t})).map((function(e){return e.quantity}));return s.length>0?s.reduce((function(e,t){return e+t})):0}},{key:"addToCart",value:function(e){return x(this,void 0,void 0,r().mark((function t(){var s,n,i,o,l,c,u,d;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=new Object,n={product_id:e.id||0,name:e.name,discount_type:"percentage",discount:0,discount_percentage:0,product_type:e.product_type||"product",rate:e.rate||0,quantity:e.quantity||0,tax_group_id:e.tax_group_id,tax_type:e.tax_type||void 0,tax_value:0,unit_id:e.unit_id||0,unit_price:e.unit_price||0,price_with_tax:e.price_with_tax||0,price_without_tax:e.price_without_tax||0,unit_name:e.unit_name||"",total_price:0,total_price_without_tax:0,total_price_with_tax:0,mode:e.mode||"normal",$original:e.$original||function(){return e},$quantities:e.$quantities||void 0},this._processingAddQueue=!0,0===n.product_id){t.next=22;break}t.t0=r().keys(this.addToCartQueue);case 5:if((t.t1=t.t0()).done){t.next=22;break}return i=t.t1.value,t.prev=7,o=new this.addToCartQueue[i](n),t.next=11,o.run(s);case 11:l=t.sent,s=Object.assign(Object.assign({},s),l),t.next=20;break;case 15:if(t.prev=15,t.t2=t.catch(7),!1!==t.t2){t.next=20;break}return this._processingAddQueue=!1,t.abrupt("return",!1);case 20:t.next=5;break;case 22:this._processingAddQueue=!1,n=Object.assign(Object.assign({},n),s),c=this._products.getValue(),this.settings.getValue().ns_pos_items_merge?(u=c.filter((function(e){return e.product_id===n.product_id&&e.tax_group_id===n.tax_group_id&&e.unit_id===n.unit_id&&e.unit_quantity_id===n.unit_quantity_id})),u.length>0?u[0].quantity+=n.quantity:c.unshift(n)):c.unshift(n),this.recomputeProducts(c),this.products.next(c),(d=this.options.getValue().ns_pos_new_item_audio).length>0&&new Audio(d).play(),a.kq.doAction("ns-after-cart-changed");case 31:case"end":return t.stop()}}),t,this,[[7,15]])})))}},{key:"defineTypes",value:function(e){this._types.next(e)}},{key:"removeProduct",value:function(e){var t=this._products.getValue(),s=t.indexOf(e);t.splice(s,1),this.products.next(t),a.kq.doAction("ns-after-cart-changed")}},{key:"updateProduct",value:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=this._products.getValue();s=null===s?n.indexOf(e):s,v.default.set(n,s,Object.assign(Object.assign({},e),t)),this.recomputeProducts(n),this.products.next(n),a.kq.doAction("ns-after-cart-changed")}},{key:"recomputeProducts",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t.forEach((function(t){e.computeProduct(t)}))}},{key:"getProductUnitPrice",value:function(e,t){switch(e){case"custom":return t.custom_price_edit;case"normal":return t.sale_price_edit;case"wholesale":return t.wholesale_price_edit}}},{key:"computeProductTax",value:function(e){switch(e.mode){case"custom":return this.computeCustomProductTax(e);case"normal":return this.computeNormalProductTax(e);case"wholesale":return this.computeWholesaleProductTax(e);default:return e}}},{key:"proceedProductTaxComputation",value:function(e,t){var s=this,n=e.$original(),r=n.tax_group,i=this.getProductUnitPrice(e.mode,e.$quantities()),o=0,a=this.getProductUnitPrice(e.mode,e.$quantities());if(null!=r&&void 0!==r.taxes){var l=0;switch(r.taxes.length>0&&(l=r.taxes.map((function(e){return e.rate})).reduce((function(e,t){return e+t}))),n.tax_type){case"inclusive":i=this.getPriceWithoutTax(t,l,n.tax_type),a=t;break;case"exclusive":i=t,a=this.getPriceWithTax(t,l,n.tax_type)}var c=r.taxes.map((function(e){return s.getVatValue(t,e.rate,n.tax_type)}));c.length>0&&(o=c.reduce((function(e,t){return e+t})))}return{price_without_tax:i,tax_value:o,price_with_tax:a}}},{key:"computeCustomProductTax",value:function(e){e.$original();var t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.custom_price_edit);return t.custom_price_without_tax=s.price_without_tax,t.custom_price_with_tax=s.price_with_tax,t.custom_price_tax=s.tax_value,e.$quantities=function(){return t},e}},{key:"computeNormalProductTax",value:function(e){e.$original();var t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.sale_price_edit);return t.sale_price_without_tax=s.price_without_tax,t.sale_price_with_tax=s.price_with_tax,t.sale_price_tax=s.tax_value,e.$quantities=function(){return t},e}},{key:"computeWholesaleProductTax",value:function(e){e.$original();var t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.wholesale_price_edit);return t.wholesale_price_without_tax=s.price_without_tax,t.wholesale_price_with_tax=s.price_with_tax,t.wholesale_price_tax=s.tax_value,e.$quantities=function(){return t},e}},{key:"getPrice",value:function(e,t,s){switch(t){case"normal":return e["sale_price_"+s];case"wholesale":return e["wholesale_price_"+s];case"custom":return e["custom_price_"+s]}}},{key:"computeProduct",value:function(e){"product"===e.product_type&&("normal"===e.mode?(e.unit_price=this.getSalePrice(e.$quantities(),e.$original()),e.tax_value=e.$quantities().sale_price_tax*e.quantity):"wholesale"===e.mode&&(e.unit_price=this.getWholesalePrice(e.$quantities(),e.$original()),e.tax_value=e.$quantities().wholesale_price_tax*e.quantity),"custom"===e.mode&&(e.unit_price=this.getCustomPrice(e.$quantities(),e.$original()),e.tax_value=e.$quantities().custom_price_tax*e.quantity));var t=0,s=0,n=this.getPrice(e.$quantities(),e.mode,"with_tax"),r=this.getPrice(e.$quantities(),e.mode,"without_tax");["flat","percentage"].includes(e.discount_type)&&"percentage"===e.discount_type&&(e.discount=e.unit_price*e.discount_percentage/100*e.quantity,t=r*e.discount_percentage/100*e.quantity,s=n*e.discount_percentage/100*e.quantity),e.price_with_tax=n,e.price_without_tax=r,e.total_price=e.unit_price*e.quantity-e.discount,e.total_price_with_tax=n*e.quantity-s,e.total_price_without_tax=r*e.quantity-t,a.kq.doAction("ns-after-product-computed",e)}},{key:"loadCustomer",value:function(e){return a.ih.get("/api/nexopos/v4/customers/".concat(e))}},{key:"defineSettings",value:function(e){this._settings.next(e)}},{key:"voidOrder",value:function(e){var t=this;void 0!==e.id?["hold"].includes(e.payment_status)?o.G.show($,{title:(0,l.__)("Order Deletion"),message:(0,l.__)("The current order will be deleted as no payment has been made so far."),onAction:function(s){s&&a.ih.delete("/api/nexopos/v4/orders/".concat(e.id)).subscribe({next:function(e){a.kX.success(e.message).subscribe(),t.reset()},error:function(e){return a.kX.error(e.message).subscribe()}})}}):o.G.show(T,{title:(0,l.__)("Void The Order"),message:(0,l.__)("The current order will be void. This will cancel the transaction, but the order won't be deleted. Further details about the operation will be tracked on the report. Consider providing the reason of this operation."),onAction:function(s){!1!==s&&a.ih.post("/api/nexopos/v4/orders/".concat(e.id,"/void"),{reason:s}).subscribe({next:function(e){a.kX.success(e.message).subscribe(),t.reset()},error:function(e){return a.kX.error(e.message).subscribe()}})}}):a.kX.error((0,l.__)("Unable to void an unpaid order.")).subscribe()}},{key:"triggerOrderTypeSelection",value:function(e){return x(this,void 0,void 0,r().mark((function t(){var s;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s=0;case 1:if(!(s{var n={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function r(e){var t=i(e);return s(t)}function i(e){if(!s.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}r.keys=function(){return Object.keys(n)},r.resolve=i,e.exports=r,r.id=6700},4806:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var n=s(538),r=s(381),i=s.n(r),o=s(7144),a=s.n(o),l=(s(9095),s(7389));const c=n.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:a()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:i()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:i()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?i()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const u=(0,s(1900).Z)(c,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[s("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),s("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?s("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[s("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),s("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[s("i",{staticClass:"las la-times"})]),e._v(" "),s("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[s("div",{staticClass:"flex justify-between items-center w-full py-2"},[s("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),s("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():s("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,n){return s("p",{key:n,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},2744:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(381),r=s.n(n);const i={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:r(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return r()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?r()():r()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?r()():r()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:s(7389).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(r().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"picker mb-2"},[e.field?s("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),s("div",{staticClass:"ns-button"},[s("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[s("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?s("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?s("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?s("span",{staticClass:"mx-1 text-sm"},[null!==e.date?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?s("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?s("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?s("div",{staticClass:"relative z-10 h-0 w-0"},[s("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[s("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[s("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[s("i",{staticClass:"las la-minus"})]),e._v(" "),s("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),s("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[s("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,n){return s("div",{key:n,staticClass:"h-8 flex justify-center items-center text-sm"},[[s("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(s){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[s("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),s("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),s("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,n){return s("div",{key:n,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(n,r){return s("div",{key:r,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,r){return[t.dayOfWeek===n?s("div",{key:r,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(s){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),s("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[s("div",{staticClass:"-mx-1 flex justify-between"},[s("div",{staticClass:"px-1"},[s("div",{staticClass:"-mx-1 flex"},[e.field?s("div",{staticClass:"px-1"},[s("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[s("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?s("div",{staticClass:"px-1"},[s("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[s("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),s("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},1544:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(381),r=s.n(n);const i={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?r()():r()(this.date),this.build()},methods:{__:s(7389).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(r().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"picker"},[s("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[s("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),s("span",{staticClass:"mx-1 text-sm"},[s("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?s("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?s("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?s("div",{staticClass:"relative h-0 w-0 -mb-2"},[s("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"p-2 flex items-center"},[s("div",[s("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[s("i",{staticClass:"las la-angle-left"})])]),e._v(" "),s("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),s("div",[s("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[s("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),s("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),s("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,n){return s("div",{key:n,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(n,r){return s("div",{key:r,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,r){return[t.dayOfWeek===n?s("div",{key:r,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(s){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),s("div")])]):e._e()])}),[],!1,null,null,null).exports},1828:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});const n={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[s("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),s("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},3220:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});var n=s(7389);const r={name:"ns-numpad-plus",props:["value","currency","limit"],data:function(){return{screenValue:0,order:null,cursor:parseInt(ns.currency.ns_currency_precision),orderSubscription:null,allSelected:!0,keyRows:[[7,8,9].map((function(e){return{identifier:e,value:e}})),[4,5,6].map((function(e){return{identifier:e,value:e}})),[1,2,3].map((function(e){return{identifier:e,value:e}})),[{identifier:".",value:"."},{identifier:0,value:0},{identifier:"backspace",icon:"la-backspace"}],[{identifier:"next",value:(0,n.__)("Enter")}]]}},mounted:function(){var e=this;this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,s){e.inputValue({value:s})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-dot").whenVisible([".is-popup"]).whenPressed(".",(function(){return e.inputValue({identifier:"."})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save"),nsHotPress.destroy("numpad-dot")},methods:{increaseBy:function(e){this.screenValue=(parseFloat(e.value)+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if("."===e.identifier)this.allSelected?(this.screenValue="0.",this.allSelected=!1):null===this.screenValue.toString().match(/^[0-9][1-9]*\.[0-9]*$/)&&(this.screenValue=this.screenValue+=".");else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}this.$emit("changed",this.screenValue)}else this.$emit("next",this.screenValue)}}};const i=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"numpad-holder"}},e._l(e.keyRows,(function(t,n){return s("div",{key:n},[s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 text-lg",attrs:{id:"numpad"}},[e._l(t,(function(n,r){return s("div",{key:r,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",class:1===t.length?"col-span-3":"",on:{click:function(t){return e.inputValue(n)}}},[void 0!==n.value?s("span",[e._v(e._s(n.value))]):e._e(),e._v(" "),n.icon?s("i",{staticClass:"las",class:n.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)])})),0)}),[],!1,null,null,null).exports},4864:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(7389);function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);"Object"===s&&e.constructor&&(s=e.constructor.name);if("Map"===s||"Set"===s)return Array.from(e);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,n=new Array(t);s0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,s){e.inputValue({value:s})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var s=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",s)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const a=(0,s(1900).Z)(o,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,n){return s("div",{key:n,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(s){return e.inputValue(t)}}},[void 0!==t.value?s("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?s("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3506:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});const n={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var s=[];t-3>1&&s.push(1,"...");for(var n=1;n<=e;n++)t+3>n&&t-30||"string"==typeof e}))}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[s("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,n){return["..."!==e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(s){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?s("a",{key:n,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),s("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[s("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},9408:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});const n={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"mb-2 ns-switch"},[s("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),s("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,n){return s("button",{key:n,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(s){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():s("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,n){return s("p",{key:n,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},4255:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var n=s(7757),r=s.n(n),i=s(9671),o=s(8603),a=s(7389),l=s(3601);function c(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}const u={name:"ns-media",props:["popup"],components:{VueUpload:s(2948)},data:function(){return{pages:[{label:(0,a.__)("Upload"),name:"upload",selected:!1},{label:(0,a.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return i.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:o.Z,__:a.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,a.__)("Confirm Your Action"),message:(0,a.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&i.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){i.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){i.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(s){t.addEventListener(s,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(s){t.addEventListener(s,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=r().mark((function e(){var s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),n=r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s[t],e.prev=1,n.progress=1,e.next=5,new Promise((function(e,t){var s=new FormData;s.append("file",n.file),i.ih.post("/api/nexopos/v4/medias",s,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){n.uploaded=!0,n.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),n.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),o=0;case 3:if(!(o0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,i.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(s,n){n!==t.response.data.indexOf(e)&&(s.selected=!1)})),e.selected=!e.selected}}};const d=(0,s(1900).Z)(u,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[s("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[s("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),s("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,n){return s("li",{key:n,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(s){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?s("div",{staticClass:"content w-full overflow-hidden flex"},[s("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[s("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),s("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),s("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[s("ul",e._l(e.files,(function(t,n){return s("li",{key:n,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[s("span",[e._v(e._s(t.file.name))]),e._v(" "),s("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?s("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?s("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[s("div"),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),s("div",{staticClass:"flex flex-auto overflow-hidden"},[s("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"p-2 overflow-x-auto"},[s("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,n){return s("div",{key:n},[s("div",{staticClass:"p-2"},[s("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(s){return e.selectResource(t)}}},[s("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?s("div",{staticClass:"flex flex-auto items-center justify-center"},[s("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),s("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0 ",attrs:{id:"preview"}},[s("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?s("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?s("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),s("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),s("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),s("p",{staticClass:"flex flex-col mb-2"},[s("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),s("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[s("div",{staticClass:"flex -mx-2 flex-shrink-0"},[s("div",{staticClass:"px-2 flex-shrink-0 flex"},[s("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[s("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[s("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?s("div",{staticClass:"ns-button error"},[s("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[s("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),s("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[s("div",{staticClass:"px-2"},[s("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[s("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[s("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),s("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),s("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[s("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?s("div",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},976:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(2242),r=s(1247);const i={name:"ns-pos-customers-button",methods:{__:s(7389).__,openCustomerPopup:function(){(new n.G).open(r.Z)}},beforeDestroy:function(){nsHotPress.destroy("ns_pos_keyboard_create_customer")},mounted:function(){var e=this;for(var t in nsShortcuts)["ns_pos_keyboard_create_customer"].includes(t)&&nsHotPress.create("ns_pos_keyboard_create_customer").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[t],(function(t){t.preventDefault(),e.openCustomerPopup()}))}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button default"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.openCustomerPopup()}}},[s("i",{staticClass:"mr-1 text-xl lar la-user-circle"}),e._v(" "),s("span",[e._v(e._s(e.__("Customers")))])])])}),[],!1,null,null,null).exports},227:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});const n={name:"ns-pos-dashboard-button",methods:{__:s(7389).__,goToDashboard:function(){return document.location=POS.settings.getValue().urls.dashboard_url}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button success"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.goToDashboard()}}},[s("i",{staticClass:"mr-1 text-xl las la-tachometer-alt"}),e._v(" "),s("span",[e._v(e._s(e.__("Dashboard")))])])])}),[],!1,null,null,null).exports},3808:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(2242),r=s(664);const i={name:"ns-pos-delivery-button",methods:{__:s(7389).__,openOrderTypeSelection:function(){new n.G({primarySelector:"#pos-app",popupClass:"shadow-lg bg-white w-3/5 md:w-2/3 lg:w-2/5 xl:w-2/4"}).open(r.Z)}},beforeDestroy:function(){nsHotPress.destroy("ns_pos_keyboard_order_type")},mounted:function(){var e=this;for(var t in nsShortcuts)["ns_pos_keyboard_order_type"].includes(t)&&nsHotPress.create("ns_pos_keyboard_order_type").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[t],(function(t){t.preventDefault(),e.openOrderTypeSelection()}))}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button default"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.openOrderTypeSelection()}}},[s("i",{staticClass:"mr-1 text-xl las la-truck"}),e._v(" "),s("span",[e._v(e._s(e.__("Order Type")))])])])}),[],!1,null,null,null).exports},605:(e,t,s)=>{"use strict";s.d(t,{Z:()=>_});var n=s(2242),r=s(9671),i=s(3601),o=s(7389);const a={data:function(){return{products:[],isLoading:!1}},computed:{order:function(){return this.$popupParams.order}},mounted:function(){this.loadProducts()},methods:{__:o.__,close:function(){this.$popupParams.reject(!1),this.$popup.close()},loadProducts:function(){var e=this;this.isLoading=!0;var t=this.$popupParams.order.id;r.ih.get("/api/nexopos/v4/orders/".concat(t,"/products")).subscribe((function(t){e.isLoading=!1,e.products=t}))},openOrder:function(){this.$popup.close(),this.$popupParams.resolve(this.order)}}};var l=s(1900);const c=(0,l.Z)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg ns-box w-6/7-screen md:w-3/5-screen lg:w-2/5-screen h-6/7-screen flex flex-col overflow-hidden"},[s("div",{staticClass:"p-2 flex justify-between text-primary items-center border-b ns-box-header"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Products"))+" — "+e._s(e.order.code)+" "),e.order.title?s("span",[e._v("("+e._s(e.order.title)+")")]):e._e()]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex-auto p-2 overflow-y-auto ns-box-body"},[e.isLoading?s("div",{staticClass:"flex-auto relative"},[s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1)]):e._e(),e._v(" "),e.isLoading?e._e():e._l(e.products,(function(t){return s("div",{key:t.id,staticClass:"item"},[s("div",{staticClass:"flex-col border-b border-info-primary py-2"},[s("div",{staticClass:"title font-semibold text-primary flex justify-between"},[s("span",[e._v(e._s(t.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(t.total_price)))])]),e._v(" "),s("div",{staticClass:"text-sm text-primary"},[s("ul",[s("li",[e._v(e._s(e.__("Unit"))+" : "+e._s(t.unit.name))])])])])])}))],2),e._v(" "),s("div",{staticClass:"flex justify-end p-2 border-t ns-box-footer"},[s("div",{staticClass:"px-1"},[s("div",{staticClass:"-mx-2 flex"},[s("div",{staticClass:"px-1"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.openOrder()}}},[e._v(e._s(e.__("Open")))])],1),e._v(" "),s("div",{staticClass:"px-1"},[s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.close()}}},[e._v(e._s(e.__("Close")))])],1)])])])])}),[],!1,null,null,null).exports;const u={props:["orders"],data:function(){return{searchField:"",columns:{rightColumn:[],leftColumn:[]}}},watch:{orders:function(){r.kq.doAction("ns-pos-pending-orders-refreshed",this.orders)}},mounted:function(){this.columns.leftColumn=r.kq.applyFilters("ns-pending-orders-left-column",[{label:(0,o.__)("Code"),value:function(e){return e.code}},{label:(0,o.__)("Cashier"),value:function(e){return e.nexopos_users_username}},{label:(0,o.__)("Total"),value:function(e){return e.total}},{label:(0,o.__)("Tendered"),value:function(e){return e.tendered}}]),this.columns.rightColumn=r.kq.applyFilters("ns-pending-orders-right-column",[{label:(0,o.__)("Customer"),value:function(e){return e.nexopos_customers_name}},{label:(0,o.__)("Date"),value:function(e){return e.created_at}},{label:(0,o.__)("Type"),value:function(e){return e.type}}])},name:"ns-pos-pending-order",methods:{__:o.__,previewOrder:function(e){this.$emit("previewOrder",e)},proceedOpenOrder:function(e){this.$emit("proceedOpenOrder",e)},searchOrder:function(){this.$emit("searchOrder",this.searchField)},printOrder:function(e){this.$emit("printOrder",e)}}};const d=(0,l.Z)(u,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-auto flex-col overflow-hidden"},[s("div",{staticClass:"p-1"},[s("div",{staticClass:"flex rounded border-2 input-group info"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchField,expression:"searchField"}],staticClass:"p-2 outline-none flex-auto",attrs:{type:"text"},domProps:{value:e.searchField},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.searchOrder()},input:function(t){t.target.composing||(e.searchField=t.target.value)}}}),e._v(" "),s("button",{staticClass:"w-16 md:w-24",on:{click:function(t){return e.searchOrder()}}},[s("i",{staticClass:"las la-search"}),e._v(" "),s("span",{staticClass:"mr-1 hidden md:visible"},[e._v(e._s(e.__("Search")))])])])]),e._v(" "),s("div",{staticClass:"overflow-y-auto flex flex-auto"},[s("div",{staticClass:"flex p-2 flex-auto flex-col overflow-y-auto"},[e._l(e.orders,(function(t){return s("div",{key:t.id,staticClass:"border-b ns-box-body w-full py-2",attrs:{"data-order-id":t.id}},[s("h3",{staticClass:"text-primary"},[e._v(e._s(t.title||"Untitled Order"))]),e._v(" "),s("div",{staticClass:"px-2"},[s("div",{staticClass:"flex flex-wrap -mx-4"},[s("div",{staticClass:"w-full md:w-1/2 px-2"},e._l(e.columns.leftColumn,(function(n,r){return s("p",{key:r,staticClass:"text-sm text-primary"},[s("strong",[e._v(e._s(n.label))]),e._v(" : "+e._s(n.value(t)))])})),0),e._v(" "),s("div",{staticClass:"w-full md:w-1/2 px-2"},e._l(e.columns.rightColumn,(function(n,r){return s("p",{key:r,staticClass:"text-sm text-primary"},[s("strong",[e._v(e._s(n.label))]),e._v(" : "+e._s(n.value(t)))])})),0)])]),e._v(" "),s("div",{staticClass:"flex justify-end w-full mt-2"},[s("div",{staticClass:"flex rounded-lg overflow-hidden ns-buttons"},[s("button",{staticClass:"info outline-none px-2 py-1",on:{click:function(s){return e.proceedOpenOrder(t)}}},[s("i",{staticClass:"las la-lock-open"}),e._v(" "+e._s(e.__("Open")))]),e._v(" "),s("button",{staticClass:"success outline-none px-2 py-1",on:{click:function(s){return e.previewOrder(t)}}},[s("i",{staticClass:"las la-eye"}),e._v(" "+e._s(e.__("Products")))]),e._v(" "),s("button",{staticClass:"warning outline-none px-2 py-1",on:{click:function(s){return e.printOrder(t)}}},[s("i",{staticClass:"las la-print"}),e._v(" "+e._s(e.__("Print")))])])])])})),e._v(" "),0===e.orders.length?s("div",{staticClass:"h-full v-full items-center justify-center flex"},[s("h3",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Nothing to display...")))])]):e._e()],2)])])}),[],!1,null,null,null).exports;var p=s(6386),f=s(8603);const v={components:{nsPosPendingOrders:d},methods:{__:o.__,popupResolver:p.Z,popupCloser:f.Z,searchOrder:function(e){var t=this;r.ih.get("/api/nexopos/v4/crud/".concat(this.active,"?search=").concat(e)).subscribe((function(e){t.orders=e.data}))},setActiveTab:function(e){this.active=e,this.loadOrderFromType(e)},openOrder:function(e){POS.loadOrder(e.id),this.$popup.close()},loadOrderFromType:function(e){var t=this;r.ih.get("/api/nexopos/v4/crud/".concat(e)).subscribe((function(e){t.orders=e.data}))},previewOrder:function(e){var t=this;new Promise((function(t,s){Popup.show(c,{order:e,resolve:t,reject:s})})).then((function(s){t.proceedOpenOrder(e)}),(function(e){return e}))},printOrder:function(e){POS.printOrder(e.id)},proceedOpenOrder:function(e){var t=this;if(POS.products.getValue().length>0)return Popup.show(i.default,{title:"Confirm Your Action",message:"The cart is not empty. Opening an order will clear your cart would you proceed ?",onAction:function(s){s&&t.openOrder(e)}});this.openOrder(e)}},data:function(){return{active:"ns.hold-orders",searchField:"",orders:[]}},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&e.$popup.close()})),this.loadOrderFromType(this.active),this.popupCloser()}};const h=(0,l.Z)(v,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg ns-box w-6/7-screen md:w-3/5-screen lg:w-2/5-screen h-6/7-screen flex flex-col overflow-hidden"},[s("div",{staticClass:"p-2 flex justify-between text-primary items-center ns-box-header border-b"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Orders")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.$popup.close()}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 flex overflow-hidden flex-auto ns-box-body"},[s("ns-tabs",{attrs:{active:e.active},on:{changeTab:function(t){return e.setActiveTab(t)}}},[s("ns-tabs-item",{staticClass:"flex flex-col overflow-hidden",attrs:{identifier:"ns.hold-orders",label:e.__("On Hold"),padding:"p-0"}},[s("ns-pos-pending-orders",{attrs:{orders:e.orders},on:{searchOrder:function(t){return e.searchOrder(t)},previewOrder:function(t){return e.previewOrder(t)},printOrder:function(t){return e.printOrder(t)},proceedOpenOrder:function(t){return e.proceedOpenOrder(t)}}})],1),e._v(" "),s("ns-tabs-item",{staticClass:"flex flex-col overflow-hidden",attrs:{identifier:"ns.unpaid-orders",label:e.__("Unpaid"),padding:"p-0"}},[s("ns-pos-pending-orders",{attrs:{orders:e.orders},on:{searchOrder:function(t){return e.searchOrder(t)},previewOrder:function(t){return e.previewOrder(t)},printOrder:function(t){return e.printOrder(t)},proceedOpenOrder:function(t){return e.proceedOpenOrder(t)}}})],1),e._v(" "),s("ns-tabs-item",{staticClass:"flex flex-col overflow-hidden",attrs:{identifier:"ns.partially-paid-orders",label:e.__("Partially Paid"),padding:"p-0"}},[s("ns-pos-pending-orders",{attrs:{orders:e.orders},on:{searchOrder:function(t){return e.searchOrder(t)},previewOrder:function(t){return e.previewOrder(t)},printOrder:function(t){return e.printOrder(t)},proceedOpenOrder:function(t){return e.proceedOpenOrder(t)}}})],1)],1)],1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[s("div"),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"}},[e._v(e._s(e.__("Close")))])],1)])])}),[],!1,null,null,null).exports,m={name:"ns-pos-pending-orders-button",methods:{__:o.__,openPendingOrdersPopup:function(){(new n.G).open(h)}}};const _=(0,l.Z)(m,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button default"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.openPendingOrdersPopup()}}},[s("i",{staticClass:"mr-1 text-xl lar la-hand-pointer"}),e._v(" "),s("span",[e._v(e._s(e.__("Orders")))])])])}),[],!1,null,null,null).exports},9433:(e,t,s)=>{"use strict";s.d(t,{Z:()=>T});var n=s(7757),r=s.n(n),i=s(9671),o=s(4864),a=s(7266),l=s(8603),c=s(3601),u=s(7389);const d={components:{nsNumpad:o.Z},data:function(){return{amount:0,title:null,identifier:null,settingsSubscription:null,settings:null,action:null,register:null,loaded:!1,register_id:null,validation:new a.Z,fields:[]}},mounted:function(){var e=this;this.title=this.$popupParams.title,this.identifier=this.$popupParams.identifier,this.register=this.$popupParams.register,this.action=this.$popupParams.action,this.register_id=this.$popupParams.register_id,this.settingsSubscription=POS.settings.subscribe((function(t){e.settings=t})),this.loadFields()},destroyed:function(){this.settingsSubscription.unsubscribe()},methods:{popupCloser:l.Z,__:u.__,definedValue:function(e){this.amount=e},close:function(){this.$popup.close()},loadFields:function(){var e=this;this.loaded=!1,nsHttpClient.get("/api/nexopos/v4/fields/".concat(this.identifier)).subscribe((function(t){e.loaded=!0,e.fields=t}),(function(t){return e.loaded=!0,nsSnackBar.error(t.message,"OKAY",{duration:!1}).subscribe()}))},submit:function(e){var t=this;Popup.show(c.default,{title:"Confirm Your Action",message:this.$popupParams.confirmMessage||"Would you like to confirm your action.",onAction:function(e){e&&t.triggerSubmit()}})},triggerSubmit:function(){var e=this,t=this.validation.extractFields(this.fields);t.amount=""===this.amount?0:this.amount,nsHttpClient.post("/api/nexopos/v4/cash-registers/".concat(this.action,"/").concat(this.register_id||this.settings.register.id),t).subscribe({next:function(t){e.$popupParams.resolve(t),e.$popup.close(),nsSnackBar.success(t.message).subscribe()},error:function(e){nsSnackBar.error(e.message).subscribe()}})}}};var p=s(1900);const f=(0,p.Z)(d,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.loaded?s("div",{staticClass:"shadow-lg w-95vw md:w-2/5-screen ns-box"},[s("div",{staticClass:"border-b ns-box-header p-2 text-primary flex justify-between items-center"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.title))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"p-2"},[null!==e.register?s("div",{staticClass:"mb-2 p-3 elevation-surface font-bold border text-right flex justify-between"},[s("span",[e._v(e._s(e.__("Balance"))+" ")]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.register.balance)))])]):e._e(),e._v(" "),s("div",{staticClass:"mb-2 p-3 elevation-surface success border font-bold text-right flex justify-between"},[s("span",[e._v(e._s(e.__("Input")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.amount)))])]),e._v(" "),s("div",{staticClass:"mb-2"},[s("ns-numpad",{attrs:{floating:!0,value:e.amount},on:{next:function(t){return e.submit(t)},changed:function(t){return e.definedValue(t)}}})],1),e._v(" "),e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})}))],2)]):e._e(),e._v(" "),e.loaded?e._e():s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1)])}),[],!1,null,null,null).exports;var v=s(6386);function h(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}const m={components:{nsNumpad:o.Z},data:function(){return{registers:[],priorVerification:!1,hasLoadedRegisters:!1,validation:new a.Z,amount:0,settings:null,settingsSubscription:null}},mounted:function(){var e=this;this.checkUsedRegister(),this.settingsSubscription=POS.settings.subscribe((function(t){e.settings=t}))},beforeDestroy:function(){this.settingsSubscription.unsubscribe()},computed:{},methods:{__:u.__,popupResolver:v.Z,selectRegister:function(e){var t,s=this;return(t=r().mark((function t(){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("closed"===e.status){t.next=2;break}return t.abrupt("return",i.kX.error((0,u.__)("Unable to open this register. Only closed register can be opened.")).subscribe());case 2:return t.prev=2,t.next=5,new Promise((function(t,s){var n=(0,u.__)("Open Register : %s").replace("%s",e.name),r=e.id;Popup.show(f,{resolve:t,reject:s,title:n,identifier:"ns.cash-registers-opening",register:e,action:"open",register_id:r})}));case 5:n=t.sent,s.popupResolver(n),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),console.log(t.t0);case 12:case"end":return t.stop()}}),t,null,[[2,9]])})),function(){var e=this,s=arguments;return new Promise((function(n,r){var i=t.apply(e,s);function o(e){h(i,n,r,o,a,"next",e)}function a(e){h(i,n,r,o,a,"throw",e)}o(void 0)}))})()},checkUsedRegister:function(){var e=this;this.priorVerification=!1,i.ih.get("/api/nexopos/v4/cash-registers/used").subscribe({next:function(t){e.$popupParams.resolve(t),e.$popup.close()},error:function(t){e.priorVerification=!0,i.kX.error(t.message).subscribe(),e.loadRegisters()}})},loadRegisters:function(){var e=this;this.hasLoadedRegisters=!1,i.ih.get("/api/nexopos/v4/cash-registers").subscribe((function(t){e.registers=t,e.hasLoadedRegisters=!0}))},getClass:function(e){switch(e.status){case"in-use":return"elevation-surface warning cursor-not-allowed";case"disabled":return"elevation-surface cursor-not-allowed";case"available":return"elevation-surface success"}return"elevation-surface hoverable cursor-pointer"}}};const _=(0,p.Z)(m,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[!1===e.priorVerification?s("div",{staticClass:"h-full w-full py-10 flex justify-center items-center"},[s("ns-spinner",{attrs:{size:"24",border:"8"}})],1):e._e(),e._v(" "),e.priorVerification?s("div",{staticClass:"w-95vw md:w-3/5-screen lg:w-3/5-screen xl:w-2/5-screen flex flex-col overflow-hidden",class:e.priorVerification?"shadow-lg ns-box":"",attrs:{id:"ns-pos-cash-registers-popup"}},[[s("div",{staticClass:"title p-2 border-b ns-box-header flex justify-between items-center"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Open The Register")))]),e._v(" "),e.settings?s("div",[s("a",{staticClass:"rounded-full border ns-close-button px-3 text-sm py-1",attrs:{href:e.settings.urls.orders_url}},[e._v(e._s(e.__("Exit To Orders")))])]):e._e()]),e._v(" "),e.hasLoadedRegisters?e._e():s("div",{staticClass:"py-10 flex-auto overflow-y-auto flex items-center justify-center"},[s("ns-spinner",{attrs:{size:"16",border:"4"}})],1),e._v(" "),e.hasLoadedRegisters?s("div",{staticClass:"flex-auto overflow-y-auto"},[s("div",{staticClass:"grid grid-cols-3"},e._l(e.registers,(function(t,n){return s("div",{key:n,staticClass:"border flex items-center justify-center flex-col p-3",class:e.getClass(t),on:{click:function(s){return e.selectRegister(t)}}},[s("i",{staticClass:"las la-cash-register text-6xl"}),e._v(" "),s("h3",{staticClass:"text-semibold text-center"},[e._v(e._s(t.name))]),e._v(" "),s("span",{staticClass:"text-sm"},[e._v("("+e._s(t.status_label)+")")])])})),0),e._v(" "),0===e.registers.length?s("div",{staticClass:"p-2 alert text-white"},[e._v("\n "+e._s(e.__("Looks like there is no registers. At least one register is required to proceed."))+" — "),s("a",{staticClass:"font-bold hover:underline",attrs:{href:e.settings.urls.registers_url}},[e._v(e._s(e.__("Create Cash Register")))])]):e._e()]):e._e()]],2):e._e()])}),[],!1,null,null,null).exports;const b={data:function(){return{totalIn:0,totalOut:0,settings:null,settingsSubscription:null,histories:[]}},mounted:function(){var e=this;this.settingsSubscription=POS.settings.subscribe((function(t){e.settings=t})),this.getHistory()},destroyed:function(){this.settingsSubscription.unsubscribe()},methods:{__:u.__,popupResolver:v.Z,closePopup:function(){this.popupResolver({status:"success"})},getHistory:function(){var e=this;i.ih.get("/api/nexopos/v4/cash-registers/session-history/".concat(this.settings.register.id)).subscribe((function(t){e.histories=t,e.totalIn=e.histories.filter((function(e){return["register-opening","register-sale","register-cash-in"].includes(e.action)})).map((function(e){return parseFloat(e.value)})).reduce((function(e,t){return e+t}),0),e.totalOut=e.histories.filter((function(e){return["register-closing","register-refund","register-cash-out"].includes(e.action)})).map((function(e){return parseFloat(e.value)})).reduce((function(e,t){return e+t}),0),console.log(e.totalOut)}))}}};const y=(0,p.Z)(b,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow-lg w-95vw md:w-4/6-screen lg:w-half overflow-hidden"},[s("div",{staticClass:"p-2 flex justify-between items-center ns-box-header",attrs:{id:"header"}},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Register History")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:e.closePopup}})],1)]),e._v(" "),s("div",{staticClass:"flex w-full ns-box-body"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"w-full md:w-1/2 text-right bg-success-primary text-white font-bold text-3xl p-3"},[e._v(e._s(e._f("currency")(e.totalIn)))]),e._v(" "),s("div",{staticClass:"w-full md:w-1/2 text-right bg-error-primary text-white font-bold text-3xl p-3"},[e._v(e._s(e._f("currency")(e.totalOut)))])])]),e._v(" "),s("div",{staticClass:"flex flex-col overflow-y-auto h-120"},[e._l(e.histories,(function(t){return[["register-sale","register-cash-in"].includes(t.action)?s("div",{key:t.id,staticClass:"flex border-b elevation-surface success"},[s("div",{staticClass:"p-2 flex-auto"},[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex-auto text-right p-2"},[e._v(e._s(e._f("currency")(t.value)))])]):e._e(),e._v(" "),["register-opening"].includes(t.action)?s("div",{key:t.id,staticClass:"flex border-b elevation-surface"},[s("div",{staticClass:"p-2 flex-auto"},[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex-auto text-right p-2"},[e._v(e._s(e._f("currency")(t.value)))])]):e._e(),e._v(" "),["register-close"].includes(t.action)?s("div",{key:t.id,staticClass:"flex border-b elevation-surface info"},[s("div",{staticClass:"p-2 flex-auto"},[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex-auto text-right p-2"},[e._v(e._s(e._f("currency")(t.value)))])]):e._e(),e._v(" "),["register-refund","register-cash-out"].includes(t.action)?s("div",{key:t.id,staticClass:"flex border-b elevation-surface error"},[s("div",{staticClass:"p-2 flex-auto"},[e._v(e._s(t.label))]),e._v(" "),s("div",{staticClass:"flex-auto text-right p-2"},[e._v(e._s(e._f("currency")(t.value)))])]):e._e()]}))],2)])}),[],!1,null,null,null).exports;function g(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function x(e){for(var t=1;t0&&i.kX.error(t.t0.message).subscribe();case 10:case"end":return t.stop()}}),t,null,[[0,7]])})))()},registerInitialQueue:function(){var e=this;POS.initialQueue.push(S(r().mark((function t(){var s;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,new Promise((function(t,s){void 0===e.settings.register&&Popup.show(_,{resolve:t,reject:s})}));case 3:return s=t.sent,POS.set("register",s.data.register),e.setRegister(s.data.register),t.abrupt("return",s);case 9:throw t.prev=9,t.t0=t.catch(0),t.t0;case 12:case"end":return t.stop()}}),t,null,[[0,9]])}))))},setButtonName:function(){if(void 0===this.settings.register)return this.name=(0,u.__)("Cash Register");this.name=(0,u.__)("Cash Register : {register}").replace("{register}",this.settings.register.name)},setRegister:function(e){if(void 0!==e){var t=POS.order.getValue();t.register_id=e.id,POS.order.next(t)}}},destroyed:function(){this.orderSubscriber.unsubscribe(),this.settingsSubscriber.unsubscribe()},mounted:function(){var e=this;this.registerInitialQueue(),this.orderSubscriber=POS.order.subscribe((function(t){e.order=t})),this.settingsSubscriber=POS.settings.subscribe((function(t){e.settings=t,e.setRegister(e.settings.register),e.setButtonName()}))}};const T=(0,p.Z)($,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button default"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.openRegisterOptions()}}},[s("i",{staticClass:"mr-1 text-xl las la-cash-register"}),e._v(" "),s("span",[e._v(e._s(e.name))])])])}),[],!1,null,null,null).exports},8149:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var n=s(2242),r=(s(1247),s(3601)),i=s(8603);const o={name:"ns-pos-customers-button",mounted:function(){this.popupCloser()},methods:{__,popupCloser:i.Z,reset:function(){n.G.show(r.default,{title:__("Confirm Your Action"),message:__("The current order will be cleared. But not deleted if it's persistent. Would you like to proceed ?"),onAction:function(e){e&&POS.reset()}})}}};const a=(0,s(1900).Z)(o,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-button error"},[s("button",{staticClass:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm",on:{click:function(t){return e.reset()}}},[s("i",{staticClass:"mr-1 text-xl las la-eraser"}),e._v(" "),s("span",[e._v(e._s(e.__("Reset")))])])])}),[],!1,null,null,null).exports},9110:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>r});const n={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){var e=this;this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(void 0!==e.$popupParams.onAction&&e.$popupParams.onAction(!1),e.$popup.close())}))},methods:{__:s(7389).__,emitAction:function(e){void 0!==this.$popupParams.onAction&&this.$popupParams.onAction(e),this.$popup.close()}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-6/7-screen md:w-4/7-screen lg:w-3/7-screen flex flex-col shadow-lg",class:e.size,attrs:{id:"alert-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[e.title?s("h2",{staticClass:"text-3xl font-body"},[e._v(e._s(e.title))]):e._e(),e._v(" "),s("p",{staticClass:"py-4 text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"action-buttons flex border-t justify-end items-center p-2"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Ok")))])],1)])}),[],!1,null,null,null).exports},3613:(e,t,s)=>{"use strict";s.d(t,{Z:()=>K});var n=s(7757),r=s.n(n),i=s(9671),o=s(1356),a=s(2277),l=s(7266),c=s(8603),u=s(7389);function d(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function p(e){for(var t=1;tthis.availableQuantity)return i.kX.error("Unable to proceed as the quantity provided is exceed the available quantity.").subscribe();this.product.quantity=parseFloat(e),this.$popupParams.resolve(this.product),this.$popup.close()}}};const g=(0,h.Z)(y,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-xl ns-box overflow-hidden w-95vw md:w-4/6-screen lg:w-3/7-screen"},[s("div",{staticClass:"p-2 flex justify-between ns-box-header"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Quantity")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),e.product?s("div",{staticClass:"border-t border-b ns-box-body py-2 flex items-center justify-center text-2xl font-semibold"},[s("span",[e._v(e._s(e.seeValue))]),e._v(" "),s("span",{staticClass:"text-primary text-sm"},[e._v("("+e._s(e.availableQuantity)+" "+e._s(e.__("available"))+")")])]):e._e(),e._v(" "),e.product?s("div",{staticClass:"flex-auto overflow-y-auto p-2"},[s("ns-numpad",{attrs:{value:e.product.quantity},on:{next:function(t){return e.updateQuantity(t)},changed:function(t){return e.setChangedValue(t)}}})],1):e._e()])}),[],!1,null,null,null).exports;var x=s(3296),w=s(3601),C=s(2242),k=s(1703);function P(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function j(e){for(var t=1;t0?this.refundables.map((function(e){return parseFloat(e.unit_price)*parseFloat(e.quantity)})).reduce((function(e,t){return e+t}))+this.shippingFees:0+this.shippingFees},shippingFees:function(){return this.refundShipping?this.order.shipping:0}},data:function(){return{isSubmitting:!1,formValidation:new l.Z,refundables:[],paymentOptions:[],paymentField:[],print:new k.Z({settings:systemSettings,options:systemOptions,type:"refund"}),refundShipping:!1,selectedPaymentGateway:!1,screen:0,selectFields:[{type:"select",options:this.order.products.map((function(e){return{label:"".concat(e.name," - ").concat(e.unit.name," (x").concat(e.quantity,")"),value:e.id}})),validation:"required",name:"product_id",label:(0,u.__)("Product"),description:(0,u.__)("Select the product to perform a refund.")}]}},methods:{__:u.__,updateScreen:function(e){this.screen=e},toggleRefundShipping:function(e){this.refundShipping=e,this.refundShipping},proceedPayment:function(){var e=this;return!1===this.selectedPaymentGateway?i.kX.error((0,u.__)("Please select a payment gateway before proceeding.")).subscribe():0===this.total?i.kX.error((0,u.__)("There is nothing to refund.")).subscribe():0===this.screenValue?i.kX.error((0,u.__)("Please provide a valid payment amount.")).subscribe():void C.G.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("The refund will be made on the current order."),onAction:function(t){t&&e.doProceed()}})},doProceed:function(){var e=this,t={products:this.refundables,total:this.screenValue,payment:this.selectedPaymentGateway,refund_shipping:this.refundShipping};this.isSubmitting=!0,i.ih.post("/api/nexopos/v4/orders/".concat(this.order.id,"/refund"),t).subscribe({next:function(t){e.isSubmitting=!1,e.$emit("changed",!0),"refunded"===t.data.order.payment_status&&e.$emit("loadTab","details"),e.print.printOrder(t.data.orderRefund.id),i.kX.success(t.message).subscribe()},error:function(t){e.isSubmitting=!1,i.kX.error(t.message).subscribe()}})},addProduct:function(){var e=this;if(this.formValidation.validateFields(this.selectFields),!this.formValidation.fieldsValid(this.selectFields))return i.kX.error((0,u.__)("Please select a product before proceeding.")).subscribe();var t=this.formValidation.extractFields(this.selectFields),s=this.order.products.filter((function(e){return e.id===t.product_id})),n=this.refundables.filter((function(e){return e.id===t.product_id}));if(n.length>0){var r=n.map((function(e){return parseInt(e.quantity)})).reduce((function(e,t){return e+t}));if(r===s[0].quantity)return i.kX.error((0,u.__)("Not enough quantity to proceed.")).subscribe()}if(0===s[0].quantity)return i.kX.error((0,u.__)("Not enough quantity to proceed.")).subscribe();var o=j(j({},s[0]),{condition:"",description:""});new Promise((function(e,t){C.G.show(m,{resolve:e,reject:t,product:o})})).then((function(t){t.quantity=e.getProductOriginalQuantity(t.id)-e.getProductUsedQuantity(t.id),e.refundables.push(t)}),(function(e){return e}))},getProductOriginalQuantity:function(e){var t=this.order.products.filter((function(t){return t.id===e}));return t.length>0?t.map((function(e){return parseFloat(e.quantity)})).reduce((function(e,t){return e+t})):0},getProductUsedQuantity:function(e){var t=this.refundables.filter((function(t){return t.id===e}));return t.length>0?t.map((function(e){return parseFloat(e.quantity)})).reduce((function(e,t){return e+t})):0},openSettings:function(e){var t=this;new Promise((function(t,s){C.G.show(m,{resolve:t,reject:s,product:e})})).then((function(s){var n=t.refundables.indexOf(e);t.$set(t.refundables,n,s)}),(function(e){return e}))},selectPaymentGateway:function(){var e=this;new Promise((function(t,s){C.G.show(x.Z,j({resolve:t,reject:s,value:[e.selectedPaymentOption]},e.paymentField[0]))})).then((function(t){e.selectedPaymentGateway=t[0]}),(function(e){return e}))},changeQuantity:function(e){var t=this;new Promise((function(s,n){var r=t.getProductOriginalQuantity(e.id)-t.getProductUsedQuantity(e.id)+parseFloat(e.quantity);C.G.show(g,{resolve:s,reject:n,product:e,availableQuantity:r})})).then((function(s){if(s.quantity>t.getProductUsedQuantity(e.id)-e.quantity){var n=t.refundables.indexOf(e);t.$set(t.refundables,n,s)}}))},deleteProduct:function(e){var t=this;new Promise((function(s,n){C.G.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to delete this product ?"),onAction:function(s){if(s){var n=t.refundables.indexOf(e);t.refundables.splice(n,1)}}})}))}},mounted:function(){var e=this;this.selectFields=this.formValidation.createFields(this.selectFields),i.ih.get("/api/nexopos/v4/orders/payments").subscribe((function(t){e.paymentField=t}))}};const $=(0,h.Z)(S,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-m-4 flex-auto flex flex-wrap relative"},[e.isSubmitting?s("div",{staticClass:"bg-overlay h-full w-full flex items-center justify-center absolute z-30"},[s("ns-spinner")],1):e._e(),e._v(" "),s("div",{staticClass:"px-4 w-full lg:w-1/2"},[s("h3",{staticClass:"py-2 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Refund With Products")))]),e._v(" "),s("div",{staticClass:"my-2"},[s("ul",[s("li",{staticClass:"border-b border-info-primary flex justify-between items-center mb-2"},[s("div",{staticClass:"flex-auto flex-col flex"},[s("div",{staticClass:"p-2 flex"},e._l(e.selectFields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),s("div",{staticClass:"flex justify-between p-2"},[s("div",{staticClass:"flex items-center text-primary"},[e.order.shipping>0?s("span",{staticClass:"mr-2"},[e._v(e._s(e.__("Refund Shipping")))]):e._e(),e._v(" "),e.order.shipping>0?s("ns-checkbox",{attrs:{checked:e.refundShipping},on:{change:function(t){return e.toggleRefundShipping(t)}}}):e._e()],1),e._v(" "),s("div",[s("button",{staticClass:"border rounded-full px-2 py-1 ns-inset-button info",on:{click:function(t){return e.addProduct()}}},[e._v(e._s(e.__("Add Product")))])])])])]),e._v(" "),s("li",[s("h4",{staticClass:"py-1 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Products")))])]),e._v(" "),e._l(e.refundables,(function(t){return s("li",{key:t.id,staticClass:"elevation-surface border flex justify-between items-center mb-2"},[s("div",{staticClass:"px-2 text-primary flex justify-between flex-auto"},[s("div",{staticClass:"flex flex-col"},[s("p",{staticClass:"py-2"},[s("span",[e._v(e._s(t.name))]),e._v(" "),"damaged"===t.condition?s("span",{staticClass:"rounded-full px-2 py-1 text-xs bg-error-tertiary mx-2 text-white"},[e._v(e._s(e.__("Damaged")))]):e._e(),e._v(" "),"unspoiled"===t.condition?s("span",{staticClass:"rounded-full px-2 py-1 text-xs bg-success-tertiary mx-2 text-white"},[e._v(e._s(e.__("Unspoiled")))]):e._e()]),e._v(" "),s("small",[e._v(e._s(t.unit.name))])]),e._v(" "),s("div",{staticClass:"flex items-center justify-center"},[s("span",{staticClass:"py-1 flex items-center cursor-pointer border-b border-dashed border-info-primary"},[e._v(e._s(e._f("currency")(t.unit_price*t.quantity)))])])]),e._v(" "),s("div",{staticClass:"flex"},[s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.openSettings(t)}}},[s("i",{staticClass:"las la-cog text-xl"})]),e._v(" "),s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.deleteProduct(t)}}},[s("i",{staticClass:"las la-trash"})]),e._v(" "),s("p",{staticClass:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center",on:{click:function(s){return e.changeQuantity(t)}}},[e._v(e._s(t.quantity))])])])}))],2)])]),e._v(" "),s("div",{staticClass:"px-4 w-full lg:w-1/2"},[s("h3",{staticClass:"py-2 border-b-2 text-primary border-info-primary"},[e._v(e._s(e.__("Summary")))]),e._v(" "),s("div",{staticClass:"py-2"},[s("div",{staticClass:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Total")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.total)))])]),e._v(" "),s("div",{staticClass:"elevation-surface border success font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Paid")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.tendered)))])]),e._v(" "),s("div",{staticClass:"elevation-surface border info font-semibold flex mb-2 p-2 justify-between cursor-pointer",on:{click:function(t){return e.selectPaymentGateway()}}},[s("span",[e._v(e._s(e.__("Payment Gateway")))]),e._v(" "),s("span",[e._v(e._s(e.selectedPaymentGateway?e.selectedPaymentGateway.label:"N/A"))])]),e._v(" "),s("div",{staticClass:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"},[s("span",[e._v(e._s(e.__("Screen")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.screenValue)))])]),e._v(" "),s("div",[s("ns-numpad",{attrs:{currency:!0,value:e.screen},on:{changed:function(t){return e.updateScreen(t)},next:function(t){return e.proceedPayment(t)}}})],1)])])])}),[],!1,null,null,null).exports;var T=s(9089);function E(e,t){for(var s=0;s0?t[0].label:(0,u.__)("Unknown Status")}},{key:"getDeliveryStatus",value:function(e){var t=deliveryStatuses.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,u.__)("Unknown Status")}},{key:"getProcessingStatus",value:function(e){var t=processingStatuses.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,u.__)("Unknown Status")}},{key:"getPaymentStatus",value:function(e){var t=paymentLabels.filter((function(t){return t.value===e}));return t.length>0?t[0].label:(0,u.__)("Unknown Status")}}])&&E(t.prototype,s),n&&E(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function V(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function F(e){for(var t=1;t0?s("span",[e._v(e._s(e._f("currency")(e.order.total-e.order.tendered)))]):e._e(),e._v(" "),e.order.total-e.order.tendered<=0?s("span",[e._v(e._s(e._f("currency")(0)))]):e._e()])]),e._v(" "),s("div",{staticClass:"px-2 w-full md:w-1/2"},[s("div",{staticClass:"my-1 h-12 py-1 px-2 flex justify-between items-center elevation-surface warning border text-xl font-bold"},[s("span",[e._v(e._s(e.__("Customer Account")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(e.order.customer.account_amount)))])])])]),e._v(" "),s("div",{staticClass:"flex -mx-4 flex-wrap"},[s("div",{staticClass:"px-2 w-full mb-4 md:w-1/2"},["paid"!==e.order.payment_status?s("div",[s("h3",{staticClass:"font-semibold border-b-2 border-info-primary py-2"},[e._v("\n "+e._s(e.__("Payment"))+"\n ")]),e._v(" "),s("div",{staticClass:"py-2"},[e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),e._v(" "),s("div",{staticClass:"my-2 px-2 h-12 flex justify-end items-center border elevation-surface"},[e._v("\n "+e._s(e._f("currency")(e.inputValue))+"\n ")]),e._v(" "),s("ns-numpad",{attrs:{floating:!0,value:e.inputValue},on:{next:function(t){return e.submitPayment(t)},changed:function(t){return e.updateValue(t)}}})],2)]):e._e(),e._v(" "),"paid"===e.order.payment_status?s("div",{staticClass:"flex items-center justify-center h-full"},[s("h3",{staticClass:"text-primary font-semibold"},[e._v(e._s(e.__("No payment possible for paid order.")))])]):e._e()]),e._v(" "),s("div",{staticClass:"px-2 w-full mb-4 md:w-1/2"},[s("h3",{staticClass:"font-semibold border-b-2 border-info-primary py-2 mb-2"},[e._v("\n "+e._s(e.__("Payment History"))+"\n ")]),e._v(" "),s("ul",e._l(e.order.payments,(function(t){return s("li",{key:t.id,staticClass:"p-2 flex items-center justify-between text-shite border elevation-surface mb-2"},[s("span",[e._v(e._s(e.paymentsLabels[t.identifier]||e.__("Unknown")))]),e._v(" "),s("span",[e._v(e._s(e._f("currency")(t.value)))])])})),0)])])])}),[],!1,null,null,null).exports;var R=s(3306);const L={props:["order"],data:function(){return{processingStatuses,deliveryStatuses,labels:new D,showProcessingSelect:!1,showDeliverySelect:!1}},mounted:function(){},methods:{__:u.__,submitProcessingChange:function(){var e=this;C.G.show(w.default,{title:(0,u.__)("Would you proceed ?"),message:(0,u.__)("The processing status of the order will be changed. Please confirm your action."),onAction:function(t){t&&i.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/processing"),{process_status:e.order.process_status}).subscribe({next:function(t){e.showProcessingSelect=!1,i.kX.success(t.message).subscribe()},error:function(e){i.kX.error(e.message||(0,u.__)("Unexpected error occured.")).subscribe()}})}})},openRefunds:function(){var e=this;try{new Promise((function(t,s){var n=e.order;C.G.show(R.Z,{order:n,resolve:t,reject:s})}))}catch(e){}},submitDeliveryStatus:function(){var e=this;C.G.show(w.default,{title:(0,u.__)("Would you proceed ?"),message:(0,u.__)("The delivery status of the order will be changed. Please confirm your action."),onAction:function(t){t&&i.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/delivery"),{delivery_status:e.order.delivery_status}).subscribe({next:function(t){e.showDeliverySelect=!1,i.kX.success(t.message).subscribe()},error:function(e){i.kX.error(e.message||(0,u.__)("Unexpected error occured.")).subscribe()}})}})}}};const I=(0,h.Z)(L,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-mx-4 flex flex-wrap"},[s("div",{staticClass:"flex-auto"},[s("div",{staticClass:"w-full mb-2 flex-wrap flex"},[s("div",{staticClass:"w-full mb-2 px-4"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Payment Summary")))])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"elevation-surface border p-2 flex justify-between items-start"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Sub Total")))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(e.order.subtotal)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice error"},[s("div",[s("h4",{staticClass:"text-semibold"},[s("span",{staticClass:"text-white"},[e._v(e._s(e.__("Discount")))]),e._v(" "),"percentage"===e.order.discount_type?s("span",{staticClass:"text-white ml-1"},[e._v("("+e._s(e.order.discount_percentage)+"%)")]):e._e(),e._v(" "),"flat"===e.order.discount_type?s("span",{staticClass:"text-white ml-1"},[e._v("(Flat)")]):e._e()])]),e._v(" "),s("div",{staticClass:"font-semibold"},[s("span",[e._v(e._s(e._f("currency")(e.order.discount)))])])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(e.__("Shipping")))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(e.order.shipping)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice error"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v("\n "+e._s(e.__("Coupons"))+"\n ")])]),e._v(" "),s("div",{staticClass:"font-semibold"},[s("span",[e._v(e._s(e._f("currency")(e.order.total_coupons)))])])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice info"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Total")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.total)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start ns-notice warning"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Taxes")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.tax_value)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start text-primary elevation-surface error border"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Change")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.change)))])])]),e._v(" "),s("div",{staticClass:"mb-2 w-full md:w-1/2 px-4"},[s("div",{staticClass:"p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold"},[e._v(e._s(e.__("Paid")))])]),e._v(" "),s("div",{staticClass:"font-semibold"},[e._v(e._s(e._f("currency")(e.order.tendered)))])])])])]),e._v(" "),s("div",{staticClass:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},[s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Order Status")))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Customer")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.order.nexopos_customers_name))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Type")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.labels.getTypeLabel(e.order.type)))])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Delivery Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},[s("div",{staticClass:"w-full text-center"},[e.showDeliverySelect?e._e():s("span",{staticClass:"font-semibold text-secondary border-b border-info-primary cursor-pointer border-dashed",on:{click:function(t){e.showDeliverySelect=!0}}},[e._v(e._s(e.labels.getDeliveryStatus(e.order.delivery_status)))])]),e._v(" "),e.showDeliverySelect?s("div",{staticClass:"flex-auto flex"},[s("div",{staticClass:"ns-select flex items-center justify-center"},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.order.delivery_status,expression:"order.delivery_status"}],ref:"process_status",staticClass:"flex-auto border-info-primary rounded-lg",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.order,"delivery_status",t.target.multiple?s:s[0])}}},e._l(e.deliveryStatuses,(function(t,n){return s("option",{key:n,domProps:{value:t.value}},[e._v(e._s(t.label))])})),0)]),e._v(" "),s("div",{staticClass:"pl-2 flex"},[s("ns-close-button",{on:{click:function(t){e.showDeliverySelect=!1}}}),e._v(" "),s("button",{staticClass:"bg-success-primary text-white rounded-full px-2 py-1",on:{click:function(t){return e.submitDeliveryStatus(e.order)}}},[e._v(e._s(e.__("Save")))])],1)]):e._e()])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex flex-col md:flex-row justify-between items-center elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Processing Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},[s("div",{staticClass:"w-full text-center"},[e.showProcessingSelect?e._e():s("span",{staticClass:"border-b border-info-primary cursor-pointer border-dashed",on:{click:function(t){e.showProcessingSelect=!0}}},[e._v(e._s(e.labels.getProcessingStatus(e.order.process_status)))])]),e._v(" "),e.showProcessingSelect?s("div",{staticClass:"flex-auto flex"},[s("div",{staticClass:"ns-select flex items-center justify-center"},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.order.process_status,expression:"order.process_status"}],ref:"process_status",staticClass:"flex-auto border-info-primary rounded-lg",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.order,"process_status",t.target.multiple?s:s[0])}}},e._l(e.processingStatuses,(function(t,n){return s("option",{key:n,domProps:{value:t.value}},[e._v(e._s(t.label))])})),0)]),e._v(" "),s("div",{staticClass:"pl-2 flex"},[s("ns-close-button",{on:{click:function(t){e.showProcessingSelect=!1}}}),e._v(" "),s("button",{staticClass:"bg-success-primary text-white rounded-full px-2 py-1",on:{click:function(t){return e.submitProcessingChange(e.order)}}},[e._v(e._s(e.__("Save")))])],1)]):e._e()])]),e._v(" "),s("div",{staticClass:"mb-2 p-2 flex justify-between items-start elevation-surface border"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[s("span",[e._v(e._s(e.__("Payment Status")))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e.labels.getPaymentStatus(e.order.payment_status)))])])]),e._v(" "),s("div",{staticClass:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},[s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Products")))])]),e._v(" "),e._l(e.order.products,(function(t){return s("div",{key:t.id,staticClass:"p-2 flex justify-between items-start elevation-surface border mb-6"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(t.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-secondary text-sm"},[e._v(e._s(t.unit.name||"N/A"))])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(t.total_price)))])])})),e._v(" "),s("div",{staticClass:"mb-2"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary flex justify-between"},[s("span",[e._v(e._s(e.__("Refunded Products")))]),e._v(" "),s("a",{staticClass:"border-b border-info-primary border-dashed",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.openRefunds()}}},[e._v(e._s(e.__("All Refunds")))])])]),e._v(" "),e._l(e.order.refunded_products,(function(t){return s("div",{key:t.id,staticClass:"p-2 flex justify-between items-start elevation-surface border mb-6"},[s("div",[s("h4",{staticClass:"text-semibold text-primary"},[e._v(e._s(t.order_product.name)+" (x"+e._s(t.quantity)+")")]),e._v(" "),s("p",{staticClass:"text-secondary text-sm"},[e._v(e._s(t.unit.name||"N/A")+" | "),s("span",{staticClass:"rounded-full px-2",class:"damaged"===t.condition?"bg-error-tertiary text-white":"bg-info-tertiary text-white"},[e._v(e._s(t.condition))])])]),e._v(" "),s("div",{staticClass:"font-semibold text-secondary"},[e._v(e._s(e._f("currency")(t.total_price)))])])}))],2)])}),[],!1,null,null,null).exports;function H(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function M(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const X={name:"ns-order-instalments-payment",components:{nsNotice:s(7975).nsNotice},data:function(){return{paymentTypes,fields:[{type:"select",name:"payment_type",description:(0,u.__)("Select the payment type that must apply to the current order."),label:(0,u.__)("Payment Type"),validation:"required",options:paymentTypes}],print:new k.Z({settings:systemSettings,options:systemOptions,type:"payment"}),validation:new l.Z,order:null,instalment:null}},methods:{__:u.__,popupResolver:_.Z,popupCloser:c.Z,close:function(){this.popupResolver(!1)},updateInstalmentAsDue:function(e){var t=this;nsHttpClient.put("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments/").concat(this.instalment.id,"/"),{instalment:{date:ns.date.moment.format("YYYY-MM-DD HH:mm:ss")}}).subscribe({next:function(e){t.submitPayment()},error:function(e){i.kX.error(e.message||(0,u.__)("An unexpected error has occured")).subscribe()}})},submitPayment:function(){var e=this;if(!this.validation.validateFields(this.fields))return i.kX.error(__m("The form is not valid.")).subcribe();nsHttpClient.post("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments/").concat(this.instalment.id,"/pay"),function(e){for(var t=1;t0?this.instalments.map((function(e){return e.amount})).reduce((function(e,t){return parseFloat(e)+parseFloat(t)})):0}},methods:{__:u.__,loadInstalments:function(){var e=this;i.ih.get("/api/nexopos/v4/orders/".concat(this.order.id,"/instalments")).subscribe((function(t){e.original=t,e.instalments=t.map((function(e){return e.price_clicked=!1,e.date_clicked=!1,e.date=moment(e.date).format("YYYY-MM-DD"),e}))}))},showReceipt:function(e){if(null===e.payment_id)return i.kX.error((0,u.__)("This instalment doesn't have any payment attached.")).subscribe();this.print.printOrder(e.payment_id)},addInstalment:function(){this.instalments.push({date:ns.date.moment.format("YYYY-MM-DD"),amount:this.order.total-this.totalInstalments,paid:!1})},createInstalment:function(e){var t=this;Popup.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to create this instalment ?"),onAction:function(s){s&&i.ih.post("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments"),{instalment:e}).subscribe({next:function(e){t.loadInstalments(),i.kX.success(e.message).subscribe()},error:function(e){i.kX.error(e.message||(0,u.__)("An unexpected error has occured")).subscribe()}})}})},deleteInstalment:function(e){var t=this;Popup.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to delete this instalment ?"),onAction:function(s){s&&i.ih.delete("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments/").concat(e.id)).subscribe({next:function(s){var n=t.instalments.indexOf(e);t.instalments.splice(n,1),i.kX.success(s.message).subscribe()},error:function(e){i.kX.error(e.message||(0,u.__)("An unexpected error has occured")).subscribe()}})}})},markAsPaid:function(e){var t,s=this;return(t=r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,new Promise((function(t,n){Popup.show(Y,{order:s.order,instalment:e,resolve:t,reject:n})}));case 3:t.sent,s.loadInstalments(),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})),function(){var e=this,s=arguments;return new Promise((function(n,r){var i=t.apply(e,s);function o(e){U(i,n,r,o,a,"next",e)}function a(e){U(i,n,r,o,a,"throw",e)}o(void 0)}))})()},togglePriceEdition:function(e){var t=this;e.paid||(e.price_clicked=!e.price_clicked,this.$forceUpdate(),e.price_clicked&&setTimeout((function(){t.$refs.amount[0].select()}),100))},updateInstalment:function(e){var t=this;Popup.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to update that instalment ?"),onAction:function(s){s&&i.ih.put("/api/nexopos/v4/orders/".concat(t.order.id,"/instalments/").concat(e.id),{instalment:e}).subscribe({next:function(e){i.kX.success(e.message).subscribe()},error:function(e){i.kX.error(e.message||(0,u.__)("An unexpected error has occured")).subscribe()}})}})},toggleDateEdition:function(e){var t=this;e.paid||(e.date_clicked=!e.date_clicked,this.$forceUpdate(),e.date_clicked&&setTimeout((function(){t.$refs.date[0].select()}),200))}}};const z=(0,h.Z)(N,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"-mx-4 flex-auto flex flex-wrap"},[s("div",{staticClass:"flex flex-auto"},[s("div",{staticClass:"w-full mb-2 flex-wrap"},[s("div",{staticClass:"w-full mb-2 px-4"},[s("h3",{staticClass:"font-semibold text-secondary pb-2 border-b border-info-primary"},[e._v(e._s(e.__("Instalments")))])]),e._v(" "),s("div",{staticClass:"px-4"},[s("ul",{staticClass:"border-table-th-edge border-t text-primary"},[e._l(e.instalments,(function(t){return s("li",{key:t.id,staticClass:"border-b border-l flex justify-between elevation-surface",class:t.paid?"success":"info"},[s("span",{staticClass:"p-2"},[t.date_clicked?e._e():s("span",{on:{click:function(s){return e.toggleDateEdition(t)}}},[e._v(e._s(t.date))]),e._v(" "),t.date_clicked?s("span",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.date,expression:"instalment.date"}],ref:"date",refInFor:!0,staticClass:"border border-info-primary rounded",attrs:{type:"date"},domProps:{value:t.date},on:{blur:function(s){return e.toggleDateEdition(t)},input:function(s){s.target.composing||e.$set(t,"date",s.target.value)}}})]):e._e()]),e._v(" "),s("div",{staticClass:"flex items-center"},[s("div",{staticClass:"flex items-center px-2 h-full border-r"},[t.price_clicked?e._e():s("span",{on:{click:function(s){return e.togglePriceEdition(t)}}},[e._v(e._s(e._f("currency")(t.amount)))]),e._v(" "),t.price_clicked?s("span",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.amount,expression:"instalment.amount"}],ref:"amount",refInFor:!0,staticClass:"border border-info-primary p-1",attrs:{type:"text"},domProps:{value:t.amount},on:{blur:function(s){return e.togglePriceEdition(t)},input:function(s){s.target.composing||e.$set(t,"amount",s.target.value)}}})]):e._e()]),e._v(" "),!t.paid&&t.id?s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full border-r"},[s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"success",className:"la-money-bill-wave-alt"},on:{click:function(s){return e.markAsPaid(t)}}})],1),e._v(" "),s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"info",className:"la-save"},on:{click:function(s){return e.updateInstalment(t)}}})],1),e._v(" "),s("div",{staticClass:"px-2"},[s("ns-icon-button",{attrs:{type:"error",className:"la-trash-alt"},on:{click:function(s){return e.deleteInstalment(t)}}})],1)]):e._e(),e._v(" "),t.paid||t.id?e._e():s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full border-r"},[s("div",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"px-3 py-1 rounded-full",on:{click:function(s){return e.createInstalment(t)}}},[s("i",{staticClass:"las la-plus"}),e._v("\n "+e._s(e.__("Create"))+"\n ")])])])]),e._v(" "),t.paid?s("div",{staticClass:"w-36 justify-center flex items-center px-2 h-full"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"px-3 text-xs py-1 rounded-full",on:{click:function(s){return e.showReceipt(t)}}},[s("i",{staticClass:"las la-print"}),e._v("\n "+e._s(e.__("Receipt"))+"\n ")])])]):e._e()])])})),e._v(" "),s("li",{staticClass:"flex justify-between p-2 border-r border-b border-l elevation-surface"},[s("div",{staticClass:"flex items-center justify-center"},[s("span",[e._v("\n "+e._s(e.__("Total :"))+" "+e._s(e._f("currency")(e.order.total))+"\n ")]),e._v(" "),s("span",{staticClass:"ml-1 text-sm"},[e._v("\n ("+e._s(e.__("Remaining :"))+" "+e._s(e._f("currency")(e.order.total-e.totalInstalments))+")\n ")])]),e._v(" "),s("div",{staticClass:"-mx-2 flex flex-wrap items-center"},[s("span",{staticClass:"px-2"},[e._v("\n "+e._s(e.__("Instalments:"))+" "+e._s(e._f("currency")(e.totalInstalments))+"\n ")]),e._v(" "),s("span",{staticClass:"px-2"},[s("div",{staticClass:"ns-button info"},[s("button",{staticClass:"rounded-full px-3 py-1",on:{click:function(t){return e.addInstalment()}}},[e._v(e._s(e.__("Add Instalment")))])])])])])],2)])])])])}),[],!1,null,null,null).exports;function Q(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}function W(e){return function(){var t=this,s=arguments;return new Promise((function(n,r){var i=e.apply(t,s);function o(e){Q(i,n,r,o,a,"next",e)}function a(e){Q(i,n,r,o,a,"throw",e)}o(void 0)}))}}var B={filters:{nsCurrency:o.W},name:"ns-preview-popup",data:function(){return{active:"details",order:new Object,products:[],payments:[],options:null,settings:null}},components:{nsOrderRefund:$,nsOrderPayment:Z,nsOrderDetails:I,nsOrderInstalments:z},computed:{isVoidable:function(){return["paid","partially_paid","unpaid"].includes(this.order.payment_status)},isDeleteAble:function(){return["hold"].includes(this.order.payment_status)}},methods:{__:u.__,popupResolver:_.Z,popupCloser:c.Z,closePopup:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.popupResolver(e)},setActive:function(e){this.active=e},refresh:function(){this.$popupParams.component.$emit("updated"),this.loadOrderDetails(this.order.id)},printOrder:function(){if("default"===this.options.ns_pos_printing_gateway)this.processRegularPrinting(this.order.id);else this.processCustomPrinting(this.order.id,this.options.ns_pos_printing_gateway,!1)},processCustomPrinting:function(e,t){var s=arguments;return W(r().mark((function n(){var o;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o=!(s.length>2&&void 0!==s[2])||s[2],!1===nsHooks.applyFilters(o?"ns-order-custom-print":"ns-order-custom-print-aloud",{printed:!1,order_id:e,gateway:t}).printed&&i.kX.error((0,u.__)("Unsupported print gateway.")).subscribe();case 3:case"end":return n.stop()}}),n)})))()},processRegularPrinting:function(e){var t=document.querySelector("printing-section");t&&t.remove();var s=document.createElement("iframe");s.id="printing-section",s.className="hidden",s.src=this.settings.sale_printing_url.replace("{reference_id}",e),document.body.appendChild(s)},loadOrderDetails:function(e){var t=this;(0,a.D)([i.ih.get("/api/nexopos/v4/orders/".concat(e)),i.ih.get("/api/nexopos/v4/orders/".concat(e,"/products")),i.ih.get("/api/nexopos/v4/orders/".concat(e,"/payments"))]).subscribe((function(e){t.order=e[0],t.products=e[1],t.payments=e[2]}))},deleteOrder:function(){var e=this;Popup.show(w.default,{title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("Would you like to delete this order"),onAction:function(t){t&&i.ih.delete("/api/nexopos/v4/orders/".concat(e.order.id)).subscribe({next:function(t){i.kX.success(t.message).subscribe(),e.refreshCrudTable(),e.closePopup(!0)},error:function(e){i.kX.error(e.message).subscribe()}})}})},voidOrder:function(){var e=this;try{new Promise((function(t,s){Popup.show(T.default,{resolve:t,reject:s,title:(0,u.__)("Confirm Your Action"),message:(0,u.__)("The current order will be void. This action will be recorded. Consider providing a reason for this operation"),onAction:function(t){!1!==t&&i.ih.post("/api/nexopos/v4/orders/".concat(e.order.id,"/void"),{reason:t}).subscribe({next:function(t){i.kX.success(t.message).subscribe(),e.refreshCrudTable(),e.closePopup(!0)},error:function(e){i.kX.error(e.message).subscribe()}})}})}))}catch(e){console.log(e)}},refreshCrudTable:function(){this.$popupParams.component.$emit("updated",!0)}},watch:{active:function(){"details"===this.active&&this.loadOrderDetails(this.order.id)}},mounted:function(){this.order=this.$popupParams.order,this.options=systemOptions,this.settings=systemSettings,this.loadOrderDetails(this.order.id),this.popupCloser()}};window.nsOrderPreviewPopup=B;const G=B;const K=(0,h.Z)(G,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-95vh w-95vw md:h-6/7-screen md:w-6/7-screen overflow-hidden shadow-xl ns-box flex flex-col"},[s("div",{staticClass:"border-b ns-box-header p-3 flex items-center justify-between"},[s("div",[s("h3",[e._v(e._s(e.__("Order Options")))])]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup(!0)}}})],1)]),e._v(" "),s("div",{staticClass:"p-2 overflow-scroll ns-box-body flex flex-auto"},[e.order.id?s("ns-tabs",{attrs:{active:e.active},on:{active:function(t){return e.setActive(t)}}},[s("ns-tabs-item",{staticClass:"overflow-y-auto",attrs:{label:e.__("Details"),identifier:"details"}},[s("ns-order-details",{attrs:{order:e.order}})],1),e._v(" "),["order_void","hold","refunded","partially_refunded"].includes(e.order.payment_status)?e._e():s("ns-tabs-item",{staticClass:"overflow-y-auto",attrs:{label:e.__("Payments"),identifier:"payments"}},[s("ns-order-payment",{attrs:{order:e.order},on:{changed:function(t){return e.refresh()}}})],1),e._v(" "),["order_void","hold","refunded"].includes(e.order.payment_status)?e._e():s("ns-tabs-item",{staticClass:"flex overflow-y-auto",attrs:{label:e.__("Refund & Return"),identifier:"refund"}},[s("ns-order-refund",{attrs:{order:e.order},on:{loadTab:function(t){return e.setActive(t)},changed:function(t){return e.refresh()}}})],1),e._v(" "),["partially_paid","unpaid"].includes(e.order.payment_status)&&e.order.support_instalments?s("ns-tabs-item",{staticClass:"flex overflow-y-auto",attrs:{label:e.__("Installments"),identifier:"instalments"}},[s("ns-order-instalments",{attrs:{order:e.order},on:{changed:function(t){return e.refresh()}}})],1):e._e()],1):e._e(),e._v(" "),e.order.id?e._e():s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1)],1),e._v(" "),s("div",{staticClass:"p-2 flex justify-between border-t ns-box-footer"},[s("div",[e.isVoidable?s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.voidOrder()}}},[s("i",{staticClass:"las la-ban"}),e._v("\n "+e._s(e.__("Void"))+"\n ")]):e._e(),e._v(" "),e.isDeleteAble?s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.deleteOrder()}}},[s("i",{staticClass:"las la-trash"}),e._v("\n "+e._s(e.__("Delete"))+"\n ")]):e._e()],1),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.printOrder()}}},[s("i",{staticClass:"las la-print"}),e._v("\n "+e._s(e.__("Print"))+"\n ")])],1)])])}),[],!1,null,null,null).exports},3306:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var n=s(7389),r=s(8603),i=s(6386),o=s(9671),a=s(1703);const l={name:"ns-orders-refund-popup",data:function(){return{order:null,refunds:[],view:"summary",previewed:null,loaded:!1,options:systemOptions,settings:systemSettings,print:new a.Z({settings:systemSettings,options:systemOptions,type:"refund"})}},methods:{__:n.__,popupCloser:r.Z,popupResolver:i.Z,toggleProductView:function(e){this.view="details",this.previewed=e},loadOrderRefunds:function(){var e=this;nsHttpClient.get("/api/nexopos/v4/orders/".concat(this.order.id,"/refunds")).subscribe((function(t){e.loaded=!0,e.refunds=t.refunds}),(function(e){o.kX.error(e.message).subscribe()}))},close:function(){this.$popup.close()},printRefundReceipt:function(e){this.print.printOrder(e.id)}},mounted:function(){this.order=this.$popupParams.order,this.popupCloser(),this.loadOrderRefunds()}};const c=(0,s(1900).Z)(l,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg w-95vw h-95vh md:w-3/5-screen md:h-3/5-screen ns-box flex flex-col overflow-hidden"},[s("div",{staticClass:"border-b p-2 flex items-center justify-between ns-box-header"},[s("h3",[e._v(e._s(e.__("Order Refunds")))]),e._v(" "),s("div",{staticClass:"flex"},["details"===e.view?s("div",{staticClass:"flex items-center justify-center cursor-pointer rounded-full px-3 border hover:bg-info-primary hover:text-white mr-1",on:{click:function(t){e.view="summary"}}},[e._v(e._s(e.__("Go Back")))]):e._e(),e._v(" "),s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"overflow-auto flex-auto ns-box-body"},["summary"===e.view?[e.loaded?e._e():s("div",{staticClass:"flex h-full w-full items-center justify-center"},[s("ns-spinner",{attrs:{size:"24"}})],1),e._v(" "),e.loaded&&0===e.refunds.length?s("div",{staticClass:"flex h-full w-full items-center justify-center"},[s("i",{staticClass:"lar la-frown-open"})]):e._e(),e._v(" "),e.loaded&&e.refunds.length>0?e._l(e.refunds,(function(t){return s("div",{key:t.id,staticClass:"border-b flex flex-col md:flex-row"},[s("div",{staticClass:"w-full md:flex-auto p-2"},[s("h3",{staticClass:"font-semibold mb-1"},[e._v(e._s(e.order.code))]),e._v(" "),s("div",[s("ul",{staticClass:"flex -mx-1 text-sm text-primary"},[s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Total"))+" : "+e._s(e._f("currency")(t.total)))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("By"))+" : "+e._s(t.author.username))])])])]),e._v(" "),s("div",{staticClass:"w-full md:w-16 cursor-pointer hover:bg-info-primary hover:border-info-primary hover:text-white text-lg flex items-center justify-center md:border-l",on:{click:function(s){return e.toggleProductView(t)}}},[s("i",{staticClass:"las la-eye"})]),e._v(" "),s("div",{staticClass:"w-full md:w-16 cursor-pointer hover:bg-info-primary hover:border-info-primary hover:text-white text-lg flex items-center justify-center md:border-l",on:{click:function(s){return e.printRefundReceipt(t)}}},[s("i",{staticClass:"las la-print"})])])})):e._e()]:e._e(),e._v(" "),"details"===e.view?e._l(e.previewed.refunded_products,(function(t){return s("div",{key:t.id,staticClass:"border-b flex flex-col md:flex-row"},[s("div",{staticClass:"w-full md:flex-auto p-2"},[s("h3",{staticClass:"font-semibold mb-1"},[e._v(e._s(t.product.name))]),e._v(" "),s("div",[s("ul",{staticClass:"flex -mx-1 text-sm text-primary"},[s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Condition"))+" : "+e._s(t.condition))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Quantity"))+" : "+e._s(t.quantity))]),e._v(" "),s("li",{staticClass:"px-1"},[e._v(e._s(e.__("Total"))+" : "+e._s(e._f("currency")(t.total_price)))])])])])])})):e._e()],2)])}),[],!1,null,null,null).exports},3601:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});var n=s(7389),r=s(6386),i=s(8603);const o={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:n.__,popupResolver:r.Z,popupCloser:i.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const a=(0,s(1900).Z)(o,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[s("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),s("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"action-buttons flex border-t"},[s("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),s("hr",{staticClass:"border-r h-16"}),e._v(" "),s("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports},241:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var n=s(8603),r=s(6386),i=s(9671),o=s(7389),a=s(9510);s(9624);const l={name:"ns-pos-coupons-load-popup",components:{nsNotice:s(1828).Z},data:function(){return{placeHolder:(0,o.__)("Coupon Code"),couponCode:null,order:null,activeTab:"apply-coupon",orderSubscriber:null,customerCoupon:null}},mounted:function(){var e=this;this.popupCloser(),this.$refs.coupon.select(),this.orderSubscriber=POS.order.subscribe((function(t){e.order=t,e.order.coupons.length>0&&(e.activeTab="active-coupons")})),this.$popupParams&&this.$popupParams.apply_coupon&&(this.couponCode=this.$popupParams.apply_coupon,this.getCoupon(this.couponCode).subscribe({next:function(t){e.customerCoupon=t,e.apply()}}))},destroyed:function(){this.orderSubscriber.unsubscribe()},methods:{__:o.__,popupCloser:n.Z,popupResolver:r.Z,selectCustomer:function(){Popup.show(a.Z)},cancel:function(){this.customerCoupon=null,this.couponCode=null},removeCoupon:function(e){this.order.coupons.splice(e,1),POS.refreshCart()},apply:function(){var e=this;try{var t=this.customerCoupon;if(null!==this.customerCoupon.coupon.valid_hours_start&&!ns.date.moment.isAfter(this.customerCoupon.coupon.valid_hours_start)&&this.customerCoupon.coupon.valid_hours_start.length>0)return i.kX.error((0,o.__)("The coupon is out from validity date range.")).subscribe();if(null!==this.customerCoupon.coupon.valid_hours_end&&!ns.date.moment.isBefore(this.customerCoupon.coupon.valid_hours_end)&&this.customerCoupon.coupon.valid_hours_end.length>0)return i.kX.error((0,o.__)("The coupon is out from validity date range.")).subscribe();var s=this.customerCoupon.coupon.products;if(s.length>0){var n=s.map((function(e){return e.product_id}));if(0===this.order.products.filter((function(e){return n.includes(e.product_id)})).length)return i.kX.error((0,o.__)("This coupon requires products that aren't available on the cart at the moment.")).subscribe()}var r=this.customerCoupon.coupon.categories;if(r.length>0){var a=r.map((function(e){return e.category_id}));if(0===this.order.products.filter((function(e){return a.includes(e.$original().category_id)})).length)return i.kX.error((0,o.__)("This coupon requires products that belongs to specific categories that aren't included at the moment.").replace("%s")).subscribe()}this.cancel();var l={active:t.coupon.active,customer_coupon_id:t.id,minimum_cart_value:t.coupon.minimum_cart_value,maximum_cart_value:t.coupon.maximum_cart_value,name:t.coupon.name,type:t.coupon.type,value:0,limit_usage:t.coupon.limit_usage,code:t.coupon.code,discount_value:t.coupon.discount_value,categories:t.coupon.categories,products:t.coupon.products};POS.pushCoupon(l),this.activeTab="active-coupons",setTimeout((function(){e.popupResolver(l)}),500),i.kX.success((0,o.__)("The coupon has applied to the cart.")).subscribe()}catch(e){console.log(e)}},getCouponType:function(e){switch(e){case"percentage_discount":return(0,o.__)("Percentage");case"flat_discount":return(0,o.__)("Flat");default:return(0,o.__)("Unknown Type")}},getDiscountValue:function(e){switch(e.type){case"percentage_discount":return e.discount_value+"%";case"flat_discount":return this.$options.filters.currency(e.discount_value)}},closePopup:function(){this.popupResolver(!1)},setActiveTab:function(e){this.activeTab=e},getCoupon:function(e){return!this.order.customer_id>0?i.kX.error((0,o.__)("You must select a customer before applying a coupon.")).subscribe():i.ih.post("/api/nexopos/v4/customers/coupons/".concat(e),{customer_id:this.order.customer_id})},loadCoupon:function(){var e=this,t=this.couponCode;this.getCoupon(t).subscribe({next:function(t){e.customerCoupon=t,i.kX.success((0,o.__)("The coupon has been loaded.")).subscribe()},error:function(e){i.kX.error(e.message||(0,o.__)("An unexpected error occured.")).subscribe()}})}}};const c=(0,s(1900).Z)(l,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg ns-box w-95vw md:w-3/6-screen lg:w-2/6-screen"},[s("div",{staticClass:"border-b ns-box-header p-2 flex justify-between items-center"},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Load Coupon")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"p-1 ns-box-body"},[s("ns-tabs",{attrs:{active:e.activeTab},on:{changeTab:function(t){return e.setActiveTab(t)}}},[s("ns-tabs-item",{attrs:{label:e.__("Apply A Coupon"),padding:"p-2",identifier:"apply-coupon"}},[s("div",{staticClass:"border-2 input-group info rounded flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.couponCode,expression:"couponCode"}],ref:"coupon",staticClass:"w-full text-primary p-2 outline-none",attrs:{type:"text",placeholder:e.placeHolder},domProps:{value:e.couponCode},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.loadCoupon()},input:function(t){t.target.composing||(e.couponCode=t.target.value)}}}),e._v(" "),s("button",{staticClass:"px-3 py-2",on:{click:function(t){return e.loadCoupon()}}},[e._v(e._s(e.__("Load")))])]),e._v(" "),s("div",{staticClass:"pt-2"},[s("ns-notice",{attrs:{color:"info"},scopedSlots:e._u([{key:"description",fn:function(){return[e._v(e._s(e.__("Input the coupon code that should apply to the POS. If a coupon is issued for a customer, that customer must be selected priorly.")))]},proxy:!0}])})],1),e._v(" "),e.order&&void 0===e.order.customer_id?s("div",{staticClass:"pt-2 flex"},[s("button",{staticClass:"w-full border p-2 outline-none ns-numpad-key info cursor-pointer text-center",on:{click:function(t){return e.selectCustomer()}}},[e._v(e._s(e.__("Click here to choose a customer.")))])]):e._e(),e._v(" "),e.order&&void 0!==e.order.customer_id?s("div",{staticClass:"pt-2"},[s("ns-notice",{attrs:{color:"success"},scopedSlots:e._u([{key:"description",fn:function(){return[e._v(e._s(e.__("Loading Coupon For : ")+e.order.customer.name+" "+e.order.customer.surname))]},proxy:!0}],null,!1,2531213351)})],1):e._e(),e._v(" "),s("div",{staticClass:"overflow-hidden"},[e.customerCoupon?s("div",{staticClass:"pt-2 fade-in-entrance anim-duration-500 overflow-y-auto ns-scrollbar h-64"},[s("table",{staticClass:"w-full ns-table"},[s("tbody",[s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Coupon Name")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.customerCoupon.name))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Discount"))+" ("+e._s(e.getCouponType(e.customerCoupon.coupon.type))+")")]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.getDiscountValue(e.customerCoupon.coupon)))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Usage")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.customerCoupon.usage+"/"+(e.customerCoupon.limit_usage||e.__("Unlimited"))))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Valid From")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.customerCoupon.coupon.valid_hours_start||e.__("N/A")))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Valid Till")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.customerCoupon.coupon.valid_hours_end||e.__("N/A")))])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Categories")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[s("ul",[e._l(e.customerCoupon.coupon.categories,(function(t){return s("li",{key:t.id,staticClass:"rounded-full px-3 py-1 border"},[e._v(e._s(t.category.name))])})),e._v(" "),0===e.customerCoupon.coupon.categories.length?s("li",[e._v(e._s(e.__("Not applicable")))]):e._e()],2)])]),e._v(" "),s("tr",[s("td",{staticClass:"p-2 w-1/2 border"},[e._v(e._s(e.__("Products")))]),e._v(" "),s("td",{staticClass:"p-2 w-1/2 border"},[s("ul",[e._l(e.customerCoupon.coupon.products,(function(t){return s("li",{key:t.id,staticClass:"rounded-full px-3 py-1 border"},[e._v(e._s(t.product.name))])})),e._v(" "),0===e.customerCoupon.coupon.products.length?s("li",[e._v(e._s(e.__("Not applicable")))]):e._e()],2)])])])])]):e._e()])]),e._v(" "),s("ns-tabs-item",{attrs:{label:e.__("Active Coupons"),padding:"p-1",identifier:"active-coupons"}},[e.order?s("ul",[e._l(e.order.coupons,(function(t,n){return s("li",{key:n,staticClass:"flex justify-between elevation-surface border items-center px-2 py-1"},[s("div",{staticClass:"flex-auto"},[s("h3",{staticClass:"font-semibold text-primary p-2 flex justify-between"},[s("span",[e._v(e._s(t.name))]),e._v(" "),s("span",[e._v(e._s(e.getDiscountValue(t)))])])]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.removeCoupon(n)}}})],1)])})),e._v(" "),0===e.order.coupons.length?s("li",{staticClass:"flex justify-between elevation-surface border items-center p-2"},[e._v("\n "+e._s(e.__("No coupons applies to the cart."))+"\n ")]):e._e()],2):e._e()])],1)],1),e._v(" "),e.customerCoupon?s("div",{staticClass:"flex"},[s("button",{staticClass:"w-1/2 px-3 py-2 bg-success-tertiary text-white font-bold",on:{click:function(t){return e.apply()}}},[e._v("\n "+e._s(e.__("Apply"))+"\n ")]),e._v(" "),s("button",{staticClass:"w-1/2 px-3 py-2 bg-error-tertiary text-white font-bold",on:{click:function(t){return e.cancel()}}},[e._v("\n "+e._s(e.__("Cancel"))+"\n ")])]):e._e()])}),[],!1,null,null,null).exports},9510:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var n=s(9671),r=s(6386),i=s(2242),o=s(1247);const a={data:function(){return{searchCustomerValue:"",orderSubscription:null,order:{},debounceSearch:null,customers:[],isLoading:!1}},computed:{customerSelected:function(){return!1}},watch:{searchCustomerValue:function(e){var t=this;clearTimeout(this.debounceSearch),this.debounceSearch=setTimeout((function(){t.searchCustomer(e)}),500)}},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&e.resolveIfQueued(!1)})),this.orderSubscription=POS.order.subscribe((function(t){e.order=t})),this.getRecentCustomers(),this.$refs.searchField.focus()},destroyed:function(){this.orderSubscription.unsubscribe()},methods:{__:s(7389).__,resolveIfQueued:r.Z,attemptToChoose:function(){if(1===this.customers.length)return this.selectCustomer(this.customers[0]);n.kX.info("Too many result.").subscribe()},openCustomerHistory:function(e,t){t.stopImmediatePropagation(),this.$popup.close(),i.G.show(o.Z,{customer:e,activeTab:"account-payment"})},selectCustomer:function(e){var t=this;this.customers.forEach((function(e){return e.selected=!1})),e.selected=!0,this.isLoading=!0,POS.selectCustomer(e).then((function(s){t.isLoading=!1,t.resolveIfQueued(e)})).catch((function(e){t.isLoading=!1}))},searchCustomer:function(e){var t=this;n.ih.post("/api/nexopos/v4/customers/search",{search:e}).subscribe((function(e){e.forEach((function(e){return e.selected=!1})),t.customers=e}))},createCustomerWithMatch:function(e){this.resolveIfQueued(!1),i.G.show(o.Z,{name:e})},getRecentCustomers:function(){var e=this;this.isLoading=!0,n.ih.get("/api/nexopos/v4/customers/recently-active").subscribe({next:function(t){e.isLoading=!1,t.forEach((function(e){return e.selected=!1})),e.customers=t},error:function(t){e.isLoading=!1}})}}};const l=(0,s(1900).Z)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow-xl w-4/5-screen md:w-2/5-screen xl:w-108",attrs:{id:"ns-pos-customer-select-popup"}},[s("div",{staticClass:"border-b ns-box-header text-center font-semibold text-2xl py-2",attrs:{id:"header"}},[s("h2",[e._v(e._s(e.__("Select Customer")))])]),e._v(" "),s("div",{staticClass:"relative"},[s("div",{staticClass:"p-2 border-b ns-box-body items-center flex justify-between"},[s("span",[e._v(e._s(e.__("Selected"))+" : ")]),e._v(" "),s("div",{staticClass:"flex items-center justify-between"},[s("span",[e._v(e._s(e.order.customer?e.order.customer.name:"N/A"))]),e._v(" "),e.order.customer?s("button",{staticClass:"mx-2 rounded-full h-8 w-8 flex items-center justify-center border ns-inset-button hover:border-transparent",on:{click:function(t){return e.openCustomerHistory(e.order.customer,t)}}},[s("i",{staticClass:"las la-eye"})]):e._e()])]),e._v(" "),s("div",{staticClass:"p-2 border-b ns-box-body flex justify-between text-primary"},[s("div",{staticClass:"input-group flex-auto border-2 rounded"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.searchCustomerValue,expression:"searchCustomerValue"}],ref:"searchField",staticClass:"outline-none w-full p-2",attrs:{placeholder:"Search Customer",type:"text"},domProps:{value:e.searchCustomerValue},on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.attemptToChoose()},input:function(t){t.target.composing||(e.searchCustomerValue=t.target.value)}}})])]),e._v(" "),s("div",{staticClass:"h-3/5-screen xl:h-2/5-screen overflow-y-auto ns-scrollbar"},[s("ul",{staticClass:"ns-vertical-menu"},[e.customers&&0===e.customers.length?s("li",{staticClass:"p-2 text-center text-primary"},[e._v("\n "+e._s(e.__("No customer match your query..."))+"\n ")]):e._e(),e._v(" "),e.customers&&0===e.customers.length?s("li",{staticClass:"p-2 cursor-pointer text-center text-primary",on:{click:function(t){return e.createCustomerWithMatch(e.searchCustomerValue)}}},[s("span",{staticClass:"border-b border-dashed border-info-primary"},[e._v(e._s(e.__("Create a customer")))])]):e._e(),e._v(" "),e._l(e.customers,(function(t){return s("li",{key:t.id,staticClass:"cursor-pointer p-2 border-b text-primary flex justify-between items-center",on:{click:function(s){return e.selectCustomer(t)}}},[s("span",[e._v(e._s(t.name))]),e._v(" "),s("p",{staticClass:"flex items-center"},[t.owe_amount>0?s("span",{staticClass:"text-error-primary"},[e._v("-"+e._s(e._f("currency")(t.owe_amount)))]):e._e(),e._v(" "),t.owe_amount>0?s("span",[e._v("/")]):e._e(),e._v(" "),s("span",{staticClass:"purchase-amount"},[e._v(e._s(e._f("currency")(t.purchases_amount)))]),e._v(" "),s("button",{staticClass:"mx-2 rounded-full h-8 w-8 flex items-center justify-center border ns-inset-button info",on:{click:function(s){return e.openCustomerHistory(t,s)}}},[s("i",{staticClass:"las la-eye"})])])])}))],2)]),e._v(" "),e.isLoading?s("div",{staticClass:"z-10 top-0 absolute w-full h-full flex items-center justify-center"},[s("ns-spinner",{attrs:{size:"24",border:"8"}})],1):e._e()])])}),[],!1,null,null,null).exports},1247:(e,t,s)=>{"use strict";s.d(t,{Z:()=>x});var n=s(7757),r=s.n(n),i=s(8603),o=s(9671),a=s(2242),l=s(9510),c=s(7266),u=s(7389);const d={mounted:function(){this.closeWithOverlayClicked(),this.loadTransactionFields()},data:function(){return{fields:[],isSubmiting:!1,formValidation:new c.Z}},methods:{__:u.__,closeWithOverlayClicked:i.Z,proceed:function(){var e=this,t=this.$popupParams.customer,s=this.formValidation.extractFields(this.fields);this.isSubmiting=!0,o.ih.post("/api/nexopos/v4/customers/".concat(t.id,"/account-history"),s).subscribe({next:function(t){e.isSubmiting=!1,o.kX.success(t.message).subscribe(),e.$popupParams.resolve(t),e.$popup.close()},error:function(t){e.isSubmiting=!1,o.kX.error(t.message).subscribe(),e.$popupParams.reject(t)}})},close:function(){this.$popup.close(),this.$popupParams.reject(!1)},loadTransactionFields:function(){var e=this;o.ih.get("/api/nexopos/v4/fields/ns.customers-account").subscribe({next:function(t){e.fields=e.formValidation.createFields(t)}})}}};var p=s(1900);const f=(0,p.Z)(d,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-6/7-screen md:w-5/7-screen lg:w-4/7-screen h-6/7-screen md:h-5/7-screen lg:h-5/7-screen overflow-hidden shadow-lg ns-box flex flex-col relative"},[s("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[s("h2",{staticClass:"font-semibold"},[e._v(e._s(e.__("New Transaction")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex-auto overflow-y-auto"},[0===e.fields.length?s("div",{staticClass:"h-full w-full flex items-center justify-center"},[s("ns-spinner")],1):e._e(),e._v(" "),e.fields.length>0?s("div",{staticClass:"p-2"},e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1):e._e()]),e._v(" "),s("div",{staticClass:"p-2 ns-box-footer justify-between border-t flex"},[s("div"),e._v(" "),s("div",{staticClass:"px-1"},[s("div",{staticClass:"-mx-2 flex flex-wrap"},[s("div",{staticClass:"px-1"},[s("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.close()}}},[e._v(e._s(e.__("Close")))])],1),e._v(" "),s("div",{staticClass:"px-1"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.proceed()}}},[e._v(e._s(e.__("Proceed")))])],1)])])]),e._v(" "),0===e.isSubmiting?s("div",{staticClass:"h-full w-full absolute flex items-center justify-center",staticStyle:{background:"rgb(0 98 171 / 45%)"}},[s("ns-spinner")],1):e._e()])}),[],!1,null,null,null).exports;var v=s(241),h=s(3601),m=s(6386),_=s(3506),b=s(3613);function y(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}const g={name:"ns-pos-customers",data:function(){return{activeTab:"create-customers",customer:null,subscription:null,orders:[],options:{},optionsSubscriber:null,selectedTab:"orders",isLoadingCoupons:!1,isLoadingRewards:!1,isLoadingHistory:!1,isLoadingOrders:!1,coupons:[],rewardsResponse:[],order:null,walletHistories:[]}},components:{nsPaginate:_.Z},destroyed:function(){this.subscription.unsubscribe(),this.optionsSubscriber.unsubscribe()},mounted:function(){var e=this;this.closeWithOverlayClicked(),this.optionsSubscriber=POS.options.subscribe((function(t){e.options=t})),this.subscription=POS.order.subscribe((function(t){e.order=t,void 0!==e.$popupParams.customer?(e.activeTab="account-payment",e.customer=e.$popupParams.customer,e.loadCustomerOrders()):void 0!==t.customer&&(e.activeTab="account-payment",e.customer=t.customer,e.loadCustomerOrders())})),this.popupCloser()},methods:{__:u.__,reload:function(){this.loadCustomerOrders()},popupResolver:m.Z,popupCloser:i.Z,getWalletHistoryLabel:function(e){switch(e){case"add":return(0,u.__)("Crediting");case"deduct":return(0,u.__)("Removing");case"refund":return(0,u.__)("Refunding");case"payment":return(0,u.__)("Payment");default:return(0,u.__)("Unknow")}},getType:function(e){switch(e){case"percentage_discount":return(0,u.__)("Percentage Discount");case"flat_discount":return(0,u.__)("Flat Discount")}},closeWithOverlayClicked:i.Z,openOrderOptions:function(e){var t,s=this;return(t=r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,new Promise((function(t,s){a.G.show(b.Z,{order:e,resolve:t,reject:s})}));case 3:t.sent,s.reload(),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),o.kX.error((0,u.__)("An error occured while opening the order options")).subscribe();case 10:case"end":return t.stop()}}),t,null,[[0,7]])})),function(){var e=this,s=arguments;return new Promise((function(n,r){var i=t.apply(e,s);function o(e){y(i,n,r,o,a,"next",e)}function a(e){y(i,n,r,o,a,"throw",e)}o(void 0)}))})()},doChangeTab:function(e){this.selectedTab=e,"coupons"===e&&this.loadCoupons(),"rewards"===e&&this.loadRewards(),"wallet-history"===e&&this.loadAccounHistory(),"orders"===e&&this.loadCustomerOrders()},loadAccounHistory:function(){var e=this;this.isLoadingHistory=!0,o.ih.get("/api/nexopos/v4/customers/".concat(this.customer.id,"/account-history")).subscribe({next:function(t){e.walletHistories=t.data,e.isLoadingHistory=!1},error:function(t){e.isLoadingHistory=!1}})},loadCoupons:function(){var e=this;this.isLoadingCoupons=!0,o.ih.get("/api/nexopos/v4/customers/".concat(this.customer.id,"/coupons")).subscribe({next:function(t){e.coupons=t,e.isLoadingCoupons=!1},error:function(t){e.isLoadingCoupons=!1}})},loadRewards:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/api/nexopos/v4/customers/".concat(this.customer.id,"/rewards");this.isLoadingRewards=!0,o.ih.get(t).subscribe({next:function(t){e.rewardsResponse=t,e.isLoadingRewards=!1},error:function(t){e.isLoadingRewards=!1}})},prefillForm:function(e){void 0!==this.$popupParams.name&&(e.main.value=this.$popupParams.name)},openCustomerSelection:function(){this.$popup.close(),a.G.show(l.Z)},loadCustomerOrders:function(){var e=this;this.isLoadingOrders=!0,o.ih.get("/api/nexopos/v4/customers/".concat(this.customer.id,"/orders")).subscribe({next:function(t){e.orders=t,e.isLoadingOrders=!1},error:function(t){e.isLoadingOrders=!1}})},newTransaction:function(e){new Promise((function(t,s){a.G.show(f,{customer:e,resolve:t,reject:s})})).then((function(t){POS.loadCustomer(e.id).subscribe((function(e){POS.selectCustomer(e)}))}))},applyCoupon:function(e){var t=this;void 0===this.order.customer?a.G.show(h.default,{title:(0,u.__)("Use Customer ?"),message:(0,u.__)("No customer is selected. Would you like to proceed with this customer ?"),onAction:function(s){s&&POS.selectCustomer(t.customer).then((function(s){t.proceedApplyingCoupon(e)}))}}):this.order.customer.id===this.customer.id?this.proceedApplyingCoupon(e):this.order.customer.id!==this.customer.id&&a.G.show(h.default,{title:(0,u.__)("Change Customer ?"),message:(0,u.__)("Would you like to assign this customer to the ongoing order ?"),onAction:function(s){s&&POS.selectCustomer(t.customer).then((function(s){t.proceedApplyingCoupon(e)}))}})},proceedApplyingCoupon:function(e){var t=this;new Promise((function(t,s){a.G.show(v.Z,{apply_coupon:e.code,resolve:t,reject:s})})).then((function(e){t.popupResolver(!1)})).catch((function(e){}))},handleSavedCustomer:function(e){o.kX.success(e.message).subscribe(),POS.selectCustomer(e.entry),this.$popup.close()}}};const x=(0,p.Z)(g,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg rounded w-95vw h-95vh lg:w-3/5-screen flex flex-col overflow-hidden",attrs:{id:"ns-pos-customers"}},[s("div",{staticClass:"ns-header p-2 flex justify-between items-center border-b"},[s("h3",{staticClass:"font-semibold"},[e._v(e._s(e.__("Customers")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.$popup.close()}}})],1)]),e._v(" "),s("div",{staticClass:"ns-body flex-auto flex p-2 overflow-y-auto"},[s("ns-tabs",{attrs:{active:e.activeTab},on:{active:function(t){e.activeTab=t}}},[s("ns-tabs-item",{attrs:{identifier:"create-customers",label:"New Customer"}},["yes"===e.options.ns_pos_customers_creation_enabled?s("ns-crud-form",{attrs:{"submit-url":"/api/nexopos/v4/crud/ns.customers",src:"/api/nexopos/v4/crud/ns.customers/form-config"},on:{updated:function(t){return e.prefillForm(t)},save:function(t){return e.handleSavedCustomer(t)}},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(e._s(e.__("Customer Name")))]},proxy:!0},{key:"save",fn:function(){return[e._v(e._s(e.__("Save Customer")))]},proxy:!0}],null,!1,2432171054)}):e._e(),e._v(" "),"yes"!==e.options.ns_pos_customers_creation_enabled?s("div",{staticClass:"h-full flex-col w-full flex items-center justify-center text-primary"},[s("i",{staticClass:"lar la-hand-paper ns-icon text-6xl"}),e._v(" "),s("h3",{staticClass:"font-medium text-2xl"},[e._v(e._s(e.__("Not Authorized")))]),e._v(" "),s("p",[e._v(e._s(e.__("Creating customers has been explicitly disabled from the settings.")))])]):e._e()],1),e._v(" "),s("ns-tabs-item",{staticClass:"flex",staticStyle:{padding:"0!important"},attrs:{identifier:"account-payment",label:e.__("Customer Account")}},[null===e.customer?s("div",{staticClass:"flex-auto w-full flex items-center justify-center flex-col p-4"},[s("i",{staticClass:"lar la-frown text-6xl"}),e._v(" "),s("h3",{staticClass:"font-medium text-2xl"},[e._v(e._s(e.__("No Customer Selected")))]),e._v(" "),s("p",[e._v(e._s(e.__("In order to see a customer account, you need to select one customer.")))]),e._v(" "),s("div",{staticClass:"my-2"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.openCustomerSelection()}}},[e._v(e._s(e.__("Select Customer")))])],1)]):e._e(),e._v(" "),e.customer?s("div",{staticClass:"flex flex-col flex-auto"},[s("div",{staticClass:"flex-auto p-2 flex flex-col"},[s("div",{staticClass:"-mx-4 flex flex-wrap ns-tab-cards"},[s("div",{staticClass:"px-4 mb-4 w-full"},[s("h2",{staticClass:"font-semibold"},[e._v(e._s(e.__("Summary For"))+" : "+e._s(e.customer.name))])]),e._v(" "),s("div",{staticClass:"px-4 mb-4 w-full md:w-1/4"},[s("div",{staticClass:"rounded-lg shadow bg-transparent bg-gradient-to-br from-success-secondary to-green-700 p-2 flex flex-col text-white"},[s("h3",{staticClass:"font-medium text-lg"},[e._v(e._s(e.__("Total Purchases")))]),e._v(" "),s("div",{staticClass:"w-full flex justify-end"},[s("h2",{staticClass:"font-bold"},[e._v(e._s(e._f("currency")(e.customer.purchases_amount)))])])])]),e._v(" "),s("div",{staticClass:"px-4 mb-4 w-full md:w-1/4"},[s("div",{staticClass:"rounded-lg shadow bg-transparent bg-gradient-to-br from-error-secondary to-red-700 p-2 text-white"},[s("h3",{staticClass:"font-medium text-lg"},[e._v(e._s(e.__("Total Owed")))]),e._v(" "),s("div",{staticClass:"w-full flex justify-end"},[s("h2",{staticClass:"text-2xl font-bold"},[e._v(e._s(e._f("currency")(e.customer.owed_amount)))])])])]),e._v(" "),s("div",{staticClass:"px-4 mb-4 w-full md:w-1/4"},[s("div",{staticClass:"rounded-lg shadow bg-transparent bg-gradient-to-br from-blue-500 to-blue-700 p-2 text-white"},[s("h3",{staticClass:"font-medium text-lg"},[e._v(e._s(e.__("Wallet Amount")))]),e._v(" "),s("div",{staticClass:"w-full flex justify-end"},[s("h2",{staticClass:"text-2xl font-bold"},[e._v(e._s(e._f("currency")(e.customer.account_amount)))])])])]),e._v(" "),s("div",{staticClass:"px-4 mb-4 w-full md:w-1/4"},[s("div",{staticClass:"rounded-lg shadow bg-transparent bg-gradient-to-br from-teal-500 to-teal-700 p-2 text-white"},[s("h3",{staticClass:"font-medium text-lg"},[e._v(e._s(e.__("Credit Limit")))]),e._v(" "),s("div",{staticClass:"w-full flex justify-end"},[s("h2",{staticClass:"text-2xl font-bold"},[e._v(e._s(e._f("currency")(e.customer.credit_limit_amount)))])])])])]),e._v(" "),s("div",{staticClass:"flex flex-auto flex-col overflow-hidden"},[s("ns-tabs",{attrs:{active:e.selectedTab},on:{changeTab:function(t){return e.doChangeTab(t)}}},[s("ns-tabs-item",{attrs:{identifier:"orders",label:e.__("Orders")}},[e.isLoadingOrders?s("div",{staticClass:"flex-auto h-full justify-center flex items-center"},[s("ns-spinner",{attrs:{size:"36"}})],1):e._e(),e._v(" "),e.isLoadingOrders?e._e():[s("div",{staticClass:"py-2 w-full"},[s("h2",{staticClass:"font-semibold text-primary"},[e._v(e._s(e.__("Last Purchases")))])]),e._v(" "),s("div",{staticClass:"flex-auto flex-col flex overflow-hidden"},[s("div",{staticClass:"flex-auto overflow-y-auto"},[s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",{staticClass:"text-primary"},[s("th",{staticClass:"p-2 border font-semibold",attrs:{colspan:"3",width:"150"}},[e._v(e._s(e.__("Order")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold",attrs:{width:"50"}},[e._v(e._s(e.__("Options")))])])]),e._v(" "),s("tbody",{staticClass:"text-primary"},[0===e.orders.length?s("tr",[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"4"}},[e._v(e._s(e.__("No orders...")))])]):e._e(),e._v(" "),e._l(e.orders,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"3"}},[s("div",{staticClass:"flex flex-col items-start"},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Code"))+": "+e._s(t.code))]),e._v(" "),s("div",{staticClass:"md:-mx-2 w-full flex flex-col md:flex-row"},[s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/4"},[s("small",[e._v(e._s(e.__("Total"))+": "+e._s(e._f("currency")(t.total)))])]),e._v(" "),s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/4"},[s("small",[e._v(e._s(e.__("Status"))+": "+e._s(t.human_status))])]),e._v(" "),s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/4"},[s("small",[e._v(e._s(e.__("Delivery"))+": "+e._s(t.human_delivery_status))])])])])]),e._v(" "),s("td",{staticClass:"border p-2 text-center"},[s("button",{staticClass:"rounded-full h-8 px-2 flex items-center justify-center border border-gray ns-inset-button success",on:{click:function(s){return e.openOrderOptions(t)}}},[s("i",{staticClass:"las la-wallet"}),e._v(" "),s("span",{staticClass:"ml-1"},[e._v(e._s(e.__("Options")))])])])])}))],2)])])])]],2),e._v(" "),s("ns-tabs-item",{attrs:{identifier:"wallet-history",label:e.__("Wallet History")}},[e.isLoadingHistory?s("div",{staticClass:"flex-auto h-full justify-center flex items-center"},[s("ns-spinner",{attrs:{size:"36"}})],1):e._e(),e._v(" "),e.isLoadingHistory?e._e():[s("div",{staticClass:"py-2 w-full"},[s("h2",{staticClass:"font-semibold text-primary"},[e._v(e._s(e.__("Wallet History")))])]),e._v(" "),s("div",{staticClass:"flex-auto flex-col flex overflow-hidden"},[s("div",{staticClass:"flex-auto overflow-y-auto"},[s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",{staticClass:"text-primary"},[s("th",{staticClass:"p-2 border font-semibold",attrs:{colspan:"3",width:"150"}},[e._v(e._s(e.__("Transaction")))])])]),e._v(" "),s("tbody",{staticClass:"text-primary"},[0===e.walletHistories.length?s("tr",[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"3"}},[e._v(e._s(e.__("No History...")))])]):e._e(),e._v(" "),e._l(e.walletHistories,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"3"}},[s("div",{staticClass:"flex flex-col items-start"},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Transaction"))+": "+e._s(e.getWalletHistoryLabel(t.operation)))]),e._v(" "),s("div",{staticClass:"md:-mx-2 w-full flex flex-col md:flex-row"},[s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/3"},[s("small",[e._v(e._s(e.__("Amount"))+": "+e._s(e._f("currency")(t.amount)))])]),e._v(" "),s("div",{staticClass:"md:px-2 flex items-start w-full md:w-1/3"},[s("small",[e._v(e._s(e.__("Date"))+": "+e._s(t.created_at))])])])])])])}))],2)])])])]],2),e._v(" "),s("ns-tabs-item",{attrs:{identifier:"coupons",label:e.__("Coupons")}},[e.isLoadingCoupons?s("div",{staticClass:"flex-auto h-full justify-center flex items-center"},[s("ns-spinner",{attrs:{size:"36"}})],1):e._e(),e._v(" "),e.isLoadingCoupons?e._e():[s("div",{staticClass:"py-2 w-full"},[s("h2",{staticClass:"font-semibold text-primary"},[e._v(e._s(e.__("Coupons")))])]),e._v(" "),s("div",{staticClass:"flex-auto flex-col flex overflow-hidden"},[s("div",{staticClass:"flex-auto overflow-y-auto"},[s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",{staticClass:"text-primary"},[s("th",{staticClass:"p-2 border font-semibold",attrs:{width:"150"}},[e._v(e._s(e.__("Name")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold"},[e._v(e._s(e.__("Type")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold"})])]),e._v(" "),s("tbody",{staticClass:"text-primary text-sm"},[0===e.coupons.length?s("tr",[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"4"}},[e._v(e._s(e.__("No coupons for the selected customer...")))])]):e._e(),e._v(" "),e._l(e.coupons,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"border p-2",attrs:{width:"300"}},[s("h3",[e._v(e._s(t.name))]),e._v(" "),s("div",{},[s("ul",{staticClass:"-mx-2 flex"},[s("li",{staticClass:"text-xs text-primary px-2"},[e._v(e._s(e.__("Usage :"))+" "+e._s(t.usage)+"/"+e._s(t.limit_usage))]),e._v(" "),s("li",{staticClass:"text-xs text-primary px-2"},[e._v(e._s(e.__("Code :"))+" "+e._s(t.code))])])])]),e._v(" "),s("td",{staticClass:"border p-2 text-center"},[e._v(e._s(e.getType(t.coupon.type))+" \n "),"percentage_discount"===t.coupon.type?s("span",[e._v("\n ("+e._s(t.coupon.discount_value)+"%)\n ")]):e._e(),e._v(" "),"flat_discount"===t.coupon.type?s("span",[e._v("\n ("+e._s(e._f("currency")(t.coupon.discount_value))+")\n ")]):e._e()]),e._v(" "),s("td",{staticClass:"border p-2 text-right"},[s("ns-button",{attrs:{type:"info"},on:{click:function(s){return e.applyCoupon(t)}}},[e._v(e._s(e.__("Use Coupon")))])],1)])}))],2)])])])]],2),e._v(" "),s("ns-tabs-item",{attrs:{identifier:"rewards",label:e.__("Rewards")}},[e.isLoadingRewards?s("div",{staticClass:"flex-auto h-full justify-center flex items-center"},[s("ns-spinner",{attrs:{size:"36"}})],1):e._e(),e._v(" "),e.isLoadingRewards?e._e():[s("div",{staticClass:"py-2 w-full"},[s("h2",{staticClass:"font-semibold text-primary"},[e._v(e._s(e.__("Rewards")))])]),e._v(" "),s("div",{staticClass:"flex-auto flex-col flex overflow-hidden"},[s("div",{staticClass:"flex-auto overflow-y-auto"},[s("table",{staticClass:"table ns-table w-full"},[s("thead",[s("tr",{staticClass:"text-primary"},[s("th",{staticClass:"p-2 border font-semibold",attrs:{width:"150"}},[e._v(e._s(e.__("Name")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold"},[e._v(e._s(e.__("Points")))]),e._v(" "),s("th",{staticClass:"p-2 border font-semibold"},[e._v(e._s(e.__("Target")))])])]),e._v(" "),e.rewardsResponse.data?s("tbody",{staticClass:"text-primary text-sm"},[0===e.rewardsResponse.data.length?s("tr",[s("td",{staticClass:"border p-2 text-center",attrs:{colspan:"4"}},[e._v(e._s(e.__("No rewards available the selected customer...")))])]):e._e(),e._v(" "),e._l(e.rewardsResponse.data,(function(t){return s("tr",{key:t.id},[s("td",{staticClass:"border p-2",attrs:{width:"300"}},[s("h3",{staticClass:"text-center"},[e._v(e._s(t.reward_name))])]),e._v(" "),s("td",{staticClass:"border p-2",attrs:{width:"300"}},[s("h3",{staticClass:"text-center"},[e._v(e._s(t.points))])]),e._v(" "),s("td",{staticClass:"border p-2",attrs:{width:"300"}},[s("h3",{staticClass:"text-center"},[e._v(e._s(t.target))])])])}))],2):e._e()])])]),e._v(" "),s("div",{staticClass:"py-1 flex justify-end"},[s("ns-paginate",{attrs:{pagination:e.rewardsResponse},on:{load:function(t){return e.loadRewards(t)}}})],1)]],2)],1)],1)]),e._v(" "),s("div",{staticClass:"p-2 border-t border-box-edge flex justify-between"},[s("div"),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.newTransaction(e.customer)}}},[e._v(e._s(e.__("Account Transaction")))])],1)])]):e._e()])],1)],1)])}),[],!1,null,null,null).exports},7146:(e,t,s)=>{"use strict";s.d(t,{Z:()=>d});var n=s(7266),r=s(9671),i=s(7389);function o(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function a(e){for(var t=1;t0){var e=nsRawCurrency(this.order.instalments.map((function(e){return parseFloat(e.amount.value)||0})).reduce((function(e,t){return parseFloat(e)+parseFloat(t)})));this.totalPayments=this.order.total-e}else this.totalPayments=0},removeInstalment:function(e){var t=this.order.instalments.indexOf(e);this.order.instalments.splice(t,1),this.$forceUpdate()},generatePaymentFields:function(e){var t=this;this.order.instalments=new Array(parseInt(e)).fill("").map((function(e,s){return{date:{type:"date",name:"date",label:"Date",value:0===s?ns.date.moment.format("YYYY-MM-DD"):""},amount:{type:"number",name:"amount",label:"Amount",value:0===s?t.expectedPayment:0},readonly:{type:"hidden",name:"readonly",value:t.expectedPayment>0&&0===s}}})),this.$forceUpdate(),this.refreshTotalPayments()},close:function(){this.$popupParams.reject({status:"failed",message:(0,i.__)("You must define layaway settings before proceeding.")}),this.$popup.close()},skipInstalments:function(){this.expectedPayment>0?(this.order.instalments=[{amount:this.expectedPayment,date:ns.date.current}],this.order.final_payment_date=this.order.instalments.reverse()[0].date,this.order.total_instalments=this.order.instalments.length,this.order.support_instalments=!1):(this.order.final_payment_date=ns.date.current,this.order.total_instalments=0,this.order.support_instalments=!1),this.$popup.close(),POS.order.next(this.order);var e=this.$popupParams,t=e.resolve;e.reject;return t({order:this.order,skip_layaway:!0})},updateOrder:function(){var e=this;if(0===this.order.instalments.length)return r.kX.error((0,i.__)("Please provide instalments before proceeding.")).subscribe();if(this.fields.forEach((function(t){return e.formValidation.validateField(t)})),!this.formValidation.fieldsValid(this.fields))return r.kX.error((0,i.__)("Unable to procee the form is not valid")).subscribe();this.$forceUpdate();var t=this.order.instalments.map((function(e){return{amount:parseFloat(e.amount.value),date:e.date.value}})),s=nsRawCurrency(t.map((function(e){return e.amount})).reduce((function(e,t){return parseFloat(e)+parseFloat(t)})));if(t.filter((function(e){return void 0===e.date||""===e.date})).length>0)return r.kX.error((0,i.__)("One or more instalments has an invalid date.")).subscribe();if(t.filter((function(e){return!(e.amount>0)})).length>0)return r.kX.error((0,i.__)("One or more instalments has an invalid amount.")).subscribe();if(t.filter((function(e){return moment(e.date).isBefore(ns.date.moment.startOf("day"))})).length>0)return r.kX.error((0,i.__)("One or more instalments has a date prior to the current date.")).subscribe();var n=t.filter((function(e){return moment(e.date).isSame(ns.date.moment.startOf("day"),"day")})),o=0;if(n.forEach((function(e){o+=parseFloat(e.amount)})),o{"use strict";s.r(t),s.d(t,{default:()=>r});const n={name:"ns-pos-loading-popup"};const r=(0,s(1900).Z)(n,(function(){var e=this.$createElement;return(this._self._c||e)("ns-spinner")}),[],!1,null,null,null).exports},664:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var n=s(7757),r=s.n(n),i=s(6386),o=s(7389),a=s(8603);function l(e,t,s,n,r,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}const c={data:function(){return{types:[],typeSubscription:null}},mounted:function(){var e=this;this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&e.resolveIfQueued(!1)})),this.typeSubscription=POS.types.subscribe((function(t){e.types=t,1===Object.values(e.types).length&&e.select(Object.keys(e.types)[0])})),this.popupCloser()},destroyed:function(){this.typeSubscription.unsubscribe()},methods:{__:o.__,popupCloser:a.Z,popupResolver:i.Z,resolveIfQueued:i.Z,select:function(e){var t,s=this;return(t=r().mark((function t(){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Object.values(s.types).forEach((function(e){return e.selected=!1})),s.types[e].selected=!0,n=s.types[e],t.prev=3,t.next=6,POS.triggerOrderTypeSelection(n);case 6:t.sent,POS.types.next(s.types),s.resolveIfQueued(n),t.next=13;break;case 11:t.prev=11,t.t0=t.catch(3);case 13:case"end":return t.stop()}}),t,null,[[3,11]])})),function(){var e=this,s=arguments;return new Promise((function(n,r){var i=t.apply(e,s);function o(e){l(i,n,r,o,a,"next",e)}function a(e){l(i,n,r,o,a,"throw",e)}o(void 0)}))})()}}};const u=(0,s(1900).Z)(c,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"h-full w-4/5-screen md:w-2/5-screen lg:w-2/5-screen xl:w-2/6-screen shadow-lg",attrs:{id:"ns-order-type"}},[s("div",{staticClass:"h-16 flex justify-center items-center",attrs:{id:"header"}},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Define The Order Type")))])]),e._v(" "),0===Object.values(e.types).length?s("div",{staticClass:"ns-box-body grid grid-flow-row grid-cols-1 grid-rows-1"},[s("div",{staticClass:"h-full w-full flex items-center justify-center flex-col"},[s("i",{staticClass:"las la-frown text-7xl"}),e._v(" "),s("div",{staticClass:"p-4 md:w-2/3"},[s("p",{staticClass:"text-center "},[e._v(e._s(e.__("No payment type has been selected on the settings. Please check your POS features and choose the supported order type")))]),e._v(" "),s("div",{staticClass:"flex justify-center py-1"},[s("ns-link",{attrs:{target:"_blank",type:"info",href:"https://my.nexopos.com/en/documentation/components/order-types"}},[e._v(e._s(e.__("Read More")))])],1)])])]):e._e(),e._v(" "),Object.values(e.types).length>0?s("div",{staticClass:"ns-box-body grid grid-flow-row grid-cols-2 grid-rows-2"},e._l(e.types,(function(t){return s("div",{key:t.identifier,staticClass:"ns-numpad-key info h-56 flex items-center justify-center flex-col cursor-pointer border",class:t.selected?"active":"",on:{click:function(s){return e.select(t.identifier)}}},[s("img",{staticClass:"w-32 h-32",attrs:{src:t.icon,alt:""}}),e._v(" "),s("h4",{staticClass:"font-semibold text-xl my-2"},[e._v(e._s(t.label))])])})),0):e._e()])}),[],!1,null,null,null).exports},4492:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var n=s(9671),r=s(7389),i=s(8603),o=s(4864),a=s(3220);const l={components:{nsNumpad:o.Z,nsNumpadPlus:a.Z},data:function(){return{finalValue:1,virtualStock:null,options:{},optionsSubscription:null,allSelected:!0,isLoading:!1}},beforeDestroy:function(){this.optionsSubscription.unsubscribe()},mounted:function(){var e=this;this.optionsSubscription=POS.options.subscribe((function(t){e.options=t})),this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams.reject(!1),e.$popup.close())})),this.$popupParams.product.quantity&&(this.finalValue=this.$popupParams.product.quantity),this.popupCloser()},destroyed:function(){nsHotPress.destroy("pos-quantity-numpad"),nsHotPress.destroy("pos-quantity-backspace"),nsHotPress.destroy("pos-quantity-enter")},methods:{__:r.__,popupCloser:i.Z,closePopup:function(){this.$popupParams.reject(!1),this.$popup.close()},updateQuantity:function(e){this.finalValue=e},defineQuantity:function(e){var t=this.$popupParams,s=t.product,i=t.data;if(0===e)return n.kX.error((0,r.__)("Please provide a quantity")).subscribe();if("enabled"===s.$original().stock_management&&"materialized"===s.$original().type){var o=POS.getStockUsage(s.$original().id,i.unit_quantity_id)-(s.quantity||0);if(e>parseFloat(i.$quantities().quantity)-o)return n.kX.error((0,r.__)("Unable to add the product, there is not enough stock. Remaining %s").replace("%s",i.$quantities().quantity-o)).subscribe()}this.resolve({quantity:e})},resolve:function(e){this.$popupParams.resolve(e),this.$popup.close()}}};const c=(0,s(1900).Z)(l,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ns-box shadow min-h-2/5-screen w-3/4-screen md:w-3/5-screen lg:w-2/5-screen xl:w-2/5-screen relative"},[e.isLoading?s("div",{staticClass:"flex w-full h-full absolute top-O left-0 items-center justify-center",staticStyle:{background:"rgb(202 202 202 / 49%)"},attrs:{id:"loading-overlay"}},[s("ns-spinner")],1):e._e(),e._v(" "),s("div",{staticClass:"flex-shrink-0 flex justify-between items-center p-2 border-b ns-box-header"},[s("div",[s("h1",{staticClass:"text-xl font-bold text-primary text-center"},[e._v(e._s(e.__("Define Quantity")))])]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"h-24 border-b primary ns-box-body flex items-center justify-center",attrs:{id:"screen"}},[s("h1",{staticClass:"font-bold text-3xl"},[e._v(e._s(e.finalValue))])]),e._v(" "),"default"===e.options.ns_pos_numpad?s("ns-numpad",{attrs:{floating:e.options.ns_pos_allow_decimal_quantities,value:e.finalValue},on:{changed:function(t){return e.updateQuantity(t)},next:function(t){return e.defineQuantity(t)}}}):e._e(),e._v(" "),"advanced"===e.options.ns_pos_numpad?s("ns-numpad-plus",{attrs:{value:e.finalValue},on:{changed:function(t){return e.updateQuantity(t)},next:function(t){return e.defineQuantity(t)}}}):e._e()],1)}),[],!1,null,null,null).exports},9702:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var n=s(9671),r=s(6386),i=s(7266);function o(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function a(e){for(var t=1;t{"use strict";s.r(t),s.d(t,{default:()=>r});const n={data:function(){return{title:"",message:"",input:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){var e=this;this.input=this.$popupParams.input||"",this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams.reject(!1),e.$popup.close())}))},methods:{__:s(7389).__,emitAction:function(e){this.$popupParams.onAction(e?this.input:e),this.$popup.close()},reject:function(e){void 0!==this.$popupParams.reject&&this.$popupParams.reject(e),this.$popup.close()}}};const r=(0,s(1900).Z)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"w-5/7-screen md:w-3/7-screen flex flex-col shadow-lg",class:e.size,attrs:{id:"prompt-popup"}},[s("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-2"},[s("h2",{staticClass:"text-3xl font-body"},[e._v(e._s(e.title))]),e._v(" "),s("p",{staticClass:"w-full md:mx-auto md:w-2/3 py-4 text-center"},[e._v(e._s(e.message))])]),e._v(" "),s("div",{staticClass:"p-2"},[s("div",{staticClass:"ns-input"},[s("textarea",{directives:[{name:"model",rawName:"v-model",value:e.input,expression:"input"}],staticClass:"w-full border-2 p-2",attrs:{name:"",id:"",cols:"30",rows:"10"},domProps:{value:e.input},on:{input:function(t){t.target.composing||(e.input=t.target.value)}}})])]),e._v(" "),s("div",{staticClass:"flex border-t action-buttons"},[s("button",{staticClass:"flex-auto w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Ok")))]),e._v(" "),s("hr",{staticClass:"border-r"}),e._v(" "),s("button",{staticClass:"flex-auto w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.reject(!1)}}},[e._v(e._s(e.__("Cancel")))])])])}),[],!1,null,null,null).exports},3296:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var n=s(8603),r=s(7389);const i={data:function(){return{value:[],options:[],description:"",label:null,type:"select"}},computed:{},mounted:function(){this.popupCloser(),this.value=this.$popupParams.value||[],this.options=this.$popupParams.options,this.label=this.$popupParams.label,this.description=this.$popupParams.description||"",this.type=this.$popupParams.type||this.type},methods:{popupCloser:n.Z,__:r.__,toggle:function(e){var t=this.value.indexOf(e);-1===t?this.value.unshift(e):this.value.splice(t,1)},isSelected:function(e){return this.value.indexOf(e)>=0},close:function(){this.$popupParams.reject(!1),this.$popup.close()},select:function(e){void 0!==e&&(this.value=[e]),this.$popupParams.resolve(this.value),this.close()}}};const o=(0,s(1900).Z)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-xl ns-box w-6/7-screen md:w-4/7-screen lg:w-3/7-screen max-h-5/6-screen overflow-hidden flex flex-col"},[s("div",{staticClass:"p-2 flex justify-between border-b items-center ns-box-header"},[s("span",{staticClass:"text-semibold text-primary"},[e._v("\n "+e._s(e.label)+"\n ")]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.close()}}})],1)]),e._v(" "),s("div",{staticClass:"flex flex-col overflow-hidden"},[e.description.length>0?s("p",{staticClass:"p-2 text-center text-sm bg-info-primary"},[e._v(e._s(e.description))]):e._e(),e._v(" "),s("div",{staticClass:"overflow-y-auto"},[s("ul",{staticClass:"ns-vertical-menu"},["select"===e.type?e._l(e.options,(function(t){return s("li",{key:t.value,staticClass:"p-2 border-b border-box-edge text-primary cursor-pointer",on:{click:function(s){return e.select(t)}}},[e._v(e._s(t.label))])})):e._e(),e._v(" "),"multiselect"===e.type?e._l(e.options,(function(t){return s("li",{key:t.value,staticClass:"p-2 border-b text-primary cursor-pointer",class:e.isSelected(t)?"active":"",on:{click:function(s){return e.toggle(t)}}},[e._v(e._s(t.label))])})):e._e()],2)])]),e._v(" "),"multiselect"===e.type?s("div",{staticClass:"flex justify-between"},[s("div"),e._v(" "),s("div",[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.select()}}},[e._v(e._s(e.__("Select")))])],1)]):e._e()])}),[],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=6086,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/public/js/pos.min.js b/public/js/pos.min.js index 60942e199..3c1b13d1f 100644 --- a/public/js/pos.min.js +++ b/public/js/pos.min.js @@ -1 +1 @@ -(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[159,198],{9671:(e,t,n)=>{"use strict";n.d(t,{l:()=>Y,kq:()=>R,ih:()=>z,kX:()=>H});var s=n(6486),i=n(9669),r=n(6300),a=n(8345),o=n(9624),l=n(9248),c=n(230);function d(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=R.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:s}),new c.y((function(r){n._client[e](t,s,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,r.next(e.data),r.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;r.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&d(t.prototype,n),s&&d(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=n(3);function p(e,t){for(var n=0;n=1e3){for(var n,s=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=s?e/Math.pow(1e3,s):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][s]}return t})),S=n(1356),E=n(9698);function D(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&q(t.prototype,n),s&&q(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()),N=new b({sidebar:["xs","sm","md"].includes(I.breakpoint)?"hidden":"visible"});z.defineClient(i),window.nsEvent=Y,window.nsHttpClient=z,window.nsSnackBar=H,window.nsCurrency=S.W,window.nsTruncate=E.b,window.nsRawCurrency=S.f,window.nsAbbreviate=$,window.nsState=N,window.nsUrl=L,window.nsScreen=I,window.ChartJS=r,window.EventEmitter=h,window.Popup=x.G,window.RxJS=y,window.FormValidation=k.Z,window.nsCrudHandler=Z},7975:(e,t,n)=>{"use strict";n.r(t),n.d(t,{nsAvatar:()=>Q,nsButton:()=>o,nsCheckbox:()=>p,nsCkeditor:()=>O,nsCloseButton:()=>j,nsCrud:()=>U,nsCrudForm:()=>g,nsDate:()=>w,nsDateRangePicker:()=>K.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>_.P,nsIconButton:()=>$,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>C,nsMenu:()=>r,nsMultiselect:()=>x,nsNotice:()=>J.Z,nsNumpad:()=>W.Z,nsPaginate:()=>te.Z,nsSearch:()=>se,nsSelect:()=>u,nsSelectAudio:()=>f,nsSpinner:()=>v,nsSubmenu:()=>a,nsSwitch:()=>M.Z,nsTableRow:()=>m,nsTabs:()=>T,nsTabsItem:()=>F,nsTextarea:()=>y});var s=n(538),i=n(9671),r=s.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,i.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&i.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,n){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),a=s.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),o=s.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=s.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=s.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),d=n(7389),u=s.default.component("ns-select",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},mounted:function(){},methods:{__:d.__},template:'\n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),f=s.default.component("ns-select-audio",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__:d.__,playSelectedSound:function(){this.field.value.length>0&&new Audio(this.field.value).play()}},template:'\n
    \n \n
    \n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),p=s.default.component("ns-checkbox",{data:function(){return{}},props:["checked","field","label"],template:'\n
    \n
    \n \n
    \n {{ label }}\n {{ field.label }}\n
    \n ',computed:{isChecked:function(){return this.field?this.field.value:this.checked}},methods:{toggleIt:function(){void 0!==this.field&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}}),h=n(2242),m=s.default.component("ns-table-row",{props:["options","row","columns","prependOptions","showOptions"],data:function(){return{optionsToggled:!1}},mounted:function(){},methods:{__:d.__,sanitizeHTML:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.getElementsByTagName("script"),s=n.length;s--;)n[s].parentNode.removeChild(n[s]);return t.innerHTML},getElementOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu:function(e){var t=this;if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout((function(){var e=t.$el.querySelectorAll(".relative > .absolute")[0],n=t.$el.querySelectorAll(".relative")[0],s=t.getElementOffset(n);e.style.top=s.top+"px",e.style.left=s.left+"px",n.classList.remove("relative"),n.classList.add("dropdown-holder")}),100);else{var n=this.$el.querySelectorAll(".dropdown-holder")[0];n.classList.remove("dropdown-holder"),n.classList.add("relative")}},handleChanged:function(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync:function(e){var t=this;e.confirm?confirm(e.confirm.message)&&i.ih[e.type.toLowerCase()](e.url).subscribe((function(e){i.kX.success(e.message).subscribe(),t.$emit("reload",t.row)}),(function(e){t.toggleMenu(),i.kX.error(e.message).subscribe()})):(i.l.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup:function(e,t){var n=window.nsExtraComponents[e.component];if(e.component)return n?new Promise((function(s,i){h.G.show(n,{resolve:s,reject:i,row:t,action:e})})):i.kX.error((0,d.__)('Unable to load the component "'.concat(e.component,'". Make sure the component is registered to "nsExtraComponents".'))).subscribe();this.triggerAsync(e)}},template:'\n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n '}),v=s.default.component("ns-spinner",{data:function(){return{}},mounted:function(){},computed:{validatedSize:function(){return this.size||24},validatedBorder:function(){return this.border||8},validatedAnimation:function(){return this.animation||"fast"}},props:["color","size","border"],template:"\n
    \n
    \n
    \n "}),b=n(7266),g=s.default.component("ns-crud-form",{data:function(){return{form:{},globallyChecked:!1,formValidation:new b.Z,rows:[]}},mounted:function(){this.loadForm()},props:["src","create-url","field-class","return-url","submit-url","submit-method","disable-tabs"],computed:{activeTabFields:function(){for(var e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]}},methods:{__:d.__,toggle:function(e){for(var t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},handleShowOptions:function(e){this.rows.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},submit:function(){var e=this;return this.formValidation.validateForm(this.form).length>0?i.kX.error(this.$slots["error-invalid"]?this.$slots["error-invalid"][0].text:"No error message provided for having an invalid form.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():(this.formValidation.disableForm(this.form),void 0===this.submitUrl?i.kX.error(this.$slots["error-no-submit-url"]?this.$slots["error-no-submit-url"][0].text:"No error message provided for not having a valid submit url.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():void i.ih[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,this.formValidation.extractForm(this.form)).subscribe((function(t){if("success"===t.status){if(e.submitMethod&&"post"===e.submitMethod.toLowerCase()&&!1!==e.returnUrl)return document.location=t.data.editUrl||e.returnUrl;i.kX.info(t.message,(0,d.__)("Okay"),{duration:3e3}).subscribe(),e.$emit("save",t)}e.formValidation.enableForm(e.form)}),(function(t){i.kX.error(t.message,void 0,{duration:5e3}).subscribe(),void 0!==t.data&&e.formValidation.triggerError(e.form,t.data),e.formValidation.enableForm(e.form)})))},handleGlobalChange:function(e){this.globallyChecked=e,this.rows.forEach((function(t){return t.$checked=e}))},loadForm:function(){var e=this;i.ih.get("".concat(this.src)).subscribe({next:function(t){e.form=e.parseForm(t.form),i.kq.doAction("ns-crud-form-loaded",e),e.$emit("updated",e.form)},error:function(e){i.kX.error(e.message,"OKAY",{duration:0}).subscribe()}})},parseForm:function(e){e.main.value=void 0===e.main.value?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];var t=0;for(var n in e.tabs)0===t&&(e.tabs[n].active=!0),e.tabs[n].active=void 0!==e.tabs[n].active&&e.tabs[n].active,e.tabs[n].fields=this.formValidation.createFields(e.tabs[n].fields),t++;return e}},template:'\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n
    {{ tab.label }}
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n '}),y=s.default.component("ns-textarea",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),_=n(8737),x=s.default.component("ns-multiselect",{data:function(){return{showPanel:!1,search:""}},props:["field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=void 0!==t.selected&&t.selected,e.field.value&&e.field.value.includes(t.value)&&(t.selected=!0),t}))}},methods:{__:d.__,addOption:function(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout((function(){}),100))},removeOption:function(e,t){var n=this;if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout((function(){n.search=""}),100),!1}},mounted:function(){var e=this;this.field.value&&this.field.value.reverse().forEach((function(t){var n=e.field.options.filter((function(e){return e.value===t}));n.length>=0&&e.addOption(n[0])}))},template:'\n
    \n \n
    \n
    \n
    \n
    \n
    \n {{ option.label }}\n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n
    \n '}),w=s.default.component("ns-date",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),k=n(4255),C=s.default.component("ns-media-input",{template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n ',computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},data:function(){return{}},props:["placeholder","leading","type","field"],mounted:function(){},methods:{toggleMedia:function(){var e=this;new Promise((function(t,n){h.G.show(k.default,Object.assign({resolve:t,reject:n},e.field.data||{}))})).then((function(t){"use-selected"===t.event&&(e.field.data&&"url"!==e.field.data.type?e.field.data&&"model"!==e.field.data.type||(e.field.value=t.value[0]):e.field.value=t.value[0].sizes.original,e.$forceUpdate())}))}}}),j=s.default.component("ns-close-button",{template:'\n \n ',methods:{clicked:function(e){this.$emit("click",e)}}}),$=s.default.component("ns-icon-button",{template:'\n \n ',props:["className","buttonClass","type"],methods:{clicked:function(e){this.$emit("click",e)}}}),S=n(1272),E=n.n(S),D=n(5234),P=n.n(D),O=s.default.component("ns-ckeditor",{data:function(){return{editor:P()}},components:{ckeditor:E().component},mounted:function(){},methods:{__:d.__},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),T=s.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),F=s.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),M=n(9408),A=n(2744),q=n(7757),V=n.n(q),Y=n(3601),z=n(8603),H=n(6386);const L={data:function(){return{fields:[],validation:new b.Z}},methods:{__:d.__,popupCloser:z.Z,popupResolver:H.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var Z=n(1900);const R=(0,Z.Z)(L,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[n("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[n("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),n("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return n("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),n("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[n("div",[n("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),n("div",[n("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var I=function(e,t,n,s){return new(n||(n=Promise))((function(i,r){function a(e){try{l(s.next(e))}catch(e){r(e)}}function o(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((s=s.apply(e,t||[])).next())}))};const N={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,d.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:d.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),i.kX.success((0,d.__)("The document has been generated.")).subscribe()}),(function(e){i.kX.error(e.message||(0,d.__)("Unexpected error occured.")).subscribe()}))},clearSelectedEntries:function(){var e=this;h.G.show(Y.default,{title:(0,d.__)("Clear Selected Entries ?"),message:(0,d.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var n=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(n,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(n){n.$checked=e,t.refreshRow(n)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){i.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,d.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){i.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){i.kX.error(e.message).subscribe()}}):void 0:i.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,d.__)("No selection has been made.")).subscribe():i.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,d.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return I(this,void 0,void 0,V().mark((function e(){var t,n=this;return V().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(R),e.next=4,new Promise((function(e,t){h.G.show(R,{resolve:e,reject:t,queryFilters:n.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,i.kX.error(t.message).subscribe()}))}}};const U=(0,Z.Z)(N,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?n("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[n("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?n("div",{staticClass:"px-2 flex items-center justify-center"},[n("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[n("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),n("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[n("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?n("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[n("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2 flex items-center justify-center"},[n("button",{staticClass:"rounded-full\n text-sm\n h-10\n px-3\n outline-none\n border\n ns-crud-button\n ",on:{click:function(t){return e.refresh()}}},[n("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?n("div",{staticClass:"px-2 flex items-center"},[n("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none ",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():n("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?n("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():n("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?n("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),n("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[n("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[n("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?n("table",{staticClass:"table ns-table w-full"},[n("thead",[n("tr",[n("th",{staticClass:"text-center px-2 border w-16 py-2"},[n("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,s){return n("th",{key:s,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(s)}}},[n("div",{staticClass:"w-full flex justify-between items-center"},[n("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),n("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?n("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?n("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),n("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,s){return n("ns-table-row",{key:s,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():n("tr",[n("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?n("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?n:n[0]}}},[n("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,s){return n("option",{key:s,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),n("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),n("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var W=n(4864),B=n(1726),X=n(7259);const G=s.default.extend({methods:{__:d.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,B.createAvatar)(X,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const Q=(0,Z.Z)(G,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[n("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),n("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?n("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?n("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var K=n(4806),J=n(1828),ee=n(1544),te=n(3506);const ne={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:d.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,n,s;e.searchText.length>0&&i.ih[e.method||"post"](e.url,(t={},n=e.searchArgument||"search",s=e.searchText,n in t?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,t)).subscribe({next:function(t){e.results=t},error:function(e){i.kX.error(e.message||(0,d.__)("An unexpected error occured.")).subscribe()}})}),1e3)}},mounted:function(){}};const se=(0,Z.Z)(ne,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-search"},[n("div",{staticClass:"input-group info border-2"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),n("div",{staticClass:"relative"},[n("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?n("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,s){return n("li",{key:s,staticClass:"border-b p-2 cursor-pointer",on:{click:function(n){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},8737:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var s=n(538),i=n(4806),r=n(2744),a=n(9408),o=s.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:i.Z,nsDateTimePicker:r.Z,nsSwitch:a.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\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 '})},1356:(e,t,n)=>{"use strict";n.d(t,{W:()=>c,f:()=>d});var s=n(2077),i=n.n(s),r=n(538),a=n(6740),o=n.n(a),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=r.default.filter("currency",(function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===s){var r={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=o()(e,r).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),d=function(e){var t="0.".concat(l);return parseFloat(i()(e).format(t))}},9698:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var s=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,n)=>{"use strict";function s(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var s=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&s.push(i),e.tabs[n].errors=s.flat(),t.push(s.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var s=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===s.length&&e.tabs[s[0]].fields.forEach((function(e){e.name===s[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var s in t.errors)n(s)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var s in t.errors)n(s)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(s,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){!0===n[t.identifier]&&e.errors.splice(s,1)}))}return e}}],n&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,n)=>{"use strict";n.d(t,{__:()=>s,c:()=>i});var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},6781:(e,t,n)=>{"use strict";function s(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);nc});var c=function(){function e(){var t=this;a(this,e),this.listeners=new Object,document.addEventListener("keydown",(function(e){return t.processEvent(e)}))}return l(e,[{key:"processEvent",value:function(e){var t=this;for(var n in this.listeners){var s=this.listeners[n].getConfig();if(s.hidden.length>0)if(s.hidden.filter((function(e){return e instanceof HTMLElement==!1&&null===document.querySelector(e)})).length!==s.hidden.length)continue;if(s.visible.length>0)if(!(s.visible.filter((function(e){return e instanceof HTMLElement==!0||null!==document.querySelector(e)})).length===s.visible.length))continue;s.callbacks.forEach((function(e){"string"==typeof e.action?t.processSingleAction({action:e.action.trim(),callback:e.callback}):"object"===r(e.action)&&null!==e.action&&e.action.length>0&&e.action.forEach((function(n){t.processSingleAction({action:n.toString().trim(),callback:e.callback})}))}))}}},{key:"processSingleAction",value:function(e){var t=e.action,n=e.callback,s=t.split("+"),i={ctrlKey:!1,altKey:!1,shiftKey:!1};s.forEach((function(e){switch(e){case"ctrl":i.ctrlKey=!0;break;case"alt":i.altKey=!0;break;case"shift":i.shiftKey=!0}}));var r=s.filter((function(e){return!["ctrl","alt","shift"].includes(e)}));this.executeCallback({event,combinableKeys:i,callback:n,key:r[0]})}},{key:"executeCallback",value:function(e){var t=e.event,n=e.callback,s=e.combinableKeys,i=e.key;if(void 0!==t.key&&t.key.toLowerCase()===i.toLowerCase()){var r=!0;for(var a in s)t[a]!==s[a]&&(r=!1);r&&n(t,i)}}},{key:"create",value:function(e){return this.listeners[e]=new d}},{key:"destroy",value:function(e){delete this.listeners[e]}}]),e}(),d=function(){function e(){a(this,e),this.visible=[],this.hidden=[],this.callbacks=[]}return l(e,[{key:"whenVisible",value:function(e){var t;"object"===r(e)?(t=this.visible).push.apply(t,s(e)):this.visible.push(e);return this}},{key:"clearVisible",value:function(){return this.visible=[],this}},{key:"whenNotVisible",value:function(e){var t;e.length>0?(t=this.hidden).push.apply(t,s(e)):this.hidden.push(e);return this}},{key:"clearHidden",value:function(){return this.hidden=[],this}},{key:"whenPressed",value:function(e,t){this.callbacks.push({action:e,callback:t})}},{key:"clearCallbacks",value:function(){return this.callbacks=[],this}},{key:"getConfig",value:function(){return{callbacks:this.callbacks,hidden:this.hidden,visible:this.visible}}}]),e}()},8603:(e,t,n)=>{"use strict";function s(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>s})},6386:(e,t,n)=>{"use strict";function s(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>s})},2242:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var s=n(7757),i=n.n(s),r=n(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new r.x}var t,n,s;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,s,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,i().mark((function a(){var o,l,c,d=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){d.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=r,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],s=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(s);return i.open(t,n),i}}],n&&o(t.prototype,n),s&&o(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var s=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return s.Observable.create((function(s){var r=n.__createSnack({message:e,label:t,type:i.type}),a=r.buttonNode,o=(r.textNode,r.snackWrapper,r.sampleSnack);a.addEventListener("click",(function(e){s.onNext(a),s.onCompleted(),o.remove()})),n.__startTimer(i.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,s=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){s()})),s()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,s=e.type,i=void 0===s?"info":s,r=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),d="",u="";switch(i){case"info":d="",u="info";break;case"error":d="",u="error";break;case"success":d="",u="success"}return o.textContent=t,o.setAttribute("class","pr-2"),n&&(l.setAttribute("class","ns-button default"),c.textContent=n,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(d)),l.appendChild(c)),a.appendChild(o),a.appendChild(l),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(u)),r.appendChild(a),null===document.getElementById("snack-wrapper")&&(r.setAttribute("id","snack-wrapper"),r.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(r)),{snackWrapper:r,sampleSnack:a,buttonsWrapper:l,buttonNode:c,textNode:o}}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9572:(e,t,n)=>{"use strict";var s=n(538),i=(n(824),n(7975)),r=n(1630),a=n.n(r),o=n(6781);window.nsComponents=Object.assign({},i),window.nsHotPress=new o.e,s.default.use(a()),new s.default({el:"#pos-app",mounted:function(){},components:Object.assign({nsPos:function(){return n.e(613).then(n.bind(n,8613))},nsPosCart:function(){return n.e(979).then(n.bind(n,4979))},nsPosGrid:function(){return n.e(913).then(n.bind(n,6913))}},window.nsComponents)})},824:(e,t,n)=>{"use strict";var s=n(381),i=n.n(s);ns.date.moment=i()(ns.date.current),ns.date.interval=setInterval((function(){ns.date.moment.add(1,"seconds"),ns.date.current=i()(ns.date.current).add(1,"seconds").format("YYYY-MM-DD HH:mm:ss")}),1e3),ns.date.getNowString=function(){var e=Date.parse((new Date).toLocaleString("en-US",{timeZone:ns.date.timeZone}));return i()(e).format("YYYY-MM-DD HH:mm:ss")},ns.date.getMoment=function(){var e=Date.parse((new Date).toLocaleString("en-US",{timeZone:ns.date.timeZone}));return i()(e)}},6700:(e,t,n)=>{var s={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=r(e);return n(t)}function r(e){if(!n.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}i.keys=function(){return Object.keys(s)},i.resolve=r,e.exports=i,i.id=6700},4806:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var s=n(538),i=n(381),r=n.n(i),a=n(7144),o=n.n(a),l=(n(9095),n(7389));const c=s.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:o()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:r()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:r()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?r()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const d=(0,n(1900).Z)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?n("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[n("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),n("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[n("i",{staticClass:"las la-times"})]),e._v(" "),n("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[n("div",{staticClass:"flex justify-between items-center w-full py-2"},[n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},2744:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:i(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return i()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?i()():i()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?i()():i()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:n(7389).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker mb-2"},[e.field?n("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),n("div",{staticClass:"ns-button"},[n("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?n("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?n("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?n("span",{staticClass:"mx-1 text-sm"},[null!==e.date?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?n("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?n("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?n("div",{staticClass:"relative z-10 h-0 w-0"},[n("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[n("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[n("i",{staticClass:"las la-minus"})]),e._v(" "),n("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[n("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,s){return n("div",{key:s,staticClass:"h-8 flex justify-center items-center text-sm"},[[n("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),n("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[n("div",{staticClass:"-mx-1 flex justify-between"},[n("div",{staticClass:"px-1"},[n("div",{staticClass:"-mx-1 flex"},[e.field?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[n("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[n("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),n("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},1544:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?i()():i()(this.date),this.build()},methods:{__:n(7389).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker"},[n("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),n("span",{staticClass:"mx-1 text-sm"},[n("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?n("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?n("div",{staticClass:"relative h-0 w-0 -mb-2"},[n("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),n("div")])]):e._e()])}),[],!1,null,null,null).exports},1828:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[n("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),n("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},4864:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var s=n(7389);function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,n){e.inputValue({value:n})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var n=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",n)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,s){return n("div",{key:s,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(n){return e.inputValue(t)}}},[void 0!==t.value?n("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?n("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3506:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},9408:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"mb-2 ns-switch"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,s){return n("button",{key:s,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(n){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},4255:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var s=n(7757),i=n.n(s),r=n(9671),a=n(8603),o=n(7389),l=n(3601);function c(e,t,n,s,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(s,i)}const d={name:"ns-media",props:["popup"],components:{VueUpload:n(2948)},data:function(){return{pages:[{label:(0,o.__)("Upload"),name:"upload",selected:!1},{label:(0,o.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return r.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:a.Z,__:o.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,o.__)("Confirm Your Action"),message:(0,o.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){r.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=i().mark((function e(){var n,s,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),s=i().mark((function e(t){var s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n[t],e.prev=1,s.progress=1,e.next=5,new Promise((function(e,t){var n=new FormData;n.append("file",s.file),r.ih.post("/api/nexopos/v4/medias",n,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){s.uploaded=!0,s.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),s.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),a=0;case 3:if(!(a0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,r.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(n,s){s!==t.response.data.indexOf(e)&&(n.selected=!1)})),e.selected=!e.selected}}};const u=(0,n(1900).Z)(d,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[n("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[n("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),n("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,s){return n("li",{key:s,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(n){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?n("div",{staticClass:"content w-full overflow-hidden flex"},[n("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[n("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),n("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),n("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[n("ul",e._l(e.files,(function(t,s){return n("li",{key:s,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[n("span",[e._v(e._s(t.file.name))]),e._v(" "),n("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?n("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?n("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[n("div"),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),n("div",{staticClass:"flex flex-auto overflow-hidden"},[n("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[n("div",{staticClass:"flex flex-auto"},[n("div",{staticClass:"p-2 overflow-x-auto"},[n("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,s){return n("div",{key:s},[n("div",{staticClass:"p-2"},[n("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(n){return e.selectResource(t)}}},[n("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?n("div",{staticClass:"flex flex-auto items-center justify-center"},[n("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),n("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0 ",attrs:{id:"preview"}},[n("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?n("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?n("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),n("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),n("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),n("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[n("div",{staticClass:"flex -mx-2 flex-shrink-0"},[n("div",{staticClass:"px-2 flex-shrink-0 flex"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[n("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[n("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?n("div",{staticClass:"ns-button error"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[n("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),n("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[n("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),n("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),n("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?n("div",{staticClass:"px-2"},[n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},3601:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var s=n(7389),i=n(6386),r=n(8603);const a={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:s.__,popupResolver:i.Z,popupCloser:r.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[n("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[n("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),n("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),n("div",{staticClass:"action-buttons flex border-t"},[n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),n("hr",{staticClass:"border-r h-16"}),e._v(" "),n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=9572,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[159,198],{9671:(e,t,n)=>{"use strict";n.d(t,{l:()=>Y,kq:()=>R,ih:()=>z,kX:()=>H});var s=n(6486),i=n(9669),r=n(6300),a=n(8345),o=n(9624),l=n(9248),c=n(230);function d(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=R.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:s}),new c.y((function(r){n._client[e](t,s,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,r.next(e.data),r.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;r.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&d(t.prototype,n),s&&d(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=n(3);function p(e,t){for(var n=0;n=1e3){for(var n,s=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=s?e/Math.pow(1e3,s):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][s]}return t})),S=n(1356),E=n(9698);function D(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&q(t.prototype,n),s&&q(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()),N=new b({sidebar:["xs","sm","md"].includes(I.breakpoint)?"hidden":"visible"});z.defineClient(i),window.nsEvent=Y,window.nsHttpClient=z,window.nsSnackBar=H,window.nsCurrency=S.W,window.nsTruncate=E.b,window.nsRawCurrency=S.f,window.nsAbbreviate=$,window.nsState=N,window.nsUrl=L,window.nsScreen=I,window.ChartJS=r,window.EventEmitter=h,window.Popup=x.G,window.RxJS=y,window.FormValidation=k.Z,window.nsCrudHandler=Z},7975:(e,t,n)=>{"use strict";n.r(t),n.d(t,{nsAvatar:()=>Q,nsButton:()=>o,nsCheckbox:()=>p,nsCkeditor:()=>O,nsCloseButton:()=>j,nsCrud:()=>U,nsCrudForm:()=>g,nsDate:()=>w,nsDateRangePicker:()=>K.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>_.P,nsIconButton:()=>$,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>C,nsMenu:()=>r,nsMultiselect:()=>x,nsNotice:()=>J.Z,nsNumpad:()=>W.Z,nsPaginate:()=>te.Z,nsSearch:()=>se,nsSelect:()=>u,nsSelectAudio:()=>f,nsSpinner:()=>v,nsSubmenu:()=>a,nsSwitch:()=>M.Z,nsTableRow:()=>m,nsTabs:()=>T,nsTabsItem:()=>F,nsTextarea:()=>y});var s=n(538),i=n(9671),r=s.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,i.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&i.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,n){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),a=s.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),o=s.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=s.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=s.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),d=n(7389),u=s.default.component("ns-select",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},mounted:function(){},methods:{__:d.__},template:'\n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),f=s.default.component("ns-select-audio",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__:d.__,playSelectedSound:function(){this.field.value.length>0&&new Audio(this.field.value).play()}},template:'\n
    \n \n
    \n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),p=s.default.component("ns-checkbox",{data:function(){return{}},props:["checked","field","label"],template:'\n
    \n
    \n \n
    \n {{ label }}\n {{ field.label }}\n
    \n ',computed:{isChecked:function(){return this.field?this.field.value:this.checked}},methods:{toggleIt:function(){void 0!==this.field&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}}),h=n(2242),m=s.default.component("ns-table-row",{props:["options","row","columns","prependOptions","showOptions"],data:function(){return{optionsToggled:!1}},mounted:function(){},methods:{__:d.__,sanitizeHTML:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.getElementsByTagName("script"),s=n.length;s--;)n[s].parentNode.removeChild(n[s]);return t.innerHTML},getElementOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu:function(e){var t=this;if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout((function(){var e=t.$el.querySelectorAll(".relative > .absolute")[0],n=t.$el.querySelectorAll(".relative")[0],s=t.getElementOffset(n);e.style.top=s.top+"px",e.style.left=s.left+"px",n.classList.remove("relative"),n.classList.add("dropdown-holder")}),100);else{var n=this.$el.querySelectorAll(".dropdown-holder")[0];n.classList.remove("dropdown-holder"),n.classList.add("relative")}},handleChanged:function(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync:function(e){var t=this;e.confirm?confirm(e.confirm.message)&&i.ih[e.type.toLowerCase()](e.url).subscribe((function(e){i.kX.success(e.message).subscribe(),t.$emit("reload",t.row)}),(function(e){t.toggleMenu(),i.kX.error(e.message).subscribe()})):(i.l.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup:function(e,t){var n=window.nsExtraComponents[e.component];if(e.component)return n?new Promise((function(s,i){h.G.show(n,{resolve:s,reject:i,row:t,action:e})})):i.kX.error((0,d.__)('Unable to load the component "'.concat(e.component,'". Make sure the component is registered to "nsExtraComponents".'))).subscribe();this.triggerAsync(e)}},template:'\n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n '}),v=s.default.component("ns-spinner",{data:function(){return{}},mounted:function(){},computed:{validatedSize:function(){return this.size||24},validatedBorder:function(){return this.border||8},validatedAnimation:function(){return this.animation||"fast"}},props:["color","size","border"],template:"\n
    \n
    \n
    \n "}),b=n(7266),g=s.default.component("ns-crud-form",{data:function(){return{form:{},globallyChecked:!1,formValidation:new b.Z,rows:[]}},mounted:function(){this.loadForm()},props:["src","create-url","field-class","return-url","submit-url","submit-method","disable-tabs"],computed:{activeTabFields:function(){for(var e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]}},methods:{__:d.__,toggle:function(e){for(var t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},handleShowOptions:function(e){this.rows.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},submit:function(){var e=this;return this.formValidation.validateForm(this.form).length>0?i.kX.error(this.$slots["error-invalid"]?this.$slots["error-invalid"][0].text:"No error message provided for having an invalid form.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():(this.formValidation.disableForm(this.form),void 0===this.submitUrl?i.kX.error(this.$slots["error-no-submit-url"]?this.$slots["error-no-submit-url"][0].text:"No error message provided for not having a valid submit url.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():void i.ih[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,this.formValidation.extractForm(this.form)).subscribe((function(t){if("success"===t.status){if(e.submitMethod&&"post"===e.submitMethod.toLowerCase()&&!1!==e.returnUrl)return document.location=t.data.editUrl||e.returnUrl;i.kX.info(t.message,(0,d.__)("Okay"),{duration:3e3}).subscribe(),e.$emit("save",t)}e.formValidation.enableForm(e.form)}),(function(t){i.kX.error(t.message,void 0,{duration:5e3}).subscribe(),void 0!==t.data&&e.formValidation.triggerError(e.form,t.data),e.formValidation.enableForm(e.form)})))},handleGlobalChange:function(e){this.globallyChecked=e,this.rows.forEach((function(t){return t.$checked=e}))},loadForm:function(){var e=this;i.ih.get("".concat(this.src)).subscribe({next:function(t){e.form=e.parseForm(t.form),i.kq.doAction("ns-crud-form-loaded",e),e.$emit("updated",e.form)},error:function(e){i.kX.error(e.message,"OKAY",{duration:0}).subscribe()}})},parseForm:function(e){e.main.value=void 0===e.main.value?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];var t=0;for(var n in e.tabs)0===t&&(e.tabs[n].active=!0),e.tabs[n].active=void 0!==e.tabs[n].active&&e.tabs[n].active,e.tabs[n].fields=this.formValidation.createFields(e.tabs[n].fields),t++;return e}},template:'\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n
    {{ tab.label }}
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n '}),y=s.default.component("ns-textarea",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),_=n(8737),x=s.default.component("ns-multiselect",{data:function(){return{showPanel:!1,search:""}},props:["field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=void 0!==t.selected&&t.selected,e.field.value&&e.field.value.includes(t.value)&&(t.selected=!0),t}))}},methods:{__:d.__,addOption:function(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout((function(){}),100))},removeOption:function(e,t){var n=this;if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout((function(){n.search=""}),100),!1}},mounted:function(){var e=this;this.field.value&&this.field.value.reverse().forEach((function(t){var n=e.field.options.filter((function(e){return e.value===t}));n.length>=0&&e.addOption(n[0])}))},template:'\n
    \n \n
    \n
    \n
    \n
    \n
    \n {{ option.label }}\n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n
    \n '}),w=s.default.component("ns-date",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),k=n(4255),C=s.default.component("ns-media-input",{template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n ',computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},data:function(){return{}},props:["placeholder","leading","type","field"],mounted:function(){},methods:{toggleMedia:function(){var e=this;new Promise((function(t,n){h.G.show(k.default,Object.assign({resolve:t,reject:n},e.field.data||{}))})).then((function(t){"use-selected"===t.event&&(e.field.data&&"url"!==e.field.data.type?e.field.data&&"model"!==e.field.data.type||(e.field.value=t.value[0]):e.field.value=t.value[0].sizes.original,e.$forceUpdate())}))}}}),j=s.default.component("ns-close-button",{template:'\n \n ',methods:{clicked:function(e){this.$emit("click",e)}}}),$=s.default.component("ns-icon-button",{template:'\n \n ',props:["className","buttonClass","type"],methods:{clicked:function(e){this.$emit("click",e)}}}),S=n(1272),E=n.n(S),D=n(5234),P=n.n(D),O=s.default.component("ns-ckeditor",{data:function(){return{editor:P()}},components:{ckeditor:E().component},mounted:function(){},methods:{__:d.__},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),T=s.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),F=s.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),M=n(9408),A=n(2744),q=n(7757),V=n.n(q),Y=n(3601),z=n(8603),H=n(6386);const L={data:function(){return{fields:[],validation:new b.Z}},methods:{__:d.__,popupCloser:z.Z,popupResolver:H.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var Z=n(1900);const R=(0,Z.Z)(L,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[n("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[n("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),n("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return n("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),n("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[n("div",[n("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),n("div",[n("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var I=function(e,t,n,s){return new(n||(n=Promise))((function(i,r){function a(e){try{l(s.next(e))}catch(e){r(e)}}function o(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((s=s.apply(e,t||[])).next())}))};const N={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,d.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:d.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),i.kX.success((0,d.__)("The document has been generated.")).subscribe()}),(function(e){i.kX.error(e.message||(0,d.__)("Unexpected error occured.")).subscribe()}))},clearSelectedEntries:function(){var e=this;h.G.show(Y.default,{title:(0,d.__)("Clear Selected Entries ?"),message:(0,d.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var n=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(n,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(n){n.$checked=e,t.refreshRow(n)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){i.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,d.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){i.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){i.kX.error(e.message).subscribe()}}):void 0:i.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,d.__)("No selection has been made.")).subscribe():i.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,d.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return I(this,void 0,void 0,V().mark((function e(){var t,n=this;return V().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(R),e.next=4,new Promise((function(e,t){h.G.show(R,{resolve:e,reject:t,queryFilters:n.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,i.kX.error(t.message).subscribe()}))}}};const U=(0,Z.Z)(N,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?n("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[n("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?n("div",{staticClass:"px-2 flex items-center justify-center"},[n("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[n("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),n("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[n("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?n("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[n("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2 flex items-center justify-center"},[n("button",{staticClass:"rounded-full\n text-sm\n h-10\n px-3\n outline-none\n border\n ns-crud-button\n ",on:{click:function(t){return e.refresh()}}},[n("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?n("div",{staticClass:"px-2 flex items-center"},[n("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none ",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():n("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?n("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():n("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?n("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),n("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[n("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[n("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?n("table",{staticClass:"table ns-table w-full"},[n("thead",[n("tr",[n("th",{staticClass:"text-center px-2 border w-16 py-2"},[n("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,s){return n("th",{key:s,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(s)}}},[n("div",{staticClass:"w-full flex justify-between items-center"},[n("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),n("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?n("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?n("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),n("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,s){return n("ns-table-row",{key:s,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():n("tr",[n("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?n("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?n:n[0]}}},[n("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,s){return n("option",{key:s,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),n("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),n("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var W=n(4864),B=n(1726),X=n(7259);const G=s.default.extend({methods:{__:d.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,B.createAvatar)(X,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const Q=(0,Z.Z)(G,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[n("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),n("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?n("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?n("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var K=n(4806),J=n(1828),ee=n(1544),te=n(3506);const ne={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:d.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,n,s;e.searchText.length>0&&i.ih[e.method||"post"](e.url,(t={},n=e.searchArgument||"search",s=e.searchText,n in t?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,t)).subscribe({next:function(t){e.results=t},error:function(e){i.kX.error(e.message||(0,d.__)("An unexpected error occured.")).subscribe()}})}),1e3)}},mounted:function(){}};const se=(0,Z.Z)(ne,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-search"},[n("div",{staticClass:"input-group info border-2"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),n("div",{staticClass:"relative"},[n("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?n("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,s){return n("li",{key:s,staticClass:"border-b p-2 cursor-pointer",on:{click:function(n){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},8737:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var s=n(538),i=n(4806),r=n(2744),a=n(9408),o=s.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:i.Z,nsDateTimePicker:r.Z,nsSwitch:a.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\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 '})},1356:(e,t,n)=>{"use strict";n.d(t,{W:()=>c,f:()=>d});var s=n(2077),i=n.n(s),r=n(538),a=n(6740),o=n.n(a),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=r.default.filter("currency",(function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===s){var r={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=o()(e,r).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),d=function(e){var t="0.".concat(l);return parseFloat(i()(e).format(t))}},9698:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var s=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,n)=>{"use strict";function s(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var s=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&s.push(i),e.tabs[n].errors=s.flat(),t.push(s.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var s=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===s.length&&e.tabs[s[0]].fields.forEach((function(e){e.name===s[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var s in t.errors)n(s)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var s in t.errors)n(s)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(s,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){!0===n[t.identifier]&&e.errors.splice(s,1)}))}return e}}],n&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,n)=>{"use strict";n.d(t,{__:()=>s,c:()=>i});var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},6781:(e,t,n)=>{"use strict";function s(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);nc});var c=function(){function e(){var t=this;a(this,e),this.listeners=new Object,document.addEventListener("keydown",(function(e){return t.processEvent(e)}))}return l(e,[{key:"processEvent",value:function(e){var t=this;for(var n in this.listeners){var s=this.listeners[n].getConfig();if(s.hidden.length>0)if(s.hidden.filter((function(e){return e instanceof HTMLElement==!1&&null===document.querySelector(e)})).length!==s.hidden.length)continue;if(s.visible.length>0)if(!(s.visible.filter((function(e){return e instanceof HTMLElement==!0||null!==document.querySelector(e)})).length===s.visible.length))continue;s.callbacks.forEach((function(e){"string"==typeof e.action?t.processSingleAction({action:e.action.trim(),callback:e.callback}):"object"===r(e.action)&&null!==e.action&&e.action.length>0&&e.action.forEach((function(n){t.processSingleAction({action:n.toString().trim(),callback:e.callback})}))}))}}},{key:"processSingleAction",value:function(e){var t=e.action,n=e.callback,s=t.split("+"),i={ctrlKey:!1,altKey:!1,shiftKey:!1};s.forEach((function(e){switch(e){case"ctrl":i.ctrlKey=!0;break;case"alt":i.altKey=!0;break;case"shift":i.shiftKey=!0}}));var r=s.filter((function(e){return!["ctrl","alt","shift"].includes(e)}));this.executeCallback({event,combinableKeys:i,callback:n,key:r[0]})}},{key:"executeCallback",value:function(e){var t=e.event,n=e.callback,s=e.combinableKeys,i=e.key;if(void 0!==t.key&&t.key.toLowerCase()===i.toLowerCase()){var r=!0;for(var a in s)t[a]!==s[a]&&(r=!1);r&&n(t,i)}}},{key:"create",value:function(e){return this.listeners[e]=new d}},{key:"destroy",value:function(e){delete this.listeners[e]}}]),e}(),d=function(){function e(){a(this,e),this.visible=[],this.hidden=[],this.callbacks=[]}return l(e,[{key:"whenVisible",value:function(e){var t;"object"===r(e)?(t=this.visible).push.apply(t,s(e)):this.visible.push(e);return this}},{key:"clearVisible",value:function(){return this.visible=[],this}},{key:"whenNotVisible",value:function(e){var t;e.length>0?(t=this.hidden).push.apply(t,s(e)):this.hidden.push(e);return this}},{key:"clearHidden",value:function(){return this.hidden=[],this}},{key:"whenPressed",value:function(e,t){this.callbacks.push({action:e,callback:t})}},{key:"clearCallbacks",value:function(){return this.callbacks=[],this}},{key:"getConfig",value:function(){return{callbacks:this.callbacks,hidden:this.hidden,visible:this.visible}}}]),e}()},8603:(e,t,n)=>{"use strict";function s(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>s})},6386:(e,t,n)=>{"use strict";function s(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>s})},2242:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var s=n(7757),i=n.n(s),r=n(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new r.x}var t,n,s;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,s,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,i().mark((function a(){var o,l,c,d=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){d.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=r,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],s=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(s);return i.open(t,n),i}}],n&&o(t.prototype,n),s&&o(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var s=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return s.Observable.create((function(s){var r=n.__createSnack({message:e,label:t,type:i.type}),a=r.buttonNode,o=(r.textNode,r.snackWrapper,r.sampleSnack);a.addEventListener("click",(function(e){s.onNext(a),s.onCompleted(),o.remove()})),n.__startTimer(i.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,s=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){s()})),s()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,s=e.type,i=void 0===s?"info":s,r=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),d="",u="";switch(i){case"info":d="",u="info";break;case"error":d="",u="error";break;case"success":d="",u="success"}return o.textContent=t,o.setAttribute("class","pr-2"),n&&(l.setAttribute("class","ns-button default"),c.textContent=n,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(d)),l.appendChild(c)),a.appendChild(o),a.appendChild(l),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(u)),r.appendChild(a),null===document.getElementById("snack-wrapper")&&(r.setAttribute("id","snack-wrapper"),r.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(r)),{snackWrapper:r,sampleSnack:a,buttonsWrapper:l,buttonNode:c,textNode:o}}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9572:(e,t,n)=>{"use strict";var s=n(538),i=(n(824),n(7975)),r=n(1630),a=n.n(r),o=n(6781);window.nsComponents=Object.assign({},i),window.nsHotPress=new o.e,s.default.use(a()),new s.default({el:"#pos-app",mounted:function(){},components:Object.assign({nsPos:function(){return n.e(613).then(n.bind(n,8613))},nsPosCart:function(){return n.e(979).then(n.bind(n,4979))},nsPosGrid:function(){return n.e(913).then(n.bind(n,6913))}},window.nsComponents)})},824:(e,t,n)=>{"use strict";var s=n(381),i=n.n(s);ns.date.moment=i()(ns.date.current),ns.date.interval=setInterval((function(){ns.date.moment.add(1,"seconds"),ns.date.current=i()(ns.date.current).add(1,"seconds").format("YYYY-MM-DD HH:mm:ss")}),1e3),ns.date.getNowString=function(){var e=Date.parse((new Date).toLocaleString("en-US",{timeZone:ns.date.timeZone}));return i()(e).format("YYYY-MM-DD HH:mm:ss")},ns.date.getMoment=function(){var e=Date.parse((new Date).toLocaleString("en-US",{timeZone:ns.date.timeZone}));return i()(e)}},6700:(e,t,n)=>{var s={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=r(e);return n(t)}function r(e){if(!n.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}i.keys=function(){return Object.keys(s)},i.resolve=r,e.exports=i,i.id=6700},4806:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var s=n(538),i=n(381),r=n.n(i),a=n(7144),o=n.n(a),l=(n(9095),n(7389));const c=s.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:o()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:r()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:r()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?r()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const d=(0,n(1900).Z)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?n("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[n("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),n("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[n("i",{staticClass:"las la-times"})]),e._v(" "),n("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[n("div",{staticClass:"flex justify-between items-center w-full py-2"},[n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},2744:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:i(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return i()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?i()():i()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?i()():i()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:n(7389).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker mb-2"},[e.field?n("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),n("div",{staticClass:"ns-button"},[n("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?n("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?n("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?n("span",{staticClass:"mx-1 text-sm"},[null!==e.date?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?n("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?n("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?n("div",{staticClass:"relative z-10 h-0 w-0"},[n("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[n("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[n("i",{staticClass:"las la-minus"})]),e._v(" "),n("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[n("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,s){return n("div",{key:s,staticClass:"h-8 flex justify-center items-center text-sm"},[[n("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),n("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[n("div",{staticClass:"-mx-1 flex justify-between"},[n("div",{staticClass:"px-1"},[n("div",{staticClass:"-mx-1 flex"},[e.field?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[n("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[n("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),n("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},1544:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?i()():i()(this.date),this.build()},methods:{__:n(7389).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker"},[n("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),n("span",{staticClass:"mx-1 text-sm"},[n("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?n("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?n("div",{staticClass:"relative h-0 w-0 -mb-2"},[n("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),n("div")])]):e._e()])}),[],!1,null,null,null).exports},1828:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[n("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),n("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},4864:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var s=n(7389);function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,n){e.inputValue({value:n})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var n=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",n)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,s){return n("div",{key:s,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(n){return e.inputValue(t)}}},[void 0!==t.value?n("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?n("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3506:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},9408:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"mb-2 ns-switch"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,s){return n("button",{key:s,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(n){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},4255:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var s=n(7757),i=n.n(s),r=n(9671),a=n(8603),o=n(7389),l=n(3601);function c(e,t,n,s,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(s,i)}const d={name:"ns-media",props:["popup"],components:{VueUpload:n(2948)},data:function(){return{pages:[{label:(0,o.__)("Upload"),name:"upload",selected:!1},{label:(0,o.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return r.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:a.Z,__:o.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,o.__)("Confirm Your Action"),message:(0,o.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){r.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=i().mark((function e(){var n,s,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),s=i().mark((function e(t){var s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n[t],e.prev=1,s.progress=1,e.next=5,new Promise((function(e,t){var n=new FormData;n.append("file",s.file),r.ih.post("/api/nexopos/v4/medias",n,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){s.uploaded=!0,s.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),s.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),a=0;case 3:if(!(a0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,r.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(n,s){s!==t.response.data.indexOf(e)&&(n.selected=!1)})),e.selected=!e.selected}}};const u=(0,n(1900).Z)(d,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[n("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[n("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),n("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,s){return n("li",{key:s,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(n){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?n("div",{staticClass:"content w-full overflow-hidden flex"},[n("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[n("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),n("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),n("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[n("ul",e._l(e.files,(function(t,s){return n("li",{key:s,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[n("span",[e._v(e._s(t.file.name))]),e._v(" "),n("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?n("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?n("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[n("div"),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),n("div",{staticClass:"flex flex-auto overflow-hidden"},[n("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[n("div",{staticClass:"flex flex-auto"},[n("div",{staticClass:"p-2 overflow-x-auto"},[n("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,s){return n("div",{key:s},[n("div",{staticClass:"p-2"},[n("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(n){return e.selectResource(t)}}},[n("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?n("div",{staticClass:"flex flex-auto items-center justify-center"},[n("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),n("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0 ",attrs:{id:"preview"}},[n("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?n("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?n("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),n("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),n("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),n("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[n("div",{staticClass:"flex -mx-2 flex-shrink-0"},[n("div",{staticClass:"px-2 flex-shrink-0 flex"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[n("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[n("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?n("div",{staticClass:"ns-button error"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[n("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),n("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[n("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),n("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),n("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?n("div",{staticClass:"px-2"},[n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},3601:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var s=n(7389),i=n(6386),r=n(8603);const a={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:s.__,popupResolver:i.Z,popupCloser:r.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[n("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[n("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),n("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),n("div",{staticClass:"action-buttons flex border-t"},[n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),n("hr",{staticClass:"border-r h-16"}),e._v(" "),n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=9572,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/public/js/setup.min.js b/public/js/setup.min.js index 63c5bc823..94b0a35e2 100644 --- a/public/js/setup.min.js +++ b/public/js/setup.min.js @@ -1 +1 @@ -(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[312,198],{9671:(e,t,n)=>{"use strict";n.d(t,{l:()=>V,kq:()=>R,ih:()=>Y,kX:()=>H});var s=n(6486),i=n(9669),r=n(6300),a=n(8345),o=n(9624),l=n(9248),c=n(230);function d(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=R.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:s}),new c.y((function(r){n._client[e](t,s,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,r.next(e.data),r.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;r.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&d(t.prototype,n),s&&d(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=n(3);function p(e,t){for(var n=0;n=1e3){for(var n,s=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=s?e/Math.pow(1e3,s):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][s]}return t})),P=n(1356),E=n(9698);function S(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&q(t.prototype,n),s&&q(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()),N=new b({sidebar:["xs","sm","md"].includes(I.breakpoint)?"hidden":"visible"});Y.defineClient(i),window.nsEvent=V,window.nsHttpClient=Y,window.nsSnackBar=H,window.nsCurrency=P.W,window.nsTruncate=E.b,window.nsRawCurrency=P.f,window.nsAbbreviate=$,window.nsState=N,window.nsUrl=Z,window.nsScreen=I,window.ChartJS=r,window.EventEmitter=h,window.Popup=x.G,window.RxJS=y,window.FormValidation=k.Z,window.nsCrudHandler=L},7975:(e,t,n)=>{"use strict";n.r(t),n.d(t,{nsAvatar:()=>Q,nsButton:()=>o,nsCheckbox:()=>p,nsCkeditor:()=>O,nsCloseButton:()=>j,nsCrud:()=>U,nsCrudForm:()=>g,nsDate:()=>w,nsDateRangePicker:()=>K.Z,nsDateTimePicker:()=>M.Z,nsDatepicker:()=>ee.Z,nsField:()=>_.P,nsIconButton:()=>$,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>C,nsMenu:()=>r,nsMultiselect:()=>x,nsNotice:()=>J.Z,nsNumpad:()=>W.Z,nsPaginate:()=>te.Z,nsSearch:()=>se,nsSelect:()=>u,nsSelectAudio:()=>f,nsSpinner:()=>v,nsSubmenu:()=>a,nsSwitch:()=>A.Z,nsTableRow:()=>m,nsTabs:()=>F,nsTabsItem:()=>T,nsTextarea:()=>y});var s=n(538),i=n(9671),r=s.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,i.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&i.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,n){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),a=s.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),o=s.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=s.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=s.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),d=n(7389),u=s.default.component("ns-select",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},mounted:function(){},methods:{__:d.__},template:'\n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),f=s.default.component("ns-select-audio",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__:d.__,playSelectedSound:function(){this.field.value.length>0&&new Audio(this.field.value).play()}},template:'\n
    \n \n
    \n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),p=s.default.component("ns-checkbox",{data:function(){return{}},props:["checked","field","label"],template:'\n
    \n
    \n \n
    \n {{ label }}\n {{ field.label }}\n
    \n ',computed:{isChecked:function(){return this.field?this.field.value:this.checked}},methods:{toggleIt:function(){void 0!==this.field&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}}),h=n(2242),m=s.default.component("ns-table-row",{props:["options","row","columns","prependOptions","showOptions"],data:function(){return{optionsToggled:!1}},mounted:function(){},methods:{__:d.__,sanitizeHTML:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.getElementsByTagName("script"),s=n.length;s--;)n[s].parentNode.removeChild(n[s]);return t.innerHTML},getElementOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu:function(e){var t=this;if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout((function(){var e=t.$el.querySelectorAll(".relative > .absolute")[0],n=t.$el.querySelectorAll(".relative")[0],s=t.getElementOffset(n);e.style.top=s.top+"px",e.style.left=s.left+"px",n.classList.remove("relative"),n.classList.add("dropdown-holder")}),100);else{var n=this.$el.querySelectorAll(".dropdown-holder")[0];n.classList.remove("dropdown-holder"),n.classList.add("relative")}},handleChanged:function(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync:function(e){var t=this;e.confirm?confirm(e.confirm.message)&&i.ih[e.type.toLowerCase()](e.url).subscribe((function(e){i.kX.success(e.message).subscribe(),t.$emit("reload",t.row)}),(function(e){t.toggleMenu(),i.kX.error(e.message).subscribe()})):(i.l.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup:function(e,t){var n=window.nsExtraComponents[e.component];if(e.component)return n?new Promise((function(s,i){h.G.show(n,{resolve:s,reject:i,row:t,action:e})})):i.kX.error((0,d.__)('Unable to load the component "'.concat(e.component,'". Make sure the component is registered to "nsExtraComponents".'))).subscribe();this.triggerAsync(e)}},template:'\n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n '}),v=s.default.component("ns-spinner",{data:function(){return{}},mounted:function(){},computed:{validatedSize:function(){return this.size||24},validatedBorder:function(){return this.border||8},validatedAnimation:function(){return this.animation||"fast"}},props:["color","size","border"],template:"\n
    \n
    \n
    \n "}),b=n(7266),g=s.default.component("ns-crud-form",{data:function(){return{form:{},globallyChecked:!1,formValidation:new b.Z,rows:[]}},mounted:function(){this.loadForm()},props:["src","create-url","field-class","return-url","submit-url","submit-method","disable-tabs"],computed:{activeTabFields:function(){for(var e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]}},methods:{__:d.__,toggle:function(e){for(var t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},handleShowOptions:function(e){this.rows.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},submit:function(){var e=this;return this.formValidation.validateForm(this.form).length>0?i.kX.error(this.$slots["error-invalid"]?this.$slots["error-invalid"][0].text:"No error message provided for having an invalid form.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():(this.formValidation.disableForm(this.form),void 0===this.submitUrl?i.kX.error(this.$slots["error-no-submit-url"]?this.$slots["error-no-submit-url"][0].text:"No error message provided for not having a valid submit url.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():void i.ih[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,this.formValidation.extractForm(this.form)).subscribe((function(t){if("success"===t.status){if(e.submitMethod&&"post"===e.submitMethod.toLowerCase()&&!1!==e.returnUrl)return document.location=t.data.editUrl||e.returnUrl;i.kX.info(t.message,(0,d.__)("Okay"),{duration:3e3}).subscribe(),e.$emit("save",t)}e.formValidation.enableForm(e.form)}),(function(t){i.kX.error(t.message,void 0,{duration:5e3}).subscribe(),void 0!==t.data&&e.formValidation.triggerError(e.form,t.data),e.formValidation.enableForm(e.form)})))},handleGlobalChange:function(e){this.globallyChecked=e,this.rows.forEach((function(t){return t.$checked=e}))},loadForm:function(){var e=this;i.ih.get("".concat(this.src)).subscribe({next:function(t){e.form=e.parseForm(t.form),i.kq.doAction("ns-crud-form-loaded",e),e.$emit("updated",e.form)},error:function(e){i.kX.error(e.message,"OKAY",{duration:0}).subscribe()}})},parseForm:function(e){e.main.value=void 0===e.main.value?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];var t=0;for(var n in e.tabs)0===t&&(e.tabs[n].active=!0),e.tabs[n].active=void 0!==e.tabs[n].active&&e.tabs[n].active,e.tabs[n].fields=this.formValidation.createFields(e.tabs[n].fields),t++;return e}},template:'\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n
    {{ tab.label }}
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n '}),y=s.default.component("ns-textarea",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),_=n(8737),x=s.default.component("ns-multiselect",{data:function(){return{showPanel:!1,search:""}},props:["field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=void 0!==t.selected&&t.selected,e.field.value&&e.field.value.includes(t.value)&&(t.selected=!0),t}))}},methods:{__:d.__,addOption:function(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout((function(){}),100))},removeOption:function(e,t){var n=this;if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout((function(){n.search=""}),100),!1}},mounted:function(){var e=this;this.field.value&&this.field.value.reverse().forEach((function(t){var n=e.field.options.filter((function(e){return e.value===t}));n.length>=0&&e.addOption(n[0])}))},template:'\n
    \n \n
    \n
    \n
    \n
    \n
    \n {{ option.label }}\n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n
    \n '}),w=s.default.component("ns-date",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),k=n(4255),C=s.default.component("ns-media-input",{template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n ',computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},data:function(){return{}},props:["placeholder","leading","type","field"],mounted:function(){},methods:{toggleMedia:function(){var e=this;new Promise((function(t,n){h.G.show(k.default,Object.assign({resolve:t,reject:n},e.field.data||{}))})).then((function(t){"use-selected"===t.event&&(e.field.data&&"url"!==e.field.data.type?e.field.data&&"model"!==e.field.data.type||(e.field.value=t.value[0]):e.field.value=t.value[0].sizes.original,e.$forceUpdate())}))}}}),j=s.default.component("ns-close-button",{template:'\n \n ',methods:{clicked:function(e){this.$emit("click",e)}}}),$=s.default.component("ns-icon-button",{template:'\n \n ',props:["className","buttonClass","type"],methods:{clicked:function(e){this.$emit("click",e)}}}),P=n(1272),E=n.n(P),S=n(5234),D=n.n(S),O=s.default.component("ns-ckeditor",{data:function(){return{editor:D()}},components:{ckeditor:E().component},mounted:function(){},methods:{__:d.__},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),F=s.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),T=s.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),A=n(9408),M=n(2744),q=n(7757),z=n.n(q),V=n(3601),Y=n(8603),H=n(6386);const Z={data:function(){return{fields:[],validation:new b.Z}},methods:{__:d.__,popupCloser:Y.Z,popupResolver:H.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var L=n(1900);const R=(0,L.Z)(Z,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[n("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[n("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),n("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return n("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),n("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[n("div",[n("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),n("div",[n("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var I=function(e,t,n,s){return new(n||(n=Promise))((function(i,r){function a(e){try{l(s.next(e))}catch(e){r(e)}}function o(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((s=s.apply(e,t||[])).next())}))};const N={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,d.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:d.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),i.kX.success((0,d.__)("The document has been generated.")).subscribe()}),(function(e){i.kX.error(e.message||(0,d.__)("Unexpected error occured.")).subscribe()}))},clearSelectedEntries:function(){var e=this;h.G.show(V.default,{title:(0,d.__)("Clear Selected Entries ?"),message:(0,d.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var n=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(n,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(n){n.$checked=e,t.refreshRow(n)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){i.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,d.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){i.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){i.kX.error(e.message).subscribe()}}):void 0:i.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,d.__)("No selection has been made.")).subscribe():i.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,d.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return I(this,void 0,void 0,z().mark((function e(){var t,n=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(R),e.next=4,new Promise((function(e,t){h.G.show(R,{resolve:e,reject:t,queryFilters:n.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,i.kX.error(t.message).subscribe()}))}}};const U=(0,L.Z)(N,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?n("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[n("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?n("div",{staticClass:"px-2 flex items-center justify-center"},[n("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[n("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),n("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[n("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?n("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[n("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2 flex items-center justify-center"},[n("button",{staticClass:"rounded-full\n text-sm\n h-10\n px-3\n outline-none\n border\n ns-crud-button\n ",on:{click:function(t){return e.refresh()}}},[n("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?n("div",{staticClass:"px-2 flex items-center"},[n("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none ",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():n("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?n("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():n("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?n("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),n("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[n("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[n("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?n("table",{staticClass:"table ns-table w-full"},[n("thead",[n("tr",[n("th",{staticClass:"text-center px-2 border w-16 py-2"},[n("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,s){return n("th",{key:s,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(s)}}},[n("div",{staticClass:"w-full flex justify-between items-center"},[n("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),n("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?n("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?n("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),n("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,s){return n("ns-table-row",{key:s,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():n("tr",[n("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?n("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?n:n[0]}}},[n("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,s){return n("option",{key:s,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),n("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),n("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var W=n(4864),B=n(1726),X=n(7259);const G=s.default.extend({methods:{__:d.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,B.createAvatar)(X,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const Q=(0,L.Z)(G,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[n("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),n("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?n("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?n("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var K=n(4806),J=n(1828),ee=n(1544),te=n(3506);const ne={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:d.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,n,s;e.searchText.length>0&&i.ih[e.method||"post"](e.url,(t={},n=e.searchArgument||"search",s=e.searchText,n in t?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,t)).subscribe({next:function(t){e.results=t},error:function(e){i.kX.error(e.message||(0,d.__)("An unexpected error occured.")).subscribe()}})}),1e3)}},mounted:function(){}};const se=(0,L.Z)(ne,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-search"},[n("div",{staticClass:"input-group info border-2"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),n("div",{staticClass:"relative"},[n("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?n("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,s){return n("li",{key:s,staticClass:"border-b p-2 cursor-pointer",on:{click:function(n){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},8737:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var s=n(538),i=n(4806),r=n(2744),a=n(9408),o=s.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:i.Z,nsDateTimePicker:r.Z,nsSwitch:a.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\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 '})},1356:(e,t,n)=>{"use strict";n.d(t,{W:()=>c,f:()=>d});var s=n(2077),i=n.n(s),r=n(538),a=n(6740),o=n.n(a),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=r.default.filter("currency",(function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===s){var r={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=o()(e,r).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),d=function(e){var t="0.".concat(l);return parseFloat(i()(e).format(t))}},9698:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var s=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,n)=>{"use strict";function s(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var s=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&s.push(i),e.tabs[n].errors=s.flat(),t.push(s.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var s=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===s.length&&e.tabs[s[0]].fields.forEach((function(e){e.name===s[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var s in t.errors)n(s)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var s in t.errors)n(s)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(s,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){!0===n[t.identifier]&&e.errors.splice(s,1)}))}return e}}],n&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,n)=>{"use strict";n.d(t,{__:()=>s,c:()=>i});var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},8603:(e,t,n)=>{"use strict";function s(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>s})},6386:(e,t,n)=>{"use strict";function s(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>s})},2242:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var s=n(7757),i=n.n(s),r=n(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new r.x}var t,n,s;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,s,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,i().mark((function a(){var o,l,c,d=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){d.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=r,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],s=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(s);return i.open(t,n),i}}],n&&o(t.prototype,n),s&&o(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var s=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return s.Observable.create((function(s){var r=n.__createSnack({message:e,label:t,type:i.type}),a=r.buttonNode,o=(r.textNode,r.snackWrapper,r.sampleSnack);a.addEventListener("click",(function(e){s.onNext(a),s.onCompleted(),o.remove()})),n.__startTimer(i.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,s=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){s()})),s()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,s=e.type,i=void 0===s?"info":s,r=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),d="",u="";switch(i){case"info":d="",u="info";break;case"error":d="",u="error";break;case"success":d="",u="success"}return o.textContent=t,o.setAttribute("class","pr-2"),n&&(l.setAttribute("class","ns-button default"),c.textContent=n,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(d)),l.appendChild(c)),a.appendChild(o),a.appendChild(l),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(u)),r.appendChild(a),null===document.getElementById("snack-wrapper")&&(r.setAttribute("id","snack-wrapper"),r.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(r)),{snackWrapper:r,sampleSnack:a,buttonsWrapper:l,buttonNode:c,textNode:o}}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},5767:(e,t,n)=>{"use strict";n.d(t,{c:()=>a});var s=n(538),i=n(8345),r=[{path:"/",component:n(6068).Z},{path:"/database",component:n(1983).Z},{path:"/configuration",component:n(4381).Z}];s.default.use(i.ZP);var a=new i.ZP({routes:r});new s.default({router:a}).$mount("#nexopos-setup")},6700:(e,t,n)=>{var s={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=r(e);return n(t)}function r(e){if(!n.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}i.keys=function(){return Object.keys(s)},i.resolve=r,e.exports=i,i.id=6700},4806:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var s=n(538),i=n(381),r=n.n(i),a=n(7144),o=n.n(a),l=(n(9095),n(7389));const c=s.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:o()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:r()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:r()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?r()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const d=(0,n(1900).Z)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?n("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[n("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),n("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[n("i",{staticClass:"las la-times"})]),e._v(" "),n("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[n("div",{staticClass:"flex justify-between items-center w-full py-2"},[n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},2744:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:i(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return i()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?i()():i()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?i()():i()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:n(7389).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker mb-2"},[e.field?n("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),n("div",{staticClass:"ns-button"},[n("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?n("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?n("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?n("span",{staticClass:"mx-1 text-sm"},[null!==e.date?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?n("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?n("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?n("div",{staticClass:"relative z-10 h-0 w-0"},[n("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[n("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[n("i",{staticClass:"las la-minus"})]),e._v(" "),n("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[n("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,s){return n("div",{key:s,staticClass:"h-8 flex justify-center items-center text-sm"},[[n("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),n("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[n("div",{staticClass:"-mx-1 flex justify-between"},[n("div",{staticClass:"px-1"},[n("div",{staticClass:"-mx-1 flex"},[e.field?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[n("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[n("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),n("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},1544:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?i()():i()(this.date),this.build()},methods:{__:n(7389).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker"},[n("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),n("span",{staticClass:"mx-1 text-sm"},[n("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?n("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?n("div",{staticClass:"relative h-0 w-0 -mb-2"},[n("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),n("div")])]):e._e()])}),[],!1,null,null,null).exports},1828:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[n("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),n("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},4864:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var s=n(7389);function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,n){e.inputValue({value:n})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var n=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",n)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,s){return n("div",{key:s,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(n){return e.inputValue(t)}}},[void 0!==t.value?n("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?n("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3506:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},9408:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"mb-2 ns-switch"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,s){return n("button",{key:s,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(n){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},4255:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var s=n(7757),i=n.n(s),r=n(9671),a=n(8603),o=n(7389),l=n(3601);function c(e,t,n,s,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(s,i)}const d={name:"ns-media",props:["popup"],components:{VueUpload:n(2948)},data:function(){return{pages:[{label:(0,o.__)("Upload"),name:"upload",selected:!1},{label:(0,o.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return r.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:a.Z,__:o.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,o.__)("Confirm Your Action"),message:(0,o.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){r.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=i().mark((function e(){var n,s,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),s=i().mark((function e(t){var s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n[t],e.prev=1,s.progress=1,e.next=5,new Promise((function(e,t){var n=new FormData;n.append("file",s.file),r.ih.post("/api/nexopos/v4/medias",n,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){s.uploaded=!0,s.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),s.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),a=0;case 3:if(!(a0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,r.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(n,s){s!==t.response.data.indexOf(e)&&(n.selected=!1)})),e.selected=!e.selected}}};const u=(0,n(1900).Z)(d,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[n("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[n("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),n("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,s){return n("li",{key:s,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(n){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?n("div",{staticClass:"content w-full overflow-hidden flex"},[n("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[n("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),n("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),n("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[n("ul",e._l(e.files,(function(t,s){return n("li",{key:s,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[n("span",[e._v(e._s(t.file.name))]),e._v(" "),n("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?n("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?n("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[n("div"),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),n("div",{staticClass:"flex flex-auto overflow-hidden"},[n("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[n("div",{staticClass:"flex flex-auto"},[n("div",{staticClass:"p-2 overflow-x-auto"},[n("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,s){return n("div",{key:s},[n("div",{staticClass:"p-2"},[n("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(n){return e.selectResource(t)}}},[n("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?n("div",{staticClass:"flex flex-auto items-center justify-center"},[n("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),n("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0 ",attrs:{id:"preview"}},[n("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?n("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?n("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),n("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),n("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),n("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[n("div",{staticClass:"flex -mx-2 flex-shrink-0"},[n("div",{staticClass:"px-2 flex-shrink-0 flex"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[n("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[n("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?n("div",{staticClass:"ns-button error"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[n("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),n("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[n("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),n("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),n("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?n("div",{staticClass:"px-2"},[n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},1983:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var s=n(7266),i=n(5767);function r(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n{"use strict";n.d(t,{Z:()=>o});var s=n(7266),i=n(9671),r=n(5767);const a={data:function(){return{form:new s.Z,fields:[],processing:!1,steps:[],failure:0,maxFailure:2}},methods:{validate:function(){},verifyDBConnectivity:function(){},saveConfiguration:function(e){var t=this;return this.form.disableFields(this.fields),this.processing=!0,i.ih.post("/api/nexopos/v4/setup/configuration",this.form.getValue(this.fields)).subscribe((function(e){document.location="/sign-in"}),(function(e){t.processing=!1,t.form.enableFields(t.fields),t.form.triggerFieldsErrors(t.fields,e.data),i.kX.error(e.message,"OK").subscribe()}))},checkDatabase:function(){var e=this;i.ih.get("/api/nexopos/v4/setup/database").subscribe((function(t){e.fields=e.form.createFields([{label:"Application",description:"That is the application name.",name:"ns_store_name",validation:"required"},{label:"Username",description:"Provide the administrator username.",name:"admin_username",validation:"required"},{label:"Email",description:"Provide the administrator email.",name:"admin_email",validation:"required"},{label:"Password",type:"password",description:"What should be the password required for authentication.",name:"password",validation:"required"},{label:"Confirm Password",type:"password",description:"Should be the same as the password above.",name:"confirm_password",validation:"required"}])}),(function(e){console.log(e),r.c.push("/database"),i.kX.error("You need to define database settings","OKAY",{duration:3e3}).subscribe()}))}},mounted:function(){this.checkDatabase()}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[0===e.fields.length?n("ns-spinner",{attrs:{size:"12",border:"4",animation:"fast"}}):e._e(),e._v(" "),e.fields.length>0?n("div",{staticClass:"bg-white rounded shadow my-2"},[n("div",{staticClass:"welcome-box border-b border-gray-300 p-3 text-gray-700"},e._l(e.fields,(function(e,t){return n("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),n("div",{staticClass:"bg-gray-200 p-3 flex justify-between items-center"},[n("div",[e.processing?n("ns-spinner",{attrs:{size:"8",border:"4"}}):e._e()],1),e._v(" "),n("ns-button",{attrs:{disabled:e.processing,type:"info"},on:{click:function(t){return e.saveConfiguration()}}},[e._v("Create Installation")])],1)]):e._e()],1)}),[],!1,null,null,null).exports},6068:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={components:{nsLink:n(7975).nsLink}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bg-white rounded shadow my-2 overflow-hidden"},[e._m(0),e._v(" "),n("div",{staticClass:"bg-gray-200 p-3 flex justify-end"},[n("ns-link",{attrs:{to:"/database",type:"info"}},[n("i",{staticClass:"las la-database"}),e._v(" Database Configuration")])],1)])}),[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"welcome-box border-b border-gray-300 p-3 text-gray-700"},[n("p",{staticClass:"text-gray-600 text-sm"},[e._v("Thank you for having choosed NexoPOS 4 for managing your store. This is the installation wizard that will guide you through the installation.")]),e._v(" "),n("div",{staticClass:"py-2"},[n("h2",{staticClass:"text-xl font-body text-gray-700"},[e._v("Remaining Steps")]),e._v(" "),n("ul",{staticClass:"text-gray-600 text-sm"},[n("li",[n("i",{staticClass:"las la-arrow-right"}),e._v(" Database Configuration")]),e._v(" "),n("li",[n("i",{staticClass:"las la-arrow-right"}),e._v(" Application Configuration")])])])])}],!1,null,null,null).exports},3601:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var s=n(7389),i=n(6386),r=n(8603);const a={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:s.__,popupResolver:i.Z,popupCloser:r.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[n("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[n("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),n("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),n("div",{staticClass:"action-buttons flex border-t"},[n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),n("hr",{staticClass:"border-r h-16"}),e._v(" "),n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=5767,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[312,198],{9671:(e,t,n)=>{"use strict";n.d(t,{l:()=>V,kq:()=>R,ih:()=>Y,kX:()=>H});var s=n(6486),i=n(9669),r=n(6300),a=n(8345),o=n(9624),l=n(9248),c=n(230);function d(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=R.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:s}),new c.y((function(r){n._client[e](t,s,Object.assign(Object.assign({},n._client.defaults[e]),i)).then((function(e){n._lastRequestData=e,r.next(e.data),r.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;r.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&d(t.prototype,n),s&&d(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=n(3);function p(e,t){for(var n=0;n=1e3){for(var n,s=Math.floor((""+e).length/3),i=2;i>=1;i--){if(((n=parseFloat((0!=s?e/Math.pow(1e3,s):e).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][s]}return t})),P=n(1356),E=n(9698);function S(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&q(t.prototype,n),s&&q(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()),N=new b({sidebar:["xs","sm","md"].includes(I.breakpoint)?"hidden":"visible"});Y.defineClient(i),window.nsEvent=V,window.nsHttpClient=Y,window.nsSnackBar=H,window.nsCurrency=P.W,window.nsTruncate=E.b,window.nsRawCurrency=P.f,window.nsAbbreviate=$,window.nsState=N,window.nsUrl=Z,window.nsScreen=I,window.ChartJS=r,window.EventEmitter=h,window.Popup=x.G,window.RxJS=y,window.FormValidation=k.Z,window.nsCrudHandler=L},7975:(e,t,n)=>{"use strict";n.r(t),n.d(t,{nsAvatar:()=>Q,nsButton:()=>o,nsCheckbox:()=>p,nsCkeditor:()=>O,nsCloseButton:()=>j,nsCrud:()=>U,nsCrudForm:()=>g,nsDate:()=>w,nsDateRangePicker:()=>K.Z,nsDateTimePicker:()=>A.Z,nsDatepicker:()=>ee.Z,nsField:()=>_.P,nsIconButton:()=>$,nsInput:()=>c,nsLink:()=>l,nsMediaInput:()=>C,nsMenu:()=>r,nsMultiselect:()=>x,nsNotice:()=>J.Z,nsNumpad:()=>W.Z,nsPaginate:()=>te.Z,nsSearch:()=>se,nsSelect:()=>u,nsSelectAudio:()=>f,nsSpinner:()=>v,nsSubmenu:()=>a,nsSwitch:()=>M.Z,nsTableRow:()=>m,nsTabs:()=>F,nsTabsItem:()=>T,nsTextarea:()=>y});var s=n(538),i=n(9671),r=s.default.component("ns-menu",{data:function(){return{defaultToggledState:!1,_save:0}},props:["href","label","icon","notification","toggled","identifier"],template:'\n \n ',mounted:function(){var e=this;this.defaultToggledState=void 0!==this.toggled?this.toggled:this.defaultToggledState,i.l.subject().subscribe((function(t){t.value!==e.identifier&&(e.defaultToggledState=!1)}))},methods:{toggleEmit:function(){var e=this;this.toggle().then((function(t){t&&i.l.emit({identifier:"side-menu.open",value:e.identifier})}))},toggle:function(){var e=this;return new Promise((function(t,n){0===e.href.length&&(e.defaultToggledState=!e.defaultToggledState,t(e.defaultToggledState))}))}}}),a=s.default.component("ns-submenu",{data:function(){return{}},props:["href","label","active"],mounted:function(){},template:'\n
    \n
  • \n \n \n \n
  • \n
    \n '}),o=s.default.component("ns-button",{data:function(){return{clicked:!1,_save:0}},props:["type","disabled","link","href","routerLink","to"],template:'\n
    \n \n \n \n
    \n ',mounted:function(){},computed:{isDisabled:function(){return this.disabled&&(0===this.disabled.length||"disabled"===this.disabled||this.disabled)}}}),l=s.default.component("ns-link",{data:function(){return{clicked:!1,_save:0}},props:["type","to","href","target"],template:'\n
    \n \n \n
    \n ',computed:{buttonclass:function(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}}),c=s.default.component("ns-input",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),d=n(7389),u=s.default.component("ns-select",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},mounted:function(){},methods:{__:d.__},template:'\n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),f=s.default.component("ns-select-audio",{data:function(){return{}},props:["name","placeholder","field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__:d.__,playSelectedSound:function(){this.field.value.length>0&&new Audio(this.field.value).play()}},template:'\n
    \n \n
    \n
    \n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),p=s.default.component("ns-checkbox",{data:function(){return{}},props:["checked","field","label"],template:'\n
    \n
    \n \n
    \n {{ label }}\n {{ field.label }}\n
    \n ',computed:{isChecked:function(){return this.field?this.field.value:this.checked}},methods:{toggleIt:function(){void 0!==this.field&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}}),h=n(2242),m=s.default.component("ns-table-row",{props:["options","row","columns","prependOptions","showOptions"],data:function(){return{optionsToggled:!1}},mounted:function(){},methods:{__:d.__,sanitizeHTML:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.getElementsByTagName("script"),s=n.length;s--;)n[s].parentNode.removeChild(n[s]);return t.innerHTML},getElementOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu:function(e){var t=this;if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout((function(){var e=t.$el.querySelectorAll(".relative > .absolute")[0],n=t.$el.querySelectorAll(".relative")[0],s=t.getElementOffset(n);e.style.top=s.top+"px",e.style.left=s.left+"px",n.classList.remove("relative"),n.classList.add("dropdown-holder")}),100);else{var n=this.$el.querySelectorAll(".dropdown-holder")[0];n.classList.remove("dropdown-holder"),n.classList.add("relative")}},handleChanged:function(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync:function(e){var t=this;e.confirm?confirm(e.confirm.message)&&i.ih[e.type.toLowerCase()](e.url).subscribe((function(e){i.kX.success(e.message).subscribe(),t.$emit("reload",t.row)}),(function(e){t.toggleMenu(),i.kX.error(e.message).subscribe()})):(i.l.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup:function(e,t){var n=window.nsExtraComponents[e.component];if(e.component)return n?new Promise((function(s,i){h.G.show(n,{resolve:s,reject:i,row:t,action:e})})):i.kX.error((0,d.__)('Unable to load the component "'.concat(e.component,'". Make sure the component is registered to "nsExtraComponents".'))).subscribe();this.triggerAsync(e)}},template:'\n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    \x3c!-- flex items-center justify-center --\x3e\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n '}),v=s.default.component("ns-spinner",{data:function(){return{}},mounted:function(){},computed:{validatedSize:function(){return this.size||24},validatedBorder:function(){return this.border||8},validatedAnimation:function(){return this.animation||"fast"}},props:["color","size","border"],template:"\n
    \n
    \n
    \n "}),b=n(7266),g=s.default.component("ns-crud-form",{data:function(){return{form:{},globallyChecked:!1,formValidation:new b.Z,rows:[]}},mounted:function(){this.loadForm()},props:["src","create-url","field-class","return-url","submit-url","submit-method","disable-tabs"],computed:{activeTabFields:function(){for(var e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]}},methods:{__:d.__,toggle:function(e){for(var t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},handleShowOptions:function(e){this.rows.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},submit:function(){var e=this;return this.formValidation.validateForm(this.form).length>0?i.kX.error(this.$slots["error-invalid"]?this.$slots["error-invalid"][0].text:"No error message provided for having an invalid form.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():(this.formValidation.disableForm(this.form),void 0===this.submitUrl?i.kX.error(this.$slots["error-no-submit-url"]?this.$slots["error-no-submit-url"][0].text:"No error message provided for not having a valid submit url.",this.$slots.okay?this.$slots.okay[0].text:"OK").subscribe():void i.ih[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,this.formValidation.extractForm(this.form)).subscribe((function(t){if("success"===t.status){if(e.submitMethod&&"post"===e.submitMethod.toLowerCase()&&!1!==e.returnUrl)return document.location=t.data.editUrl||e.returnUrl;i.kX.info(t.message,(0,d.__)("Okay"),{duration:3e3}).subscribe(),e.$emit("save",t)}e.formValidation.enableForm(e.form)}),(function(t){i.kX.error(t.message,void 0,{duration:5e3}).subscribe(),void 0!==t.data&&e.formValidation.triggerError(e.form,t.data),e.formValidation.enableForm(e.form)})))},handleGlobalChange:function(e){this.globallyChecked=e,this.rows.forEach((function(t){return t.$checked=e}))},loadForm:function(){var e=this;i.ih.get("".concat(this.src)).subscribe({next:function(t){e.form=e.parseForm(t.form),i.kq.doAction("ns-crud-form-loaded",e),e.$emit("updated",e.form)},error:function(e){i.kX.error(e.message,"OKAY",{duration:0}).subscribe()}})},parseForm:function(e){e.main.value=void 0===e.main.value?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];var t=0;for(var n in e.tabs)0===t&&(e.tabs[n].active=!0),e.tabs[n].active=void 0!==e.tabs[n].active&&e.tabs[n].active,e.tabs[n].fields=this.formValidation.createFields(e.tabs[n].fields),t++;return e}},template:'\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n
    {{ tab.label }}
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n '}),y=s.default.component("ns-textarea",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n This field is required.\n This field must contain a valid email address.\n {{ error.message }}\n

    \n
    \n '}),_=n(8737),x=s.default.component("ns-multiselect",{data:function(){return{showPanel:!1,search:""}},props:["field"],computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=void 0!==t.selected&&t.selected,e.field.value&&e.field.value.includes(t.value)&&(t.selected=!0),t}))}},methods:{__:d.__,addOption:function(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout((function(){}),100))},removeOption:function(e,t){var n=this;if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout((function(){n.search=""}),100),!1}},mounted:function(){var e=this;this.field.value&&this.field.value.reverse().forEach((function(t){var n=e.field.options.filter((function(e){return e.value===t}));n.length>=0&&e.addOption(n[0])}))},template:'\n
    \n \n
    \n
    \n
    \n
    \n
    \n {{ option.label }}\n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n
    \n '}),w=s.default.component("ns-date",{data:function(){return{}},mounted:function(){},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),k=n(4255),C=s.default.component("ns-media-input",{template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n ',computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},data:function(){return{}},props:["placeholder","leading","type","field"],mounted:function(){},methods:{toggleMedia:function(){var e=this;new Promise((function(t,n){h.G.show(k.default,Object.assign({resolve:t,reject:n},e.field.data||{}))})).then((function(t){"use-selected"===t.event&&(e.field.data&&"url"!==e.field.data.type?e.field.data&&"model"!==e.field.data.type||(e.field.value=t.value[0]):e.field.value=t.value[0].sizes.original,e.$forceUpdate())}))}}}),j=s.default.component("ns-close-button",{template:'\n \n ',methods:{clicked:function(e){this.$emit("click",e)}}}),$=s.default.component("ns-icon-button",{template:'\n \n ',props:["className","buttonClass","type"],methods:{clicked:function(e){this.$emit("click",e)}}}),P=n(1272),E=n.n(P),S=n(5234),D=n.n(S),O=s.default.component("ns-ckeditor",{data:function(){return{editor:D()}},components:{ckeditor:E().component},mounted:function(){},methods:{__:d.__},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"],template:'\n
    \n \n
    \n
    \n \n {{ leading }}\n \n
    \n \n
    \n

    \n

    \n {{ __( \'This field is required.\' ) }}\n {{ __( \'This field must contain a valid email address.\' ) }}\n {{ error.message }}\n

    \n
    \n '}),F=s.default.component("ns-tabs",{data:function(){return{childrens:[]}},props:["active"],computed:{activeComponent:function(){var e=this.$children.filter((function(e){return e.active}));return e.length>0&&e[0]}},methods:{toggle:function(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier)}},mounted:function(){this.childrens=this.$children},template:'\n
    \n
    \n
    {{ tab.label }}
    \n
    \n \n
    \n '}),T=s.default.component("ns-tabs-item",{data:function(){return{}},mounted:function(){},props:["label","identifier","padding"],template:'\n
    \n \n
    \n '}),M=n(9408),A=n(2744),q=n(7757),z=n.n(q),V=n(3601),Y=n(8603),H=n(6386);const Z={data:function(){return{fields:[],validation:new b.Z}},methods:{__:d.__,popupCloser:Y.Z,popupResolver:H.Z,closePopup:function(){this.popupResolver(!1)},useFilters:function(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters:function(){this.fields.forEach((function(e){return e.value=""})),this.popupResolver(null)}},mounted:function(){this.fields=this.validation.createFields(this.$popupParams.queryFilters),this.popupCloser()}};var L=n(1900);const R=(0,L.Z)(Z,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-box shadow-lg w-95vw h-95vh md:w-2/5-screen overflow-hidden md:h-5/6-screen flex flex-col"},[n("div",{staticClass:"p-2 border-b ns-box-header flex justify-between items-center"},[n("h3",[e._v(e._s(e.__("Search Filters")))]),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),n("div",{staticClass:"p-2 ns-box-body flex-auto overflow-y-auto"},e._l(e.fields,(function(e,t){return n("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),n("div",{staticClass:"p-2 flex justify-between ns-box-footer border-t"},[n("div",[n("ns-button",{attrs:{type:"error"},on:{click:function(t){return e.clearFilters()}}},[e._v(e._s(e.__("Clear Filters")))])],1),e._v(" "),n("div",[n("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.useFilters()}}},[e._v(e._s(e.__("Use Filters")))])],1)])])}),[],!1,null,null,null).exports;var I=function(e,t,n,s){return new(n||(n=Promise))((function(i,r){function a(e){try{l(s.next(e))}catch(e){r(e)}}function o(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((s=s.apply(e,t||[])).next())}))};const N={data:function(){return{prependOptions:!1,showOptions:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}},name:"ns-crud",mounted:function(){void 0!==this.identifier&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","create-url","mode","identifier","queryParams"],computed:{getParsedSrc:function(){return"".concat(this.src,"?").concat(this.sortColumn).concat(this.searchQuery).concat(this.queryFiltersString).concat(this.queryPage).concat(this.getQueryParams()?"&"+this.getQueryParams():"")},showQueryFilters:function(){return this.queryFilters.length>0},getSelectedAction:function(){var e=this,t=this.bulkActions.filter((function(t){return t.identifier===e.bulkAction}));return t.length>0&&t[0]},pagination:function(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage:function(){return this.result?"&page=".concat(this.page):""},resultInfo:function(){return(0,d.__)("displaying {perPage} on {items} items").replace("{perPage}",this.result.total).replace("{items}",this.result.total)}},methods:{__:d.__,getQueryParams:function(){var e=this;return this.queryParams?Object.keys(this.queryParams).map((function(t){return"".concat(t,"=").concat(e.queryParams[t])})).join("&"):""},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))},downloadContent:function(){nsHttpClient.post("".concat(this.src,"/export?").concat(this.getParsedSrc),{entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe((function(e){setTimeout((function(){return document.location=e.url}),300),i.kX.success((0,d.__)("The document has been generated.")).subscribe()}),(function(e){i.kX.error(e.message||(0,d.__)("Unexpected error occured.")).subscribe()}))},clearSelectedEntries:function(){var e=this;h.G.show(V.default,{title:(0,d.__)("Clear Selected Entries ?"),message:(0,d.__)("Would you like to clear all selected entries ?"),onAction:function(t){t&&(e.selectedEntries=[])}})},refreshRow:function(e){if(!0===e.$checked){0===this.selectedEntries.filter((function(t){return t.$id===e.$id})).length&&this.selectedEntries.push(e)}else{var t=this.selectedEntries.filter((function(t){return t.$id===e.$id}));if(t.length>0){var n=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(n,1)}}},handleShowOptions:function(e){this.result.data.forEach((function(t){t.$id!==e.$id&&(t.$toggled=!1)}))},handleGlobalChange:function(e){var t=this;this.globallyChecked=e,this.result.data.forEach((function(n){n.$checked=e,t.refreshRow(n)}))},loadConfig:function(){var e=this;nsHttpClient.get("".concat(this.src,"/config?").concat(this.getQueryParams())).subscribe((function(t){e.columns=t.columns,e.bulkActions=t.bulkActions,e.queryFilters=t.queryFilters,e.prependOptions=t.prependOptions,e.showOptions=t.showOptions,e.refresh()}),(function(e){i.kX.error(e.message,"OK",{duration:!1}).subscribe()}))},cancelSearch:function(){this.searchInput="",this.search()},search:function(){this.searchInput?this.searchQuery="&search=".concat(this.searchInput):this.searchQuery="",this.refresh()},sort:function(e){for(var t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":this.columns[e].$direction="asc"}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn="active=".concat(e,"&direction=").concat(this.columns[e].$direction):this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo:function(){var e=this;return this.bulkAction?this.selectedEntries.length>0?confirm(this.getSelectedAction.confirm||this.$slots["error-bulk-confirmation"]||(0,d.__)("Would you like to perform the selected bulk action on the selected entries ?"))?nsHttpClient.post("".concat(this.src,"/bulk-actions"),{action:this.bulkAction,entries:this.selectedEntries.map((function(e){return e.$id}))}).subscribe({next:function(t){i.kX.info(t.message).subscribe(),e.selectedEntries=[],e.refresh()},error:function(e){i.kX.error(e.message).subscribe()}}):void 0:i.kX.error(this.$slots["error-no-selection"]?this.$slots["error-no-selection"][0].text:(0,d.__)("No selection has been made.")).subscribe():i.kX.error(this.$slots["error-no-action"]?this.$slots["error-no-action"][0].text:(0,d.__)("No action has been selected.")).subscribe()},openQueryFilter:function(){return I(this,void 0,void 0,z().mark((function e(){var t,n=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(R),e.next=4,new Promise((function(e,t){h.G.show(R,{resolve:e,reject:t,queryFilters:n.queryFilters})}));case 4:t=e.sent,this.withFilters=!1,this.queryFiltersString="",null!==t&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(t))),this.refresh(),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,this,[[0,11]])})))},refresh:function(){var e=this;this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get("".concat(this.getParsedSrc)).subscribe((function(t){t.data=t.data.map((function(t){return e.selectedEntries.filter((function(e){return e.$id===t.$id})).length>0&&(t.$checked=!0),t})),e.isRefreshing=!1,e.result=t,e.page=t.current_page}),(function(t){e.isRefreshing=!1,i.kX.error(t.message).subscribe()}))}}};const U=(0,L.Z)(N,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"w-full rounded-lg",class:"light"!==e.mode?"shadow mb-8":"",attrs:{id:"crud-table"}},["light"!==e.mode?n("div",{staticClass:"p-2 border-b border-popup-surface flex flex-col md:flex-row justify-between flex-wrap",attrs:{id:"crud-table-header"}},[n("div",{staticClass:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex",attrs:{id:"crud-search-box"}},[e.createUrl?n("div",{staticClass:"px-2 flex items-center justify-center"},[n("a",{staticClass:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border",attrs:{href:e.createUrl||"#"}},[n("i",{staticClass:"las la-plus"})])]):e._e(),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded-full p-1 ns-crud-input flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],staticClass:"w-36 md:w-auto bg-transparent outline-none px-2",attrs:{type:"text"},domProps:{value:e.searchInput},on:{input:function(t){t.target.composing||(e.searchInput=t.target.value)}}}),e._v(" "),n("button",{staticClass:"rounded-full w-8 h-8 outline-none ns-crud-input-button",on:{click:function(t){return e.search()}}},[n("i",{staticClass:"las la-search"})]),e._v(" "),e.searchQuery?n("button",{staticClass:"ml-1 rounded-full w-8 h-8 bg-error-secondary text-white outline-none hover:bg-error-tertiary",on:{click:function(t){return e.cancelSearch()}}},[n("i",{staticClass:"las la-times"})]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2 flex items-center justify-center"},[n("button",{staticClass:"rounded-full\n text-sm\n h-10\n px-3\n outline-none\n border\n ns-crud-button\n ",on:{click:function(t){return e.refresh()}}},[n("i",{staticClass:"las la-sync",class:e.isRefreshing?"animate-spin":""})])]),e._v(" "),e.showQueryFilters?n("div",{staticClass:"px-2 flex items-center"},[n("button",{staticClass:"ns-crud-button border rounded-full text-sm h-10 px-3 outline-none ",class:e.withFilters?"table-filters-enabled":"table-filters-disabled",on:{click:function(t){return e.openQueryFilter()}}},[e.withFilters?e._e():n("i",{staticClass:"las la-filter"}),e._v(" "),e.withFilters?n("i",{staticClass:"las la-check"}):e._e(),e._v(" "),e.withFilters?e._e():n("span",[e._v(e._s(e.__("Filters")))]),e._v(" "),e.withFilters?n("span",[e._v(e._s(e.__("Has Filters")))]):e._e()])]):e._e()]),e._v(" "),n("div",{staticClass:"-mx-1 flex flex-wrap w-full md:w-auto",attrs:{id:"crud-buttons"}},[e.selectedEntries.length>0?n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border",on:{click:function(t){return e.clearSelectedEntries()}}},[n("i",{staticClass:"lar la-check-square"}),e._v(" "+e._s(e.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length))+"\n ")])]):e._e(),e._v(" "),n("div",{staticClass:"px-1 flex items-center"},[n("button",{staticClass:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none",on:{click:function(t){return e.downloadContent()}}},[n("i",{staticClass:"las la-download"}),e._v(" "+e._s(e.__("Download")))])])])]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"overflow-x-auto flex-auto"},[Object.values(e.columns).length>0?n("table",{staticClass:"table ns-table w-full"},[n("thead",[n("tr",[n("th",{staticClass:"text-center px-2 border w-16 py-2"},[n("ns-checkbox",{attrs:{checked:e.globallyChecked},on:{change:function(t){return e.handleGlobalChange(t)}}})],1),e._v(" "),e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e(),e._v(" "),e._l(e.columns,(function(t,s){return n("th",{key:s,staticClass:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2",style:{"min-width":t.width||"auto"},on:{click:function(t){return e.sort(s)}}},[n("div",{staticClass:"w-full flex justify-between items-center"},[n("span",{staticClass:"flex"},[e._v(e._s(t.label))]),e._v(" "),n("span",{staticClass:"h-6 w-6 flex justify-center items-center"},["desc"===t.$direction?n("i",{staticClass:"las la-sort-amount-up"}):e._e(),e._v(" "),"asc"===t.$direction?n("i",{staticClass:"las la-sort-amount-down"}):e._e()])])])})),e._v(" "),!e.prependOptions&&e.showOptions?n("th",{staticClass:"text-left px-2 py-2 w-16 border"}):e._e()],2)]),e._v(" "),n("tbody",[void 0!==e.result.data&&e.result.data.length>0?e._l(e.result.data,(function(t,s){return n("ns-table-row",{key:s,attrs:{columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,row:t},on:{updated:function(t){return e.refreshRow(t)},reload:function(t){return e.refresh()},toggled:function(t){return e.handleShowOptions(t)}}})})):e._e(),e._v(" "),e.result&&0!==e.result.data.length?e._e():n("tr",[n("td",{staticClass:"text-center text-gray-600 dark:text-slate-300 py-3",attrs:{colspan:Object.values(e.columns).length+2}},[e._v(e._s(e.__("There is nothing to display...")))])])],2)]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex border-t flex-col md:flex-row justify-between footer"},[e.bulkActions.length>0?n("div",{staticClass:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1",attrs:{id:"grouped-actions"}},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.bulkAction,expression:"bulkAction"}],staticClass:"outline-none bg-transparent",attrs:{id:"grouped-actions"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.bulkAction=t.target.multiple?n:n[0]}}},[n("option",{staticClass:"bg-input-disabled",attrs:{selected:"",value:""}},[e._t("bulk-label",(function(){return[e._v(e._s(e.__("Bulk Actions")))]}))],2),e._v(" "),e._l(e.bulkActions,(function(t,s){return n("option",{key:s,staticClass:"bg-input-disabled",domProps:{value:t.identifier}},[e._v(e._s(t.label))])}))],2),e._v(" "),n("button",{staticClass:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center",on:{click:function(t){return e.bulkDo()}}},[e._t("bulk-go",(function(){return[e._v(e._s(e.__("Apply")))]}))],2)]):e._e(),e._v(" "),n("div",{staticClass:"flex"},[n("div",{staticClass:"items-center flex text-primary mx-4"},[e._v(e._s(e.resultInfo))]),e._v(" "),n("div",{staticClass:"flex items-center -mx-1",attrs:{id:"pagination"}},[e.result.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.first_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.pagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",class:e.page==t?"bg-info-tertiary border-transparent text-white":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){e.page=t,e.refresh()}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){e.page=e.result.last_page,e.refresh()}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)])])])}),[],!1,null,null,null).exports;var W=n(4864),B=n(1726),X=n(7259);const G=s.default.extend({methods:{__:d.__},name:"ns-avatar",data:function(){return{svg:""}},mounted:function(){this.svg=(0,B.createAvatar)(X,{seed:this.displayName})},computed:{avatarUrl:function(){return 0===this.url.length?"":this.url}},props:["url","display-name"]});const Q=(0,L.Z)(G,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex justify-between items-center flex-shrink-0"},[n("span",{staticClass:"hidden md:inline-block px-2"},[e._v(e._s(e.__("Howdy, {name}").replace("{name}",this.displayName)))]),e._v(" "),n("span",{staticClass:"md:hidden px-2"},[e._v(e._s(e.displayName))]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"w-8 h-8 overflow-hidden rounded-full bg-gray-600"},[""!==e.avatarUrl?n("img",{staticClass:"w-8 h-8 overflow-hidden rounded-full",attrs:{src:e.avatarUrl,alt:e.displayName,srcset:""}}):e._e(),e._v(" "),""===e.avatarUrl?n("div",{domProps:{innerHTML:e._s(e.svg)}}):e._e()])])])}),[],!1,null,null,null).exports;var K=n(4806),J=n(1828),ee=n(1544),te=n(3506);const ne={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data:function(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:d.__,selectOption:function(e){this.$emit("select",e),this.searchText="",this.results=[]}},watch:{searchText:function(){var e=this;clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){var t,n,s;e.searchText.length>0&&i.ih[e.method||"post"](e.url,(t={},n=e.searchArgument||"search",s=e.searchText,n in t?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,t)).subscribe({next:function(t){e.results=t},error:function(e){i.kX.error(e.message||(0,d.__)("An unexpected error occured.")).subscribe()}})}),1e3)}},mounted:function(){}};const se=(0,L.Z)(ne,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ns-search"},[n("div",{staticClass:"input-group info border-2"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"p-2 w-full",attrs:{type:"text",placeholder:e.placeholder||e.__("Search..."),id:""},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}})]),e._v(" "),n("div",{staticClass:"relative"},[n("div",{staticClass:"w-full absolute"},[e.results.length>0&&e.searchText.length>0?n("ul",{staticClass:"ns-vertical-menu"},e._l(e.results,(function(t,s){return n("li",{key:s,staticClass:"border-b p-2 cursor-pointer",on:{click:function(n){return e.selectOption(t)}}},[e._v(e._s(t[e.label]))])})),0):e._e()])])])}),[],!1,null,null,null).exports},8737:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var s=n(538),i=n(4806),r=n(2744),a=n(9408),o=s.default.component("ns-field",{data:function(){return{}},mounted:function(){},components:{nsDateRangePicker:i.Z,nsDateTimePicker:r.Z,nsSwitch:a.Z},computed:{isInputField:function(){return["text","password","email","number","tel"].includes(this.field.type)},isDateField:function(){return["date"].includes(this.field.type)},isSelectField:function(){return["select"].includes(this.field.type)},isTextarea:function(){return["textarea"].includes(this.field.type)},isCheckbox:function(){return["checkbox"].includes(this.field.type)},isMultiselect:function(){return["multiselect"].includes(this.field.type)},isSelectAudio:function(){return["select-audio"].includes(this.field.type)},isSwitch:function(){return["switch"].includes(this.field.type)},isMedia:function(){return["media"].includes(this.field.type)},isCkEditor:function(){return["ckeditor"].includes(this.field.type)},isDateTimePicker:function(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker:function(){return["daterangepicker"].includes(this.field.type)},isCustom:function(){return["custom"].includes(this.field.type)}},props:["field"],methods:{addOption:function(e){"select"===this.field.type&&this.field.options.forEach((function(e){return e.selected=!1})),e.selected=!0;var t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},refreshMultiselect:function(){this.field.value=this.field.options.filter((function(e){return e.selected})).map((function(e){return e.value}))},removeOption:function(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}},template:'\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 '})},1356:(e,t,n)=>{"use strict";n.d(t,{W:()=>c,f:()=>d});var s=n(2077),i=n.n(s),r=n(538),a=n(6740),o=n.n(a),l=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=r.default.filter("currency",(function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===s){var r={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=o()(e,r).format()}else n=i()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),d=function(e){var t="0.".concat(l);return parseFloat(i()(e).format(t))}},9698:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var s=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,n)=>{"use strict";function s(e,t){for(var n=0;ni});var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var s=[],i=this.validateFieldsErrors(e.tabs[n].fields);i.length>0&&s.push(i),e.tabs[n].errors=s.flat(),t.push(s.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var s=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===s.length&&e.tabs[s[0]].fields.forEach((function(e){e.name===s[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var s in t.errors)n(s)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var s in t.errors)n(s)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(s,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,s){!0===n[t.identifier]&&e.errors.splice(s,1)}))}return e}}],n&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,n)=>{"use strict";n.d(t,{__:()=>s,c:()=>i});var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},i=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},8603:(e,t,n)=>{"use strict";function s(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>s})},6386:(e,t,n)=>{"use strict";function s(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>s})},2242:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var s=n(7757),i=n.n(s),r=n(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new r.x}var t,n,s;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,s,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,void 0,void 0,i().mark((function a(){var o,l,c,d=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("function"!=typeof e){i.next=9;break}return i.prev=1,i.next=4,e();case 4:e=i.sent.default,i.next=9;break;case 7:i.prev=7,i.t0=i.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){d.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),l=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",l),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=r,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return i.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],s=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new e(s);return i.open(t,n),i}}],n&&o(t.prototype,n),s&&o(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var s=n(3260);function i(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return s.Observable.create((function(s){var r=n.__createSnack({message:e,label:t,type:i.type}),a=r.buttonNode,o=(r.textNode,r.snackWrapper,r.sampleSnack);a.addEventListener("click",(function(e){s.onNext(a),s.onCompleted(),o.remove()})),n.__startTimer(i.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,s=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){s()})),s()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,s=e.type,i=void 0===s?"info":s,r=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),l=document.createElement("div"),c=document.createElement("button"),d="",u="";switch(i){case"info":d="",u="info";break;case"error":d="",u="error";break;case"success":d="",u="success"}return o.textContent=t,o.setAttribute("class","pr-2"),n&&(l.setAttribute("class","ns-button default"),c.textContent=n,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(d)),l.appendChild(c)),a.appendChild(o),a.appendChild(l),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(u)),r.appendChild(a),null===document.getElementById("snack-wrapper")&&(r.setAttribute("id","snack-wrapper"),r.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(r)),{snackWrapper:r,sampleSnack:a,buttonsWrapper:l,buttonNode:c,textNode:o}}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},5767:(e,t,n)=>{"use strict";n.d(t,{c:()=>a});var s=n(538),i=n(8345),r=[{path:"/",component:n(6068).Z},{path:"/database",component:n(1983).Z},{path:"/configuration",component:n(4381).Z}];s.default.use(i.ZP);var a=new i.ZP({routes:r});new s.default({router:a}).$mount("#nexopos-setup")},6700:(e,t,n)=>{var s={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function i(e){var t=r(e);return n(t)}function r(e){if(!n.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}i.keys=function(){return Object.keys(s)},i.resolve=r,e.exports=i,i.id=6700},4806:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var s=n(538),i=n(381),r=n.n(i),a=n(7144),o=n.n(a),l=(n(9095),n(7389));const c=s.default.extend({name:"ns-date-range-picker",data:function(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:o()},mounted:function(){void 0!==this.field.value&&(this.dateRange=this.field.value)},watch:{dateRange:function(){var e={startDate:r()(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:r()(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:l.__,getFormattedDate:function(e){return null!==e?r()(e).format("YYYY-MM-DD HH:mm"):(0,l.__)("N/D")},clearDate:function(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]});const d=(0,n(1900).Z)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-auto flex-col mb-2 ns-date-range-picker"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"text-error-primary":"text-primary",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm",class:e.hasError?"error":""},[e.leading?n("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[n("span",{staticClass:"text-primary sm:text-sm sm:leading-5"},[e._v("\n "+e._s(e.leading)+"\n ")])]):e._e(),e._v(" "),n("button",{staticClass:"px-3 outline-none bg-error-secondary font-semibold text-white",on:{click:function(t){return e.clearDate()}}},[n("i",{staticClass:"las la-times"})]),e._v(" "),n("date-range-picker",{ref:"picker",staticClass:"w-full flex items-center bg-input-background",attrs:{"locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,disabled:e.field.disabled,linkedCalendars:!0},scopedSlots:e._u([{key:"input",fn:function(t){return[n("div",{staticClass:"flex justify-between items-center w-full py-2"},[n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Starts"))+" : "+e._s(e.getFormattedDate(t.startDate)))]),e._v(" "),n("span",{staticClass:"text-xs"},[e._v(e._s(e.__("Range Ends"))+" : "+e._s(e.getFormattedDate(t.endDate)))])])]}}]),model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs text-gray-500"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs text-red-400"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e(),e._v(" "),"email"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field must contain a valid email address.")))]})):e._e(),e._v(" "),"invalid"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(t.message))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},2744:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-date-time-picker",props:["field","date"],data:function(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:i(),months:new Array(11).fill("").map((function(e,t){return t})),daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},computed:{momentCopy:function(){return i()()}},watch:{visible:function(){var e=this;this.visible&&setTimeout((function(){e.$refs.hours.addEventListener("focus",(function(){this.select()})),e.$refs.minutes.addEventListener("focus",(function(){this.select()}))}),100)}},mounted:function(){var e=this;document.addEventListener("mousedown",(function(t){return e.checkClickedItem(t)})),this.field?this.currentDay=[void 0,"",null].includes(this.field.value)?i()():i()(this.field.value):this.currentDay=[void 0,"",null].includes(this.date)?i()():i()(this.date),this.hours=this.currentDay.format("HH"),this.minutes=this.currentDay.format("mm"),this.build()},methods:{__:n(7389).__,erase:function(){this.selectDate()},setYear:function(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.updateDateTime())},subYear:function(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.updateDateTime())},addYear:function(){this.currentDay.add(1,"year"),this.updateDateTime()},toggleView:function(e){var t=this;this.currentView=e,"years"===this.currentView&&setTimeout((function(){t.$refs.year.select()}),100)},setMonth:function(e){this.currentDay.month(e),this.updateDateTime()},detectHoursChange:function(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.updateDateTime()},detectMinuteChange:function(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.updateDateTime()},updateDateTime:function(){this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.build(),this.selectDate(this.currentDay)},checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){[void 0].includes(e)?(this.field&&(this.field.value=null),this.$emit("change",null)):(this.currentDay=e,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.field&&(this.field.value=this.currentDay.format("YYYY/MM/DD HH:mm")),console.log(this.hours,this.minutes),this.$emit("change",this.field?this.field:this.currentDay))},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker mb-2"},[e.field?n("label",{staticClass:"block leading-5 font-medium text-primary"},[e._v(e._s(e.field.label))]):e._e(),e._v(" "),n("div",{staticClass:"ns-button"},[n("button",{staticClass:"rounded cursor-pointer w-full px-1 py-1 flex items-center text-primary",class:e.field?"mt-1 border":"shadow",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),e.currentDay&&e.field?n("span",{staticClass:"mx-1 text-sm"},[null!==e.field.value?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.field.value?n("span",[e._v("N/A")]):e._e()]):e._e(),e._v(" "),e.currentDay&&e.date?n("span",{staticClass:"mx-1 text-sm"},[null!==e.date?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD HH:mm")))]):e._e(),e._v(" "),null===e.date?n("span",[e._v("N/A")]):e._e()]):e._e()])]),e._v(" "),e.field?n("p",{staticClass:"text-sm text-secondary py-1"},[e._v(e._s(e.field.description))]):e._e(),e._v(" "),e.visible?n("div",{staticClass:"relative z-10 h-0 w-0"},[n("div",{staticClass:"absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col",class:e.field?"-mt-4":"mt-2"},["years"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border border-numpad-edge outline-none text-numpad-text hover:bg-numpad-hover rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"h-32 flex items-center justify-center text-primary"},[n("div",{staticClass:"rounded input-group info border-2 flex w-2/3 overflow-hidden"},[n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.subYear()}}},[n("i",{staticClass:"las la-minus"})]),e._v(" "),n("input",{ref:"year",staticClass:"p-2 w-24 text-center outline-none",attrs:{type:"text"},domProps:{value:e.currentDay.format("YYYY")},on:{change:function(t){return e.setYear(t)}}}),e._v(" "),n("button",{staticClass:"px-4 py-2",on:{click:function(t){return e.addYear()}}},[n("i",{staticClass:"las la-plus"})])])])]):e._e(),e._v(" "),"months"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 border-b border-info-secondary border-dashed"},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border ns-inset-button outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-1 gap-0 text-primary"},e._l(e.months,(function(t,s){return n("div",{key:s,staticClass:"h-8 flex justify-center items-center text-sm"},[[n("div",{staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:e.momentCopy.month(t).format("MM")===e.currentDay.format("MM")?"bg-info-secondary text-white border border-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.setMonth(t)}}},[e._v("\n "+e._s(e.momentCopy.format("MMM"))+"\n ")])]],2)})),0)]):e._e(),e._v(" "),"days"===e.currentView?n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-primary justify-center"},[n("span",{staticClass:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("months")}}},[e._v(e._s(e.currentDay.format("MMM")))]),e._v(" "),n("span",{staticClass:"cursor-pointer border-b border-info-secondary border-dashed",on:{click:function(t){return e.toggleView("years")}}},[e._v(e._s(e.currentDay.format("YYYY")))])]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 border outline-none ns-inset-button rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},[n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-numpad-edge h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"text-white border border-info-secondary bg-info-secondary":"hover:bg-numpad-hover border border-numpad-edge",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2):e._e(),e._v(" "),n("div",{staticClass:"border-t border-numpad-edge w-full p-2"},[n("div",{staticClass:"-mx-1 flex justify-between"},[n("div",{staticClass:"px-1"},[n("div",{staticClass:"-mx-1 flex"},[e.field?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.erase()}}},[n("i",{staticClass:"las la-trash"})])]):e._e(),e._v(" "),"days"!==e.currentView?n("div",{staticClass:"px-1"},[n("button",{staticClass:"border ns-inset-button error hover:text-white rounded w-8 h-8 flex items-center justify-center",on:{click:function(t){return e.toggleView("days")}}},[n("i",{staticClass:"las la-sign-out-alt"})])]):e._e()])]),e._v(" "),n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded flex"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.hours,expression:"hours"}],ref:"hours",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"HH",type:"number"},domProps:{value:e.hours},on:{change:function(t){return e.detectHoursChange(t)},input:function(t){t.target.composing||(e.hours=t.target.value)}}}),e._v(" "),n("span",{staticClass:"mx-1"},[e._v(":")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.minutes,expression:"minutes"}],ref:"minutes",staticClass:"w-12 p-1 text-center border border-numpad-edge bg-input-disabled text-primary active:border-numpad-edge",attrs:{placeholder:"mm",type:"number"},domProps:{value:e.minutes},on:{change:function(t){return e.detectMinuteChange(t)},input:function(t){t.target.composing||(e.minutes=t.target.value)}}})])])])])])]):e._e()])}),[],!1,null,null,null).exports},1544:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(381),i=n.n(s);const r={name:"ns-datepicker",props:["label","date"],data:function(){return{visible:!1,currentDay:null,daysOfWeek:new Array(7).fill("").map((function(e,t){return t})),calendar:[[]]}},mounted:function(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null].includes(this.date)?i()():i()(this.date),this.build()},methods:{__:n(7389).__,checkClickedItem:function(e){!this.$el.contains(e.srcElement)&&this.visible&&(this.visible=!1)},selectDate:function(e){this.currentDay=e,this.visible=!1,this.$emit("change",e)},subMonth:function(){this.currentDay.subtract(1,"month"),this.build()},addMonth:function(){this.currentDay.add(1,"month"),this.build()},resetCalendar:function(){this.calendar=[[]]},build:function(){this.resetCalendar();this.currentDay.clone().startOf("month");for(var e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");;){0===e.day()&&this.calendar[0].length>0&&this.calendar.push([]);var n=this.calendar.length-1;if(this.calendar[n].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(i().now(),"day")}),e.isSame(t,"day"))break;e.add(1,"day")}}}};const a=(0,n(1900).Z)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"picker"},[n("div",{staticClass:"rounded cursor-pointer bg-white shadow px-1 py-1 flex items-center text-gray-700",on:{click:function(t){e.visible=!e.visible}}},[n("i",{staticClass:"las la-clock text-2xl"}),e._v(" "),n("span",{staticClass:"mx-1 text-sm"},[n("span",[e._v(e._s(e.label||e.__("Date"))+" : ")]),e._v(" "),e.currentDay?n("span",[e._v(e._s(e.currentDay.format("YYYY/MM/DD")))]):e._e(),e._v(" "),null===e.currentDay?n("span",[e._v(e._s(e.__("N/A")))]):e._e()])]),e._v(" "),e.visible?n("div",{staticClass:"relative h-0 w-0 -mb-2"},[n("div",{staticClass:"w-72 mt-2 shadow rounded bg-white anim-duration-300 zoom-in-entrance flex flex-col"},[n("div",{staticClass:"flex-auto"},[n("div",{staticClass:"p-2 flex items-center"},[n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.subMonth()}}},[n("i",{staticClass:"las la-angle-left"})])]),e._v(" "),n("div",{staticClass:"flex flex-auto font-semibold text-gray-700 justify-center"},[e._v(e._s(e.currentDay.format("MMM"))+" "+e._s(e.currentDay.format("YYYY")))]),e._v(" "),n("div",[n("button",{staticClass:"w-8 h-8 bg-gray-400 rounded",on:{click:function(t){return e.addMonth()}}},[n("i",{staticClass:"las la-angle-right"})])])]),e._v(" "),n("div",{staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},[n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sun")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Mon")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Tue")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Wed")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Thr")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Fri")))]),e._v(" "),n("div",{staticClass:"border border-gray-200 h-8 flex justify-center items-center text-sm"},[e._v(e._s(e.__("Sat")))])]),e._v(" "),e._l(e.calendar,(function(t,s){return n("div",{key:s,staticClass:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-gray-700"},e._l(e.daysOfWeek,(function(s,i){return n("div",{key:i,staticClass:"h-8 flex justify-center items-center text-sm"},[e._l(t,(function(t,i){return[t.dayOfWeek===s?n("div",{key:i,staticClass:"h-full w-full flex items-center justify-center cursor-pointer",class:t.date.format("DD")===e.currentDay.format("DD")?"bg-blue-400 text-white border border-blue-500":"hover:bg-gray-100 border border-gray-200",on:{click:function(n){return e.selectDate(t.date)}}},[e._v("\n "+e._s(t.date.format("DD"))+"\n ")]):e._e()]}))],2)})),0)}))],2),e._v(" "),n("div")])]):e._e()])}),[],!1,null,null,null).exports},1828:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-notice",props:["color"],computed:{actualColor:function(){return this.color||"blue"}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"p-4 border-l-4 text-primary ns-notice",class:e.actualColor,attrs:{role:"alert"}},[n("h2",{staticClass:"font-bold"},[e._t("title")],2),e._v(" "),n("p",[e._t("description"),e._t("default")],2)])}),[],!1,null,null,null).exports},4864:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var s=n(7389);function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n0?this.screenValue=parseFloat(this.value/this.number):this.screenValue=this.value||0;var t=new Array(10).fill("").map((function(e,t){return t}));nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(t,(function(t,n){e.inputValue({value:n})})),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",(function(){return e.inputValue({identifier:"backspace"})})),nsHotPress.create("numpad-increase").whenVisible([".is-popup"]).whenPressed("+",(function(){return e.increaseBy({value:1})})),nsHotPress.create("numpad-reduce").whenVisible([".is-popup"]).whenPressed("-",(function(){return e.increaseBy({value:-1})})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",(function(){return e.inputValue({identifier:"next"})}))},watch:{value:function(){this.value.toString().length>0?this.floating?this.screenValue=Math.round(this.value*this.number).toString():this.screenValue=this.value:this.screenValue=""}},beforeDestroy:function(){nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-increase"),nsHotPress.destroy("numpad-reduce"),nsHotPress.destroy("numpad-save")},methods:{increaseBy:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));this.screenValue=(parseFloat(e.value)*t+(parseFloat(this.screenValue)||0)).toString(),this.allSelected=!1},inputValue:function(e){var t=parseInt(1+new Array(this.cursor).fill("").map((function(e){return 0})).join(""));if("next"!==e.identifier){if("backspace"===e.identifier)this.allSelected?(this.screenValue="0",this.allSelected=!1):this.screenValue=this.screenValue.toString().substr(0,this.screenValue.length-1);else if(e.value.toString().match(/^\d+$/)){if(this.limit>0&&this.screenValue.length>=this.limit)return;this.allSelected?(this.screenValue=e.value.toString(),this.allSelected=!1):(this.screenValue+=""+e.value.toString(),"percentage"===this.mode&&(this.screenValue=this.screenValue>100?100:this.screenValue))}var n=this.floating&&this.screenValue.length>0&&"0"!==this.screenValue?parseFloat(this.screenValue/this.number):this.screenValue;this.$emit("changed",n)}else this.$emit("next",this.floating&&this.screenValue.length>0?parseFloat(this.screenValue/t):this.screenValue)}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"grid grid-flow-row grid-cols-3 grid-rows-3",attrs:{id:"numpad"}},[e._l(e.keys,(function(t,s){return n("div",{key:s,staticClass:"select-none ns-numpad-key border-l border-b h-24 font-bold flex items-center justify-center cursor-pointer",on:{click:function(n){return e.inputValue(t)}}},[void 0!==t.value?n("span",[e._v(e._s(t.value))]):e._e(),e._v(" "),t.icon?n("i",{staticClass:"las",class:t.icon}):e._e()])})),e._v(" "),e._t("numpad-footer")],2)}),[],!1,null,null,null).exports},3506:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={name:"ns-paginate",props:["pagination"],data:function(){return{page:1,path:""}},mounted:function(){this.path=this.pagination.path},computed:{getPagination:function(){return this.pagination?this.pageNumbers(this.pagination.last_page,this.pagination.current_page):[]}},methods:{gotoPage:function(e){this.page=e,this.$emit("load","".concat(this.path,"?page=").concat(this.page))},pageNumbers:function(e,t){var n=[];t-3>1&&n.push(1,"...");for(var s=1;s<=e;s++)t+3>s&&t-30||"string"==typeof e}))}}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex -mx-1",attrs:{id:"pagination"}},[e.pagination.current_page?[n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.first_page)}}},[n("i",{staticClass:"las la-angle-double-left"})]),e._v(" "),e._l(e.getPagination,(function(t,s){return["..."!==e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info",class:e.page==t?"active":"",attrs:{href:"javascript:void(0)"},on:{click:function(n){return e.gotoPage(t)}}},[e._v(e._s(t))]):e._e(),e._v(" "),"..."===e.page?n("a",{key:s,staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button",attrs:{href:"javascript:void(0)"}},[e._v("...")]):e._e()]})),e._v(" "),n("a",{staticClass:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-inset-button info shadow",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.gotoPage(e.pagination.last_page)}}},[n("i",{staticClass:"las la-angle-double-right"})])]:e._e()],2)}),[],!1,null,null,null).exports},9408:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={data:function(){return{}},name:"ns-switch",mounted:function(){},computed:{_options:function(){var e=this;return this.field.options.map((function(t){return t.selected=t.value===e.field.value,t}))},hasError:function(){return void 0!==this.field.errors&&this.field.errors.length>0},disabledClass:function(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},sizeClass:function(){return" w-1/".concat(this._options.length<=4?this._options.length:4)},inputClass:function(){return this.disabledClass+" "+this.leadClass},leadClass:function(){return this.leading?"pl-8":"px-4"}},methods:{__,setSelected:function(e){this.field.value=e.value,this._options.forEach((function(e){return e.selected=!1})),e.selected=!0,this.$forceUpdate(),this.$emit("change",e.value)}},props:["placeholder","leading","type","field"]};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"mb-2 ns-switch"},[n("label",{staticClass:"block leading-5 font-medium",class:e.hasError?"has-error":"is-pristine",attrs:{for:e.field.name}},[e._t("default")],2),e._v(" "),n("div",{staticClass:"rounded-lg flex w-52 overflow-hidden shadow my-1",class:e.hasError?"has-error":""},e._l(e._options,(function(t,s){return n("button",{key:s,staticClass:"p-2 text-sm flex-no-wrap outline-none rounded-none",class:t.selected?"selected "+e.sizeClass:"unselected "+e.inputClass+" "+e.sizeClass,attrs:{disabled:t.disabled},on:{click:function(n){return e.setSelected(t)}}},[e._v(e._s(t.label))])})),0),e._v(" "),e.field.errors&&0!==e.field.errors.length?e._e():n("p",{staticClass:"text-xs ns-description"},[e._t("description")],2),e._v(" "),e._l(e.field.errors,(function(t,s){return n("p",{key:s,staticClass:"text-xs ns-error"},["required"===t.identifier?e._t(t.identifier,(function(){return[e._v(e._s(e.__("This field is required.")))]})):e._e()],2)}))],2)}),[],!1,null,null,null).exports},4255:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var s=n(7757),i=n.n(s),r=n(9671),a=n(8603),o=n(7389),l=n(3601);function c(e,t,n,s,i,r,a){try{var o=e[r](a),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(s,i)}const d={name:"ns-media",props:["popup"],components:{VueUpload:n(2948)},data:function(){return{pages:[{label:(0,o.__)("Upload"),name:"upload",selected:!1},{label:(0,o.__)("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},queryPage:1,bulkSelect:!1,files:[]}},mounted:function(){this.popupCloser();var e=this.pages.filter((function(e){return"gallery"===e.name}))[0];this.select(e)},watch:{files:function(){this.uploadFiles()}},computed:{postMedia:function(){return r.kq.applyFilters("http-client-url","/api/nexopos/v4/medias")},currentPage:function(){return this.pages.filter((function(e){return e.selected}))[0]},hasOneSelected:function(){return this.response.data.filter((function(e){return e.selected})).length>0},selectedResource:function(){return this.response.data.filter((function(e){return e.selected}))[0]},csrf:function(){return ns.authentication.csrf},isPopup:function(){return void 0!==this.$popup},user_id:function(){return this.isPopup&&this.$popupParams.user_id||0},panelOpened:function(){return!this.bulkSelect&&this.hasOneSelected}},methods:{popupCloser:a.Z,__:o.__,cancelBulkSelect:function(){this.bulkSelect=!1,this.response.data.forEach((function(e){return e.selected=!1}))},deleteSelected:function(){var e=this;Popup.show(l.default,{title:(0,o.__)("Confirm Your Action"),message:(0,o.__)("You're about to delete selected resources. Would you like to proceed?"),onAction:function(t){t&&r.ih.post("/api/nexopos/v4/medias/bulk-delete",{ids:e.response.data.filter((function(e){return e.selected})).map((function(e){return e.id}))}).subscribe({next:function(t){r.kX.success(t.message).subscribe(),e.loadGallery()},error:function(e){r.kX.error(e.message).subscribe()}})}})},loadUploadScreen:function(){var e=this;setTimeout((function(){e.setDropZone()}),1e3)},setDropZone:function(){var e=this,t=document.getElementById("dropping-zone");t.addEventListener("dragenter",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragleave",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("dragover",(function(t){return e.preventDefaults(t)}),!1),t.addEventListener("drop",(function(t){return e.preventDefaults(t)}),!1);["dragenter","dragover"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!0}))})),["dragleave","drop"].forEach((function(n){t.addEventListener(n,(function(){e.isDragging=!1}))})),t.addEventListener("drop",(function(t){return e.handleDrop(t)}),!1),this.$refs.files.addEventListener("change",(function(t){return e.processFiles(t.currentTarget.files)}))},uploadFiles:function(){var e,t=this;return(e=i().mark((function e(){var n,s,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.files.filter((function(e){return!1===e.uploaded&&0===e.progress&&!1===e.failed})),s=i().mark((function e(t){var s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n[t],e.prev=1,s.progress=1,e.next=5,new Promise((function(e,t){var n=new FormData;n.append("file",s.file),r.ih.post("/api/nexopos/v4/medias",n,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:function(t){s.uploaded=!0,s.progress=100,e(t)},error:function(e){t(e)}})}));case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),s.failed=!0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})),a=0;case 3:if(!(a0&&void 0!==arguments[0]?arguments[0]:null;t=null===t?this.queryPage:t,this.queryPage=t,r.ih.get("/api/nexopos/v4/medias?page=".concat(t,"&user_id=").concat(this.user_id)).subscribe((function(t){t.data.forEach((function(e){return e.selected=!1})),e.response=t}))},useSelectedEntries:function(){this.$popupParams.resolve({event:"use-selected",value:this.response.data.filter((function(e){return e.selected}))}),this.$popup.close()},selectResource:function(e){var t=this;this.bulkSelect||this.response.data.forEach((function(n,s){s!==t.response.data.indexOf(e)&&(n.selected=!1)})),e.selected=!e.selected}}};const u=(0,n(1900).Z)(d,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",class:e.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full",attrs:{id:"ns-media"}},[n("div",{staticClass:"sidebar w-48 md:h-full flex-shrink-0"},[n("h3",{staticClass:"text-xl font-bold my-4 text-center"},[e._v(e._s(e.__("Medias Manager")))]),e._v(" "),n("ul",{staticClass:"sidebar-menus flex md:block"},e._l(e.pages,(function(t,s){return n("li",{key:s,staticClass:"py-2 px-3 cursor-pointer border-l-8",class:t.selected?"active":"",on:{click:function(n){return e.select(t)}}},[e._v(e._s(t.label))])})),0)]),e._v(" "),"upload"===e.currentPage.name?n("div",{staticClass:"content w-full overflow-hidden flex"},[n("div",{staticClass:"flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center",class:e.isDragging?"border-dashed border-2":"",attrs:{id:"dropping-zone"},on:{click:function(t){return e.triggerManualUpload()}}},[n("h3",{staticClass:"text-lg md:text-xl font-bold text-center text-primary mb-4"},[e._v(e._s(e.__("Click Here Or Drop Your File To Upload")))]),e._v(" "),n("input",{ref:"files",staticStyle:{display:"none"},attrs:{type:"file",name:"",multiple:"",id:""}}),e._v(" "),n("div",{staticClass:"rounded w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},[n("ul",e._l(e.files,(function(t,s){return n("li",{key:s,staticClass:"p-2 mb-2 shadow ns-media-upload-item flex items-center justify-between rounded"},[n("span",[e._v(e._s(t.file.name))]),e._v(" "),n("span",{staticClass:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},[e._v(e._s(t.progress)+"%")])])})),0)])])]):e._e(),e._v(" "),"gallery"===e.currentPage.name?n("div",{staticClass:"content flex-col w-full overflow-hidden flex"},[e.popup?n("div",{staticClass:"p-2 flex flex-shrink-0 justify-between"},[n("div"),e._v(" "),n("div",[n("ns-close-button",{on:{click:function(t){return e.popup.close()}}})],1)]):e._e(),e._v(" "),n("div",{staticClass:"flex flex-auto overflow-hidden"},[n("div",{staticClass:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},[n("div",{staticClass:"flex flex-auto"},[n("div",{staticClass:"p-2 overflow-x-auto"},[n("div",{staticClass:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"},e._l(e.response.data,(function(t,s){return n("div",{key:s},[n("div",{staticClass:"p-2"},[n("div",{staticClass:"rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center",class:t.selected?"ns-media-image-selected ring-4":"",on:{click:function(n){return e.selectResource(t)}}},[n("img",{staticClass:"object-cover h-full",attrs:{src:t.sizes.thumb,alt:t.name}})])])])})),0)]),e._v(" "),0===e.response.data.length?n("div",{staticClass:"flex flex-auto items-center justify-center"},[n("h3",{staticClass:"text-2xl font-bold"},[e._v(e._s(e.__("Nothing has already been uploaded")))])]):e._e()])]),e._v(" "),n("div",{staticClass:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0 ",attrs:{id:"preview"}},[n("div",{staticClass:"h-64 bg-gray-800 flex items-center justify-center"},[e.panelOpened?n("img",{attrs:{src:e.selectedResource.sizes.thumb,alt:e.selectedResource.name}}):e._e()]),e._v(" "),e.panelOpened?n("div",{staticClass:"p-4 text-gray-700 text-sm",attrs:{id:"details"}},[n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("File Name"))+": ")]),n("span",[e._v(e._s(e.selectedResource.name))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("Uploaded At"))+":")]),n("span",[e._v(e._s(e.selectedResource.created_at))])]),e._v(" "),n("p",{staticClass:"flex flex-col mb-2"},[n("strong",{staticClass:"font-bold block"},[e._v(e._s(e.__("By"))+" :")]),n("span",[e._v(e._s(e.selectedResource.user.username))])])]):e._e()])]),e._v(" "),n("div",{staticClass:"p-2 flex ns-media-footer flex-shrink-0 justify-between"},[n("div",{staticClass:"flex -mx-2 flex-shrink-0"},[n("div",{staticClass:"px-2 flex-shrink-0 flex"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.cancelBulkSelect()}}},[n("i",{staticClass:"las la-times"})])]):e._e(),e._v(" "),e.hasOneSelected&&!e.bulkSelect?n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){e.bulkSelect=!0}}},[n("i",{staticClass:"las la-check-circle"})])]):e._e(),e._v(" "),e.hasOneSelected?n("div",{staticClass:"ns-button error"},[n("button",{staticClass:"py-2 px-3",on:{click:function(t){return e.deleteSelected()}}},[n("i",{staticClass:"las la-trash"})])]):e._e()])])]),e._v(" "),n("div",{staticClass:"flex-shrink-0 -mx-2 flex"},[n("div",{staticClass:"px-2"},[n("div",{staticClass:"rounded shadow overflow-hidden flex text-sm"},[n("div",{staticClass:"ns-button",class:1===e.response.current_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:1===e.response.current_page},on:{click:function(t){return e.loadGallery(e.response.current_page-1)}}},[e._v(e._s(e.__("Previous")))])]),e._v(" "),n("hr",{staticClass:"border-r border-gray-700"}),e._v(" "),n("div",{staticClass:"ns-button",class:e.response.current_page===e.response.last_page?"disabled cursor-not-allowed":"info"},[n("button",{staticClass:"p-2",attrs:{disabled:e.response.current_page===e.response.last_page},on:{click:function(t){return e.loadGallery(e.response.current_page+1)}}},[e._v(e._s(e.__("Next")))])])])]),e._v(" "),e.popup&&e.hasOneSelected?n("div",{staticClass:"px-2"},[n("div",{staticClass:"ns-button info"},[n("button",{staticClass:"rounded shadow p-2 text-sm",on:{click:function(t){return e.useSelectedEntries()}}},[e._v(e._s(e.__("Use Selected")))])])]):e._e()])])]):e._e()])}),[],!1,null,null,null).exports},1983:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var s=n(7266),i=n(5767);function r(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n{"use strict";n.d(t,{Z:()=>o});var s=n(7266),i=n(9671),r=n(5767);const a={data:function(){return{form:new s.Z,fields:[],processing:!1,steps:[],failure:0,maxFailure:2}},methods:{validate:function(){},verifyDBConnectivity:function(){},saveConfiguration:function(e){var t=this;return this.form.disableFields(this.fields),this.processing=!0,i.ih.post("/api/nexopos/v4/setup/configuration",this.form.getValue(this.fields)).subscribe((function(e){document.location="/sign-in"}),(function(e){t.processing=!1,t.form.enableFields(t.fields),t.form.triggerFieldsErrors(t.fields,e.data),i.kX.error(e.message,"OK").subscribe()}))},checkDatabase:function(){var e=this;i.ih.get("/api/nexopos/v4/setup/database").subscribe((function(t){e.fields=e.form.createFields([{label:"Application",description:"That is the application name.",name:"ns_store_name",validation:"required"},{label:"Username",description:"Provide the administrator username.",name:"admin_username",validation:"required"},{label:"Email",description:"Provide the administrator email.",name:"admin_email",validation:"required"},{label:"Password",type:"password",description:"What should be the password required for authentication.",name:"password",validation:"required"},{label:"Confirm Password",type:"password",description:"Should be the same as the password above.",name:"confirm_password",validation:"required"}])}),(function(e){console.log(e),r.c.push("/database"),i.kX.error("You need to define database settings","OKAY",{duration:3e3}).subscribe()}))}},mounted:function(){this.checkDatabase()}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[0===e.fields.length?n("ns-spinner",{attrs:{size:"12",border:"4",animation:"fast"}}):e._e(),e._v(" "),e.fields.length>0?n("div",{staticClass:"bg-white rounded shadow my-2"},[n("div",{staticClass:"welcome-box border-b border-gray-300 p-3 text-gray-700"},e._l(e.fields,(function(e,t){return n("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),n("div",{staticClass:"bg-gray-200 p-3 flex justify-between items-center"},[n("div",[e.processing?n("ns-spinner",{attrs:{size:"8",border:"4"}}):e._e()],1),e._v(" "),n("ns-button",{attrs:{disabled:e.processing,type:"info"},on:{click:function(t){return e.saveConfiguration()}}},[e._v("Create Installation")])],1)]):e._e()],1)}),[],!1,null,null,null).exports},6068:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const s={components:{nsLink:n(7975).nsLink}};const i=(0,n(1900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bg-white rounded shadow my-2 overflow-hidden"},[e._m(0),e._v(" "),n("div",{staticClass:"bg-gray-200 p-3 flex justify-end"},[n("ns-link",{attrs:{to:"/database",type:"info"}},[n("i",{staticClass:"las la-database"}),e._v(" Database Configuration")])],1)])}),[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"welcome-box border-b border-gray-300 p-3 text-gray-700"},[n("p",{staticClass:"text-gray-600 text-sm"},[e._v("Thank you for having choosed NexoPOS 4 for managing your store. This is the installation wizard that will guide you through the installation.")]),e._v(" "),n("div",{staticClass:"py-2"},[n("h2",{staticClass:"text-xl font-body text-gray-700"},[e._v("Remaining Steps")]),e._v(" "),n("ul",{staticClass:"text-gray-600 text-sm"},[n("li",[n("i",{staticClass:"las la-arrow-right"}),e._v(" Database Configuration")]),e._v(" "),n("li",[n("i",{staticClass:"las la-arrow-right"}),e._v(" Application Configuration")])])])])}],!1,null,null,null).exports},3601:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var s=n(7389),i=n(6386),r=n(8603);const a={data:function(){return{title:"",message:""}},computed:{size:function(){return this.$popupParams.size||"h-full w-full"}},mounted:function(){this.title=this.$popupParams.title,this.message=this.$popupParams.message,this.popupCloser()},methods:{__:s.__,popupResolver:i.Z,popupCloser:r.Z,emitAction:function(e){this.$popupParams.onAction(e),this.$popup.close()}}};const o=(0,n(1900).Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex flex-col shadow-lg w-5/7-screen md:w-4/7-screen lg:w-2/7-screen",class:e.size,attrs:{id:"confirm-popup"}},[n("div",{staticClass:"flex items-center justify-center flex-col flex-auto p-4"},[n("h2",{staticClass:"text-xl md:text-3xl font-body text-center"},[e._v(e._s(e.title))]),e._v(" "),n("p",{staticClass:"py-4 text-sm md:text-base text-center"},[e._v(e._s(e.message))])]),e._v(" "),n("div",{staticClass:"action-buttons flex border-t"},[n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!0)}}},[e._v(e._s(e.__("Yes")))]),e._v(" "),n("hr",{staticClass:"border-r h-16"}),e._v(" "),n("button",{staticClass:"flex-auto rounded-none w-1/2 h-16 flex items-center justify-center uppercase",on:{click:function(t){return e.emitAction(!1)}}},[e._v(e._s(e.__("No")))])])])}),[],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=5767,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/public/js/update.min.js b/public/js/update.min.js index 7753211b7..0b678dcdc 100644 --- a/public/js/update.min.js +++ b/public/js/update.min.js @@ -1 +1 @@ -(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[775,198],{9671:(e,t,n)=>{"use strict";n.d(t,{l:()=>W,kq:()=>N,ih:()=>X,kX:()=>U});var r=n(6486),s=n(9669),i=n(6300),a=n(8345),o=n(9624),u=n(9248),c=n(230);function l(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=N.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:r}),new c.y((function(i){n._client[e](t,r,Object.assign(Object.assign({},n._client.defaults[e]),s)).then((function(e){n._lastRequestData=e,i.next(e.data),i.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;i.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&l(t.prototype,n),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),p=n(3);function f(e,t){for(var n=0;n=1e3){for(var n,r=Math.floor((""+e).length/3),s=2;s>=1;s--){if(((n=parseFloat((0!=r?e/Math.pow(1e3,r):e).toPrecision(s)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][r]}return t})),S=n(1356),P=n(9698);function O(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&L(t.prototype,n),r&&L(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()),H=new m({sidebar:["xs","sm","md"].includes(Z.breakpoint)?"hidden":"visible"});X.defineClient(s),window.nsEvent=W,window.nsHttpClient=X,window.nsSnackBar=U,window.nsCurrency=S.W,window.nsTruncate=P.b,window.nsRawCurrency=S.f,window.nsAbbreviate=C,window.nsState=H,window.nsUrl=R,window.nsScreen=Z,window.ChartJS=i,window.EventEmitter=v,window.Popup=g.G,window.RxJS=w,window.FormValidation=_.Z,window.nsCrudHandler=B},1356:(e,t,n)=>{"use strict";n.d(t,{W:()=>c,f:()=>l});var r=n(2077),s=n.n(r),i=n(538),a=n(6740),o=n.n(a),u=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=i.default.filter("currency",(function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===r){var i={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=o()(e,i).format()}else n=s()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),l=function(e){var t="0.".concat(u);return parseFloat(s()(e).format(t))}},9698:(e,t,n)=>{"use strict";n.d(t,{b:()=>r});var r=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;ns});var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,s;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var r=[],s=this.validateFieldsErrors(e.tabs[n].fields);s.length>0&&r.push(s),e.tabs[n].errors=r.flat(),t.push(r.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var r=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===r.length&&e.tabs[r[0]].fields.forEach((function(e){e.name===r[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var r in t.errors)n(r)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var r in t.errors)n(r)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,r){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(r,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,r){!0===n[t.identifier]&&e.errors.splice(r,1)}))}return e}}],n&&r(t.prototype,n),s&&r(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,n)=>{"use strict";n.d(t,{__:()=>r,c:()=>s});var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},s=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},8603:(e,t,n)=>{"use strict";function r(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>r})},6386:(e,t,n)=>{"use strict";function r(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>r})},2242:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var r=n(7757),s=n.n(r),i=n(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new i.x}var t,n,r;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u(this,void 0,void 0,s().mark((function a(){var o,u,c,l=this;return s().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if("function"!=typeof e){s.next=9;break}return s.prev=1,s.next=4,e();case 4:e=s.sent.default,s.next=9;break;case 7:s.prev=7,s.t0=s.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){l.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),u=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",u),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=i,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return s.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],r=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=new e(r);return s.open(t,n),s}}],n&&o(t.prototype,n),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var r=n(3260);function s(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return r.Observable.create((function(r){var i=n.__createSnack({message:e,label:t,type:s.type}),a=i.buttonNode,o=(i.textNode,i.snackWrapper,i.sampleSnack);a.addEventListener("click",(function(e){r.onNext(a),r.onCompleted(),o.remove()})),n.__startTimer(s.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,r=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){r()})),r()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,r=e.type,s=void 0===r?"info":r,i=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),u=document.createElement("div"),c=document.createElement("button"),l="",d="";switch(s){case"info":l="",d="info";break;case"error":l="",d="error";break;case"success":l="",d="success"}return o.textContent=t,o.setAttribute("class","pr-2"),n&&(u.setAttribute("class","ns-button default"),c.textContent=n,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(l)),u.appendChild(c)),a.appendChild(o),a.appendChild(u),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(d)),i.appendChild(a),null===document.getElementById("snack-wrapper")&&(i.setAttribute("id","snack-wrapper"),i.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(i)),{snackWrapper:i,sampleSnack:a,buttonsWrapper:u,buttonNode:c,textNode:o}}}],n&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},6542:(e,t,n)=>{"use strict";var r=n(538),s=n(4858).Z;console.log(s),window.nsUpdate=new r.default({el:"#main-container",components:{nsDatabaseUpdate:s}})},6700:(e,t,n)=>{var r={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function s(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}s.keys=function(){return Object.keys(r)},s.resolve=i,e.exports=s,s.id=6700},4858:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(7757),s=n.n(r),i=n(7389),a=n(9671);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function u(e,t,n,r,s,i,a){try{var o=e[i](a),u=o.value}catch(e){return void n(e)}o.done?t(u):Promise.resolve(u).then(r,s)}const c={name:"ns-database-update",data:function(){return{files:Update.files,returnLink:Update.returnLink,modules:Update.modules,updating:!1,xXsrfToken:null,updatingModule:!1,error:!1,lastErrorMessage:"",index:0}},computed:{totalModules:function(){return Object.values(this.modules).length}},mounted:function(){var e=this;a.ih.get("/sanctum/csrf-cookie").subscribe((function(t){try{e.xXsrfToken=a.ih.response.config.headers["X-XSRF-TOKEN"],e.proceedUpdate()}catch(e){a.kX.error(e.message).subscribe()}}))},methods:{__:i.__,proceedUpdate:function(){var e,t=this;return(e=s().mark((function e(){var n,r,u,c,l,d,p;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.updating=!0,n=s().mark((function e(n){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.index=parseInt(n)+1,e.next=4,new Promise((function(e,r){a.ih.post("/api/nexopos/v4/update",{file:t.files[n]},{headers:{"X-XSRF-TOKEN":t.xXsrfToken}}).subscribe({next:e,error:r})}));case 4:e.sent,e.next=13;break;case 7:return e.prev=7,e.t0=e.catch(0),t.updating=!1,t.error=!0,t.lastErrorMessage=e.t0.message||(0,i.__)("An unexpected error occured"),e.abrupt("return",{v:a.kX.error(e.t0.message).subscribe()});case 13:case"end":return e.stop()}}),e,null,[[0,7]])})),e.t0=s().keys(t.files);case 3:if((e.t1=e.t0()).done){e.next=11;break}return r=e.t1.value,e.delegateYield(n(r),"t2",6);case 6:if("object"!==o(u=e.t2)){e.next=9;break}return e.abrupt("return",u.v);case 9:e.next=3;break;case 11:if(t.index=0,!(Object.values(t.modules).length>0)){e.next=25;break}t.updatingModule=!0,c=0,l=s().mark((function e(n){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,c+=1,t.index=c,e.next=5,new Promise((function(e,r){a.ih.post("/api/nexopos/v4/update",{module:t.modules[n]},{headers:{"X-XSRF-TOKEN":t.xXsrfToken}}).subscribe({next:e,error:r})}));case 5:e.sent,e.next=14;break;case 8:return e.prev=8,e.t0=e.catch(0),t.updating=!1,t.error=!0,t.lastErrorMessage=e.t0.message||(0,i.__)("An unexpected error occured"),e.abrupt("return",{v:a.kX.error(e.t0.message).subscribe()});case 14:case"end":return e.stop()}}),e,null,[[0,8]])})),e.t3=s().keys(t.modules);case 17:if((e.t4=e.t3()).done){e.next=25;break}return d=e.t4.value,e.delegateYield(l(d),"t5",20);case 20:if("object"!==o(p=e.t5)){e.next=23;break}return e.abrupt("return",p.v);case 23:e.next=17;break;case 25:t.error=!1,t.updating=!1,document.location=t.returnLink;case 28:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,s){var i=e.apply(t,n);function a(e){u(i,r,s,a,o,"next",e)}function o(e){u(i,r,s,a,o,"throw",e)}a(void 0)}))})()}}};const l=(0,n(1900).Z)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"container mx-auto flex-auto items-center justify-center flex"},[n("div",{staticClass:"w-full md:w-2/3 lg:w-1/3",attrs:{id:"database-update"}},[e._m(0),e._v(" "),n("div",{staticClass:"my-3 rounded shadow ns-box"},[n("div",{staticClass:"border-b ns-box-header py-4 flex items-center justify-center"},[n("h3",{staticClass:"text-xl font-bold"},[e._v(e._s(e.__("Datebase Update")))])]),e._v(" "),n("div",{staticClass:"p-2 ns-box-body"},[n("p",{staticClass:"text-center text-sm py-4"},[e._v(e._s(e.__("In order to keep NexoPOS running smoothly with updates, we need to proceed to the database migration. In fact you don't need to do any action, just wait until the process is done and you'll be redirected.")))]),e._v(" "),e.error?n("div",{staticClass:"border-l-4 text-sm ns-notice error p-4"},[n("p",[e._v("\n "+e._s(e.__("Looks like an error has occured during the update. Usually, giving another shot should fix that. However, if you still don't get any chance."))+"\n "+e._s(e.__("Please report this message to the support : "))+"\n ")]),e._v(" "),n("pre",{staticClass:"rounded whitespace-pre-wrap my-2 p-2"},[e._v(e._s(e.lastErrorMessage))])]):e._e()]),e._v(" "),n("div",{staticClass:"border-t ns-box-footer p-2 flex justify-between"},[n("div",[e.error?n("ns-button",{staticClass:"rounded shadow-inner",attrs:{type:"error"},on:{click:function(t){return e.proceedUpdate()}}},[n("i",{staticClass:"las la-sync"}),e._v(" "),n("span",{staticClass:"ml-1"},[e._v(e._s(e.__("Try Again")))])]):e._e()],1),e._v(" "),n("div",{staticClass:"flex"},[e.updating?n("ns-button",{staticClass:"rounded shadow-inner",attrs:{type:"info"}},[n("i",{staticClass:"las la-sync animate-spin"}),e._v(" "),e.updatingModule?e._e():n("span",[e._v(e._s(e.__("Updating"))+"...")]),e._v(" "),e.updatingModule?e._e():n("span",{staticClass:"mr-1"},[e._v(e._s(e.index)+"/"+e._s(e.files.length))]),e._v(" "),e.updatingModule?n("span",[e._v(e._s(e.__("Updating Modules"))+"...")]):e._e(),e._v(" "),e.updatingModule?n("span",{staticClass:"mr-1"},[e._v(e._s(e.index)+"/"+e._s(e.totalModules))]):e._e()]):e._e(),e._v(" "),e.updating?e._e():n("ns-button",{staticClass:"rounded shadow-inner",attrs:{type:"info",href:e.returnLink}},[n("i",{staticClass:"las la-undo"}),e._v(" "),n("span",{staticClass:"ml-1"},[e._v(e._s(e.__("Return")))])])],1)])])])])}),[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"flex justify-center items-center py-6"},[t("img",{staticClass:"w-32",attrs:{src:"/svg/nexopos-variant-1.svg",alt:"NexoPOS"}})])}],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=6542,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[775,198],{9671:(e,t,n)=>{"use strict";n.d(t,{l:()=>W,kq:()=>N,ih:()=>X,kX:()=>U});var r=n(6486),s=n(9669),i=n(6300),a=n(8345),o=n(9624),u=n(9248),c=n(230);function l(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return this._request("post",e,t,n)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("get",e,void 0,t)}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._request("delete",e,void 0,t)}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._request("put",e,t,n)}},{key:"response",get:function(){return this._lastRequestData}},{key:"_request",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=N.applyFilters("http-client-url",t.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:t,data:r}),new c.y((function(i){n._client[e](t,r,Object.assign(Object.assign({},n._client.defaults[e]),s)).then((function(e){n._lastRequestData=e,i.next(e.data),i.complete(),n._subject.next({identifier:"async.stop"})})).catch((function(e){var t;i.error((null===(t=e.response)||void 0===t?void 0:t.data)||e.response||e),n._subject.next({identifier:"async.stop"})}))}))}},{key:"subject",value:function(){return this._subject}},{key:"emit",value:function(e){var t=e.identifier,n=e.value;this._subject.next({identifier:t,value:n})}}],n&&l(t.prototype,n),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),p=n(3);function f(e,t){for(var n=0;n=1e3){for(var n,r=Math.floor((""+e).length/3),s=2;s>=1;s--){if(((n=parseFloat((0!=r?e/Math.pow(1e3,r):e).toPrecision(s)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}n%1!=0&&(n=n.toFixed(1)),t=n+["","k","m","b","t"][r]}return t})),S=n(1356),P=n(9698);function O(e,t){for(var n=0;n0&&window.outerWidth<=480:this.breakpoint="xs";break;case window.outerWidth>480&&window.outerWidth<=640:this.breakpoint="sm";break;case window.outerWidth>640&&window.outerWidth<=1024:this.breakpoint="md";break;case window.outerWidth>1024&&window.outerWidth<=1280:this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl"}}}])&&L(t.prototype,n),r&&L(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()),H=new m({sidebar:["xs","sm","md"].includes(Z.breakpoint)?"hidden":"visible"});X.defineClient(s),window.nsEvent=W,window.nsHttpClient=X,window.nsSnackBar=U,window.nsCurrency=S.W,window.nsTruncate=P.b,window.nsRawCurrency=S.f,window.nsAbbreviate=C,window.nsState=H,window.nsUrl=R,window.nsScreen=Z,window.ChartJS=i,window.EventEmitter=v,window.Popup=g.G,window.RxJS=w,window.FormValidation=_.Z,window.nsCrudHandler=B},1356:(e,t,n)=>{"use strict";n.d(t,{W:()=>c,f:()=>l});var r=n(2077),s=n.n(r),i=n(538),a=n(6740),o=n.n(a),u=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map((function(e){return 0})).join(""),c=i.default.filter("currency",(function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full";switch(ns.currency.ns_currency_prefered){case"iso":t=ns.currency.ns_currency_iso;break;case"symbol":t=ns.currency.ns_currency_symbol}if("full"===r){var i={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};n=o()(e,i).format()}else n=s()(e).format("0.0a");return"".concat("before"===ns.currency.ns_currency_position?t:"").concat(n).concat("after"===ns.currency.ns_currency_position?t:"")})),l=function(e){var t="0.".concat(u);return parseFloat(s()(e).format(t))}},9698:(e,t,n)=>{"use strict";n.d(t,{b:()=>r});var r=n(538).default.filter("truncate",(function(e,t){return e?(e=e.toString()).length>t?e.substring(0,t)+"...":e:""}))},7266:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;ns});var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,s;return t=e,n=[{key:"validateFields",value:function(e){var t=this;return 0===e.map((function(e){return t.checkField(e),e.errors?0===e.errors.length:0})).filter((function(e){return!1===e})).length}},{key:"validateFieldsErrors",value:function(e){var t=this;return e.map((function(e){return t.checkField(e),e.errors})).flat()}},{key:"validateForm",value:function(e){e.main&&this.validateField(e.main);var t=[];for(var n in e.tabs)if(e.tabs[n].fields){var r=[],s=this.validateFieldsErrors(e.tabs[n].fields);s.length>0&&r.push(s),e.tabs[n].errors=r.flat(),t.push(r.flat())}return t.flat().filter((function(e){return void 0!==e}))}},{key:"initializeTabs",value:function(e){var t=0;for(var n in e)0===t&&(e[n].active=!0),e[n].active=void 0!==e[n].active&&e[n].active,e[n].fields=this.createFields(e[n].fields),t++;return e}},{key:"validateField",value:function(e){return this.checkField(e)}},{key:"fieldsValid",value:function(e){return!(e.map((function(e){return e.errors&&e.errors.length>0})).filter((function(e){return e})).length>0)}},{key:"createFields",value:function(e){return e.map((function(t){if(t.type=t.type||"text",t.errors=t.errors||[],t.disabled=t.disabled||!1,"custom"===t.type&&"string"==typeof t.component){var n=t.component;if(t.component=nsExtraComponents[t.component],!t.component)throw'Failed to load a custom component. "'.concat(n,'" is not provided as an extra component. More details here: https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component');t.component.$field=t,t.component.$fields=e}return t}))}},{key:"createForm",value:function(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(var t in e.tabs)e.tabs[t].errors=[],void 0!==e.tabs[t].fields?e.tabs[t].fields=this.createFields(e.tabs[t].fields):console.info('Warning: The tab "'.concat(e.tabs[t].label,'" is missing fields. Fallback on checking dynamic component instead.'));return e}},{key:"enableFields",value:function(e){return e.map((function(e){return e.disabled=!1}))}},{key:"disableFields",value:function(e){return e.map((function(e){return e.disabled=!0}))}},{key:"disableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!0),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!0}))}},{key:"enableForm",value:function(e){for(var t in e.main&&(e.main.disabled=!1),e.tabs)e.tabs[t].fields.forEach((function(e){return e.disabled=!1}))}},{key:"getValue",value:function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"checkField",value:function(e){var t=this;return void 0!==e.validation&&(e.errors=[],this.detectValidationRules(e.validation).forEach((function(n){t.fieldPassCheck(e,n)}))),e}},{key:"extractForm",value:function(e){var t={};if(e.main&&(t[e.main.name]=e.main.value),e.tabs)for(var n in e.tabs)void 0===t[n]&&(t[n]={}),t[n]=this.extractFields(e.tabs[n].fields);return t}},{key:"extractFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){t[e.name]=e.value})),t}},{key:"detectValidationRules",value:function(e){var t=function(e){var t;return["email","required"].includes(e)?{identifier:e}:(t=/(min)\:([0-9])+/g.exec(e))||(t=/(max)\:([0-9])+/g.exec(e))?{identifier:t[1],value:t[2]}:e};return Array.isArray(e)?e.filter((function(e){return"string"==typeof e})).map(t):e.split("|").map(t)}},{key:"triggerError",value:function(e,t){if(console.log(t),t.errors){var n=function(n){var r=n.split(".").filter((function(e){return!/^\d+$/.test(e)}));2===r.length&&e.tabs[r[0]].fields.forEach((function(e){e.name===r[1]&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))})),n===e.main.name&&t.errors[n].forEach((function(t){e.main.errors.push({identifier:"invalid",invalid:!0,message:t,name:e.main.name})}))};for(var r in t.errors)n(r)}}},{key:"triggerFieldsErrors",value:function(e,t){if(t&&t.errors){var n=function(n){e.forEach((function(e){e.name===n&&t.errors[n].forEach((function(t){var n={identifier:"invalid",invalid:!0,message:t,name:e.name};e.errors.push(n)}))}))};for(var r in t.errors)n(r)}}},{key:"fieldPassCheck",value:function(e,t){if("required"===t.identifier){if(void 0===e.value||null===e.value||0===e.value.length)return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,r){n.identifier===t.identifier&&!0===n.invalid&&e.errors.splice(r,1)}))}if("email"===t.identifier&&e.value.length>0){if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(e.value))return e.errors.push({identifier:t.identifier,invalid:!0,name:e.name});e.errors.forEach((function(n,r){!0===n[t.identifier]&&e.errors.splice(r,1)}))}return e}}],n&&r(t.prototype,n),s&&r(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7389:(e,t,n)=>{"use strict";n.d(t,{__:()=>r,c:()=>s});var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NexoPOS";return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e},s=function(e,t){return nsLanguage.getEntries(t)&&nsLanguage.getEntries(t)[e]||e}},8603:(e,t,n)=>{"use strict";function r(){var e=this;Object.keys(this).includes("$popup")&&(this.$popup.event.subscribe((function(t){"click-overlay"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close()),"press-esc"===t.event&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close())})),nsHotPress.create("popup-esc").whenPressed("escape",(function(t){t.preventDefault();var n=parseInt(e.$el.parentElement.getAttribute("data-index"));null===document.querySelector('.is-popup [data-index="'.concat(n+1,"]"))&&(e.$popupParams&&void 0!==e.$popupParams.reject&&e.$popupParams.reject(!1),e.$popup.close(),nsHotPress.destroy("popup-esc"))})))}n.d(t,{Z:()=>r})},6386:(e,t,n)=>{"use strict";function r(e){void 0!==this.$popupParams.resolve&&this.$popupParams.reject&&(!1!==e?this.$popupParams.resolve(e):this.$popupParams.reject(e)),this.$popup.close()}n.d(t,{Z:()=>r})},2242:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var r=n(7757),s=n.n(r),i=n(9248);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.config={primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"},this.container=document.createElement("div"),this.popupBody=document.createElement("div"),this.popupSelector="",this.config=Object.assign(this.config,t),void 0===this.config.primarySelector&&document.querySelectorAll(".is-popup").length>0){var n=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[n-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0];this.event=new i.x}var t,n,r;return t=e,n=[{key:"hash",value:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<10;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}},{key:"open",value:function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u(this,void 0,void 0,s().mark((function a(){var o,u,c,l=this;return s().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if("function"!=typeof e){s.next=9;break}return s.prev=1,s.next=4,e();case 4:e=s.sent.default,s.next=9;break;case 7:s.prev=7,s.t0=s.catch(1);case 9:o=document.querySelector("body").querySelectorAll("div")[0],this.parentWrapper.style.filter="blur(4px)",o.style.filter="blur(6px)",this.container.setAttribute("class","absolute top-0 left-0 w-full h-full flex items-center justify-center is-popup"),this.container.addEventListener("click",(function(e){l.event.next({event:"click-overlay",value:!0}),e.stopPropagation()})),this.popupBody.addEventListener("click",(function(e){e.stopImmediatePropagation()})),u=document.querySelectorAll(".is-popup").length,this.container.id="popup-container-"+this.hash(),this.popupSelector="#".concat(this.container.id),this.popupBody.setAttribute("class","zoom-out-entrance popup-body"),this.popupBody.setAttribute("data-index",u),this.popupBody.innerHTML='
    ',this.container.appendChild(this.popupBody),document.body.appendChild(this.container),c=Vue.extend(e),this.instance=new c({propsData:{popup:this}}),this.instance.template=(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.template)||void 0,this.instance.render=e.render||void 0,this.instance.methods=(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.methods)||(null==e?void 0:e.methods),this.instance.data=(null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.data)||(null==e?void 0:e.data),this.instance.$popup=this,this.instance.$popupParams=i,this.instance.$mount("#".concat(this.container.id," .vue-component"));case 32:case"end":return s.stop()}}),a,this,[[1,7]])})))}},{key:"close",value:function(){var e=this;this.instance.$destroy(),this.event.unsubscribe(),this.parentWrapper.style.filter="blur(0px)";var t=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(t.style.filter="blur(0px)");var n="".concat(this.popupSelector," .popup-body");this.popupBody=document.querySelector(n),this.popupBody.classList.remove("zoom-out-entrance"),this.popupBody.classList.add("zoom-in-exit"),this.container=document.querySelector("".concat(this.popupSelector)),this.container.classList.remove("is-popup"),setTimeout((function(){e.container.remove()}),300)}}],r=[{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=new e(r);return s.open(t,n),s}}],n&&o(t.prototype,n),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9624:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var r=n(3260);function s(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return r.Observable.create((function(r){var i=n.__createSnack({message:e,label:t,type:s.type}),a=i.buttonNode,o=(i.textNode,i.snackWrapper,i.sampleSnack);a.addEventListener("click",(function(e){r.onNext(a),r.onCompleted(),o.remove()})),n.__startTimer(s.duration,o)}))}},{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"error"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"error"}))}},{key:"success",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"success"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"success"}))}},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:3e3,type:"info"};return this.show(e,t,Object.assign(Object.assign({},n),{type:"info"}))}},{key:"__startTimer",value:function(e,t){var n,r=function(){e>0&&!1!==e&&(n=setTimeout((function(){t.remove()}),e))};t.addEventListener("mouseenter",(function(){clearTimeout(n)})),t.addEventListener("mouseleave",(function(){r()})),r()}},{key:"__createSnack",value:function(e){var t=e.message,n=e.label,r=e.type,s=void 0===r?"info":r,i=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),o=document.createElement("p"),u=document.createElement("div"),c=document.createElement("button"),l="",d="";switch(s){case"info":l="",d="info";break;case"error":l="",d="error";break;case"success":l="",d="success"}return o.textContent=t,o.setAttribute("class","pr-2"),n&&(u.setAttribute("class","ns-button default"),c.textContent=n,c.setAttribute("class","px-3 py-2 shadow rounded uppercase ".concat(l)),u.appendChild(c)),a.appendChild(o),a.appendChild(u),a.setAttribute("class","md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ".concat(d)),i.appendChild(a),null===document.getElementById("snack-wrapper")&&(i.setAttribute("id","snack-wrapper"),i.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(i)),{snackWrapper:i,sampleSnack:a,buttonsWrapper:u,buttonNode:c,textNode:o}}}],n&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},6542:(e,t,n)=>{"use strict";var r=n(538),s=n(4858).Z;console.log(s),window.nsUpdate=new r.default({el:"#main-container",components:{nsDatabaseUpdate:s}})},6700:(e,t,n)=>{var r={"./af":2786,"./af.js":2786,"./ar":867,"./ar-dz":4130,"./ar-dz.js":4130,"./ar-kw":6135,"./ar-kw.js":6135,"./ar-ly":6440,"./ar-ly.js":6440,"./ar-ma":7702,"./ar-ma.js":7702,"./ar-sa":6040,"./ar-sa.js":6040,"./ar-tn":7100,"./ar-tn.js":7100,"./ar.js":867,"./az":1083,"./az.js":1083,"./be":9808,"./be.js":9808,"./bg":8338,"./bg.js":8338,"./bm":7438,"./bm.js":7438,"./bn":8905,"./bn-bd":6225,"./bn-bd.js":6225,"./bn.js":8905,"./bo":1560,"./bo.js":1560,"./br":1278,"./br.js":1278,"./bs":622,"./bs.js":622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":877,"./cv.js":877,"./cy":7373,"./cy.js":7373,"./da":4780,"./da.js":4780,"./de":9740,"./de-at":217,"./de-at.js":217,"./de-ch":894,"./de-ch.js":894,"./de.js":9740,"./dv":5300,"./dv.js":5300,"./el":837,"./el.js":837,"./en-au":8348,"./en-au.js":8348,"./en-ca":7925,"./en-ca.js":7925,"./en-gb":2243,"./en-gb.js":2243,"./en-ie":6436,"./en-ie.js":6436,"./en-il":7207,"./en-il.js":7207,"./en-in":4175,"./en-in.js":4175,"./en-nz":6319,"./en-nz.js":6319,"./en-sg":1662,"./en-sg.js":1662,"./eo":2915,"./eo.js":2915,"./es":5655,"./es-do":5251,"./es-do.js":5251,"./es-mx":6112,"./es-mx.js":6112,"./es-us":1146,"./es-us.js":1146,"./es.js":5655,"./et":5603,"./et.js":5603,"./eu":7763,"./eu.js":7763,"./fa":6959,"./fa.js":6959,"./fi":1897,"./fi.js":1897,"./fil":2549,"./fil.js":2549,"./fo":4694,"./fo.js":4694,"./fr":4470,"./fr-ca":3049,"./fr-ca.js":3049,"./fr-ch":2330,"./fr-ch.js":2330,"./fr.js":4470,"./fy":4415,"./fy.js":4415,"./ga":9295,"./ga.js":9295,"./gd":2101,"./gd.js":2101,"./gl":8794,"./gl.js":8794,"./gom-deva":7884,"./gom-deva.js":7884,"./gom-latn":3168,"./gom-latn.js":3168,"./gu":5349,"./gu.js":5349,"./he":4206,"./he.js":4206,"./hi":94,"./hi.js":94,"./hr":316,"./hr.js":316,"./hu":2138,"./hu.js":2138,"./hy-am":1423,"./hy-am.js":1423,"./id":9218,"./id.js":9218,"./is":135,"./is.js":135,"./it":626,"./it-ch":150,"./it-ch.js":150,"./it.js":626,"./ja":9183,"./ja.js":9183,"./jv":4286,"./jv.js":4286,"./ka":2105,"./ka.js":2105,"./kk":7772,"./kk.js":7772,"./km":8758,"./km.js":8758,"./kn":9282,"./kn.js":9282,"./ko":3730,"./ko.js":3730,"./ku":1408,"./ku.js":1408,"./ky":3291,"./ky.js":3291,"./lb":6841,"./lb.js":6841,"./lo":5466,"./lo.js":5466,"./lt":7010,"./lt.js":7010,"./lv":7595,"./lv.js":7595,"./me":9861,"./me.js":9861,"./mi":5493,"./mi.js":5493,"./mk":5966,"./mk.js":5966,"./ml":7341,"./ml.js":7341,"./mn":5115,"./mn.js":5115,"./mr":370,"./mr.js":370,"./ms":9847,"./ms-my":1237,"./ms-my.js":1237,"./ms.js":9847,"./mt":2126,"./mt.js":2126,"./my":6165,"./my.js":6165,"./nb":4924,"./nb.js":4924,"./ne":6744,"./ne.js":6744,"./nl":3901,"./nl-be":9814,"./nl-be.js":9814,"./nl.js":3901,"./nn":3877,"./nn.js":3877,"./oc-lnc":2135,"./oc-lnc.js":2135,"./pa-in":5858,"./pa-in.js":5858,"./pl":4495,"./pl.js":4495,"./pt":9520,"./pt-br":7971,"./pt-br.js":7971,"./pt.js":9520,"./ro":6459,"./ro.js":6459,"./ru":238,"./ru.js":238,"./sd":950,"./sd.js":950,"./se":490,"./se.js":490,"./si":124,"./si.js":124,"./sk":4249,"./sk.js":4249,"./sl":4985,"./sl.js":4985,"./sq":1104,"./sq.js":1104,"./sr":9131,"./sr-cyrl":9915,"./sr-cyrl.js":9915,"./sr.js":9131,"./ss":5893,"./ss.js":5893,"./sv":8760,"./sv.js":8760,"./sw":1172,"./sw.js":1172,"./ta":7333,"./ta.js":7333,"./te":3110,"./te.js":3110,"./tet":2095,"./tet.js":2095,"./tg":7321,"./tg.js":7321,"./th":9041,"./th.js":9041,"./tk":9005,"./tk.js":9005,"./tl-ph":5768,"./tl-ph.js":5768,"./tlh":9444,"./tlh.js":9444,"./tr":2397,"./tr.js":2397,"./tzl":8254,"./tzl.js":8254,"./tzm":1106,"./tzm-latn":699,"./tzm-latn.js":699,"./tzm.js":1106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":7691,"./uk.js":7691,"./ur":3795,"./ur.js":3795,"./uz":6791,"./uz-latn":588,"./uz-latn.js":588,"./uz.js":6791,"./vi":5666,"./vi.js":5666,"./x-pseudo":4378,"./x-pseudo.js":4378,"./yo":5805,"./yo.js":5805,"./zh-cn":3839,"./zh-cn.js":3839,"./zh-hk":5726,"./zh-hk.js":5726,"./zh-mo":9807,"./zh-mo.js":9807,"./zh-tw":4152,"./zh-tw.js":4152};function s(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}s.keys=function(){return Object.keys(r)},s.resolve=i,e.exports=s,s.id=6700},4858:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(7757),s=n.n(r),i=n(7389),a=n(9671);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function u(e,t,n,r,s,i,a){try{var o=e[i](a),u=o.value}catch(e){return void n(e)}o.done?t(u):Promise.resolve(u).then(r,s)}const c={name:"ns-database-update",data:function(){return{files:Update.files,returnLink:Update.returnLink,modules:Update.modules,updating:!1,xXsrfToken:null,updatingModule:!1,error:!1,lastErrorMessage:"",index:0}},computed:{totalModules:function(){return Object.values(this.modules).length}},mounted:function(){var e=this;a.ih.get("/sanctum/csrf-cookie").subscribe((function(t){try{e.xXsrfToken=a.ih.response.config.headers["X-XSRF-TOKEN"],e.proceedUpdate()}catch(e){a.kX.error(e.message).subscribe()}}))},methods:{__:i.__,proceedUpdate:function(){var e,t=this;return(e=s().mark((function e(){var n,r,u,c,l,d,p;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.updating=!0,n=s().mark((function e(n){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.index=parseInt(n)+1,e.next=4,new Promise((function(e,r){a.ih.post("/api/nexopos/v4/update",{file:t.files[n]},{headers:{"X-XSRF-TOKEN":t.xXsrfToken}}).subscribe({next:e,error:r})}));case 4:e.sent,e.next=13;break;case 7:return e.prev=7,e.t0=e.catch(0),t.updating=!1,t.error=!0,t.lastErrorMessage=e.t0.message||(0,i.__)("An unexpected error occured"),e.abrupt("return",{v:a.kX.error(e.t0.message).subscribe()});case 13:case"end":return e.stop()}}),e,null,[[0,7]])})),e.t0=s().keys(t.files);case 3:if((e.t1=e.t0()).done){e.next=11;break}return r=e.t1.value,e.delegateYield(n(r),"t2",6);case 6:if("object"!==o(u=e.t2)){e.next=9;break}return e.abrupt("return",u.v);case 9:e.next=3;break;case 11:if(t.index=0,!(Object.values(t.modules).length>0)){e.next=25;break}t.updatingModule=!0,c=0,l=s().mark((function e(n){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,c+=1,t.index=c,e.next=5,new Promise((function(e,r){a.ih.post("/api/nexopos/v4/update",{module:t.modules[n]},{headers:{"X-XSRF-TOKEN":t.xXsrfToken}}).subscribe({next:e,error:r})}));case 5:e.sent,e.next=14;break;case 8:return e.prev=8,e.t0=e.catch(0),t.updating=!1,t.error=!0,t.lastErrorMessage=e.t0.message||(0,i.__)("An unexpected error occured"),e.abrupt("return",{v:a.kX.error(e.t0.message).subscribe()});case 14:case"end":return e.stop()}}),e,null,[[0,8]])})),e.t3=s().keys(t.modules);case 17:if((e.t4=e.t3()).done){e.next=25;break}return d=e.t4.value,e.delegateYield(l(d),"t5",20);case 20:if("object"!==o(p=e.t5)){e.next=23;break}return e.abrupt("return",p.v);case 23:e.next=17;break;case 25:t.error=!1,t.updating=!1,document.location=t.returnLink;case 28:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,s){var i=e.apply(t,n);function a(e){u(i,r,s,a,o,"next",e)}function o(e){u(i,r,s,a,o,"throw",e)}a(void 0)}))})()}}};const l=(0,n(1900).Z)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"container mx-auto flex-auto items-center justify-center flex"},[n("div",{staticClass:"w-full md:w-2/3 lg:w-1/3",attrs:{id:"database-update"}},[e._m(0),e._v(" "),n("div",{staticClass:"my-3 rounded shadow ns-box"},[n("div",{staticClass:"border-b ns-box-header py-4 flex items-center justify-center"},[n("h3",{staticClass:"text-xl font-bold"},[e._v(e._s(e.__("Datebase Update")))])]),e._v(" "),n("div",{staticClass:"p-2 ns-box-body"},[n("p",{staticClass:"text-center text-sm py-4"},[e._v(e._s(e.__("In order to keep NexoPOS running smoothly with updates, we need to proceed to the database migration. In fact you don't need to do any action, just wait until the process is done and you'll be redirected.")))]),e._v(" "),e.error?n("div",{staticClass:"border-l-4 text-sm ns-notice error p-4"},[n("p",[e._v("\n "+e._s(e.__("Looks like an error has occured during the update. Usually, giving another shot should fix that. However, if you still don't get any chance."))+"\n "+e._s(e.__("Please report this message to the support : "))+"\n ")]),e._v(" "),n("pre",{staticClass:"rounded whitespace-pre-wrap my-2 p-2"},[e._v(e._s(e.lastErrorMessage))])]):e._e()]),e._v(" "),n("div",{staticClass:"border-t ns-box-footer p-2 flex justify-between"},[n("div",[e.error?n("ns-button",{staticClass:"rounded shadow-inner",attrs:{type:"error"},on:{click:function(t){return e.proceedUpdate()}}},[n("i",{staticClass:"las la-sync"}),e._v(" "),n("span",{staticClass:"ml-1"},[e._v(e._s(e.__("Try Again")))])]):e._e()],1),e._v(" "),n("div",{staticClass:"flex"},[e.updating?n("ns-button",{staticClass:"rounded shadow-inner",attrs:{type:"info"}},[n("i",{staticClass:"las la-sync animate-spin"}),e._v(" "),e.updatingModule?e._e():n("span",[e._v(e._s(e.__("Updating"))+"...")]),e._v(" "),e.updatingModule?e._e():n("span",{staticClass:"mr-1"},[e._v(e._s(e.index)+"/"+e._s(e.files.length))]),e._v(" "),e.updatingModule?n("span",[e._v(e._s(e.__("Updating Modules"))+"...")]):e._e(),e._v(" "),e.updatingModule?n("span",{staticClass:"mr-1"},[e._v(e._s(e.index)+"/"+e._s(e.totalModules))]):e._e()]):e._e(),e._v(" "),e.updating?e._e():n("ns-button",{staticClass:"rounded shadow-inner",attrs:{type:"info",href:e.returnLink}},[n("i",{staticClass:"las la-undo"}),e._v(" "),n("span",{staticClass:"ml-1"},[e._v(e._s(e.__("Return")))])])],1)])])])])}),[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"flex justify-center items-center py-6"},[t("img",{staticClass:"w-32",attrs:{src:"/svg/nexopos-variant-1.svg",alt:"NexoPOS"}})])}],!1,null,null,null).exports}},e=>{e.O(0,[898],(()=>{return t=6542,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 0126a2846..2ee02abd8 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,15 +1,15 @@ { - "/js/bootstrap.min/bootstrap.js": "/js/bootstrap.min/bootstrap.js?id=c6486eeb3dae22a4778ee55e0f7ac8b9", + "/js/bootstrap.min/bootstrap.js": "/js/bootstrap.min/bootstrap.js?id=dfdbda5509efeff039109b3ac1b03b5b", "/js/lang-loader.min.js": "/js/lang-loader.min.js?id=c4a4bd023b75001d83886706c8ccc728", - "/js/app.min.js": "/js/app.min.js?id=1d238b6579de657bf440998bd85e5250", - "/js/dashboard.min.js": "/js/dashboard.min.js?id=b88e20bd4910e76309a9e4bcde8f3582", - "/js/cashier.min.js": "/js/cashier.min.js?id=6443d1a28bbd3df944b364d8ad6917e4", - "/js/update.min.js": "/js/update.min.js?id=37c91b39c7b6600a573ba20d085d72af", - "/js/pos-init.min.js": "/js/pos-init.min.js?id=9eb319d7a5cc08d8774f85bc3defc389", - "/js/pos.min.js": "/js/pos.min.js?id=e0374f606bc8fd95566b7ae505de184d", - "/js/auth.min.js": "/js/auth.min.js?id=846a5400a13438c0f0e1f1c056d23217", - "/js/setup.min.js": "/js/setup.min.js?id=c68f2e1fb4ed478667756b9bf51fa8d6", - "/js/popups.min.js": "/js/popups.min.js?id=1b737440c509ace37fc95809642361d1", + "/js/app.min.js": "/js/app.min.js?id=1b5a704c647beba91ccb6e78799e46be", + "/js/dashboard.min.js": "/js/dashboard.min.js?id=3e40eb0fbe9fad83149e42508e218420", + "/js/cashier.min.js": "/js/cashier.min.js?id=fdf6c1f68c81f0e8bebd8c05ef3a7f6e", + "/js/update.min.js": "/js/update.min.js?id=9d0458916bb4d20837d45bbe25bc9a5c", + "/js/pos-init.min.js": "/js/pos-init.min.js?id=e040b02eba6b5a67719e428993e6b8ac", + "/js/pos.min.js": "/js/pos.min.js?id=75c408781804fec6c96f94ef65f7bd3c", + "/js/auth.min.js": "/js/auth.min.js?id=bf2083ec3e2082195eac262741bc7bf2", + "/js/setup.min.js": "/js/setup.min.js?id=898b7c65bac64be2647064b959f98b20", + "/js/popups.min.js": "/js/popups.min.js?id=4afe247660bfafa1524df9c022da594f", "/js/manifest.js": "/js/manifest.js?id=786ac29c97f726c970eb3a7aac561f20", "/js/vendor.js": "/js/vendor.js?id=f8aa442fa86376910305147310f59523" }