marketplacepos 2.9.4 → 2.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/174.491c4991a4f8e404.js +1 -0
- package/Marketplace/19.124a066645320965.js +1 -0
- package/Marketplace/{213.73aa99e3f8dc5caa.js → 213.0e33a2cc7393deb2.js} +1 -1
- package/Marketplace/360.5c7b51c35e7142e7.js +1 -0
- package/Marketplace/{369.881799be1b0c0cd7.js → 369.a1e3b731aeb5243f.js} +1 -1
- package/Marketplace/379.25d1b1c637903c75.js +1 -0
- package/Marketplace/397.c1a8fad6c2ca3235.js +1 -0
- package/Marketplace/72.23b7f31fc45323cb.js +1 -0
- package/Marketplace/754.086e7f7a5377c7d9.js +1 -0
- package/Marketplace/767.64dd12e70c78eb25.js +1 -0
- package/Marketplace/835.ea5f86512592f641.js +1 -0
- package/Marketplace/874.1fbcd1001b41f18e.js +1 -0
- package/Marketplace/common.1b119d9b7a972f87.js +1 -0
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main.4874ea507cbcab3a.js → main.cbb985d0c847641f.js} +1 -1
- package/Marketplace/runtime.8ddf6965934d46b2.js +1 -0
- package/package.json +1 -1
- package/Marketplace/360.8279e3b4ceab63e1.js +0 -1
- package/Marketplace/379.aad8784dbdb3dd33.js +0 -1
- package/Marketplace/395.2943aa5a44308399.js +0 -1
- package/Marketplace/397.13ff3d72465810f8.js +0 -1
- package/Marketplace/533.cc5ab7f3ce13770c.js +0 -1
- package/Marketplace/655.ae475c8285604367.js +0 -1
- package/Marketplace/767.eca7237ccb50aa86.js +0 -1
- package/Marketplace/835.6cfe266f3c9b5cc9.js +0 -1
- package/Marketplace/874.5b06431d2b5a1e8f.js +0 -1
- package/Marketplace/common.af67cc08f47a8d44.js +0 -1
- package/Marketplace/runtime.357a02c3b18dd5e6.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e,h={},v={};function r(e){var n=v[e];if(void 0!==n)return n.exports;var t=v[e]={id:e,loaded:!1,exports:{}};return h[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=h,e=[],r.O=(n,t,f,d)=>{if(!t){var a=1/0;for(c=0;c<e.length;c++){for(var[t,f,d]=e[c],b=!0,o=0;o<t.length;o++)(!1&d||a>=d)&&Object.keys(r.O).every(u=>r.O[u](t[o]))?t.splice(o--,1):(b=!1,d<a&&(a=d));if(b){e.splice(c--,1);var s=f();void 0!==s&&(n=s)}}return n}d=d||0;for(var c=e.length;c>0&&e[c-1][2]>d;c--)e[c]=e[c-1];e[c]=[t,f,d]},r.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return r.d(n,{a:n}),n},(()=>{var n,e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;r.t=function(t,f){if(1&f&&(t=this(t)),8&f||"object"==typeof t&&t&&(4&f&&t.__esModule||16&f&&"function"==typeof t.then))return t;var d=Object.create(null);r.r(d);var c={};n=n||[null,e({}),e([]),e(e)];for(var a=2&f&&t;"object"==typeof a&&!~n.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(b=>c[b]=()=>t[b]);return c.default=()=>t,r.d(d,c),d}})(),r.d=(e,n)=>{for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((n,t)=>(r.f[t](e,n),n),[])),r.u=e=>(592===e?"common":e)+"."+{19:"124a066645320965",46:"40ebac81bd0fb91b",53:"3655b31ecb37ade9",72:"23b7f31fc45323cb",174:"491c4991a4f8e404",213:"0e33a2cc7393deb2",277:"e644e3531765ce65",360:"5c7b51c35e7142e7",369:"a1e3b731aeb5243f",379:"25d1b1c637903c75",392:"f4537160149f627a",397:"c1a8fad6c2ca3235",425:"03f8f97da7452806",455:"c9dd08adf08a1b65",481:"64ffd74d20798f93",501:"7645c32a140dd7f8",512:"52dc49022c04fa43",545:"4809f373cc63f3b4",592:"1b119d9b7a972f87",717:"5d253da5bb63552f",739:"0de1f18deac0ed90",754:"086e7f7a5377c7d9",767:"64dd12e70c78eb25",835:"ea5f86512592f641",859:"3a4d26983bbb5254",874:"1fbcd1001b41f18e",913:"ec8155bc121fb0a6",993:"5c22ca4b00b8c459",997:"1e5281aa64540dee"}[e]+".js",r.miniCssF=e=>{},r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={},n="pos-marketplace:";r.l=(t,f,d,c)=>{if(e[t])e[t].push(f);else{var a,b;if(void 0!==d)for(var o=document.getElementsByTagName("script"),s=0;s<o.length;s++){var i=o[s];if(i.getAttribute("src")==t||i.getAttribute("data-webpack")==n+d){a=i;break}}a||(b=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",n+d),a.src=r.tu(t)),e[t]=[f];var p=(g,u)=>{a.onerror=a.onload=null,clearTimeout(l);var _=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),_&&_.forEach(y=>y(u)),g)return g(u)},l=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),b&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:n=>n},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="https://cdn.jsdelivr.net/npm/marketplacepos@2.9.5/Marketplace/",(()=>{var e={666:0};r.f.j=(f,d)=>{var c=r.o(e,f)?e[f]:void 0;if(0!==c)if(c)d.push(c[2]);else if(666!=f){var a=new Promise((i,p)=>c=e[f]=[i,p]);d.push(c[2]=a);var b=r.p+r.u(f),o=new Error;r.l(b,i=>{if(r.o(e,f)&&(0!==(c=e[f])&&(e[f]=void 0),c)){var p=i&&("load"===i.type?"missing":i.type),l=i&&i.target&&i.target.src;o.message="Loading chunk "+f+" failed.\n("+p+": "+l+")",o.name="ChunkLoadError",o.type=p,o.request=l,c[1](o)}},"chunk-"+f,f)}else e[f]=0},r.O.j=f=>0===e[f];var n=(f,d)=>{var o,s,[c,a,b]=d,i=0;if(c.some(l=>0!==e[l])){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(b)var p=b(r)}for(f&&f(d);i<c.length;i++)r.o(e,s=c[i])&&e[s]&&e[s][0](),e[s]=0;return r.O(p)},t=self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))})()})();
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"marketplacepos","version":"2.9.
|
|
1
|
+
{"name":"marketplacepos","version":"2.9.5"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[360],{4360:(M,C,e)=>{e.r(C),e.d(C,{ReportModule:()=>r});var g=e(6895),t=e(2937),p=e(4650),f=e(284);class d{constructor(){}}d.\u0275fac=function(n){return new(n||d)},d.\u0275cmp=p.Xpm({type:d,selectors:[["app-report"]],decls:1,vars:0,template:function(n,a){1&n&&p._UZ(0,"router-outlet")},dependencies:[f.lC],styles:["ul[_ngcontent-%COMP%] > li.dropdown-item[_ngcontent-%COMP%]{font-size:.6875rem!important}"]});var m=e(8063);const i=[{path:"",component:d,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",loadChildren:()=>Promise.all([e.e(592),e.e(993)]).then(e.bind(e,7993)).then(o=>o.OrderModule),canActivate:[m.a]}]}];class l{}l.\u0275fac=function(n){return new(n||l)},l.\u0275mod=p.oAB({type:l}),l.\u0275inj=p.cJS({imports:[g.ez,f.Bz.forChild(i)]});var _=e(4006),h=e(7481),D=e(5171);class r{}r.\u0275fac=function(n){return new(n||r)},r.\u0275mod=p.oAB({type:r}),r.\u0275inj=p.cJS({imports:[g.ez,t.Z,l,_.u5,h.R,f.Bz,D.P]})},5171:(M,C,e)=>{e.d(C,{P:()=>r});var g=e(6895),t=e(4650),p=e(4006),f=e(8277),d=e(9101),m=e(3238),i=e(9602),l=e(9549),_=e(4144);function h(o,n){if(1&o){const a=t.EpF();t.ynx(0),t.TgZ(1,"mat-date-range-picker-actions")(2,"button",8),t._uU(3,"Cancel"),t.qZA(),t.TgZ(4,"button",9),t.NdJ("click",function(){t.CHM(a);const s=t.oxw();return t.KtG(s.onSelectDate())}),t._uU(5,"Search"),t.qZA()(),t.BQk()}}class r{constructor(){this.disabled=!1,this.widthClass="w-100",this.showButtonConfirm=!1,this.dateChange=new t.vpe}fromDateChange(n){let a=n?.toDate();this.from=a}toDateChange(n){if(n){let a=n.toDate();this.to=a,this.showButtonConfirm||this.emitDateChange()}}onOpenDatepicker(){console.log("open");const n=document.getElementById("dropdown-filter");if(n){var a=new bootstrap.Dropdown(n);a&&(a._config.autoClose="inside")}}onCloseDatepicker(){console.log("close");const n=document.getElementById("dropdown-filter");if(n){var a=new bootstrap.Dropdown(n);a&&(a._config.autoClose="outside")}}emitDateChange(){this.dateChange.emit({from:this.from,to:this.to})}onSelectDate(){this.emitDateChange()}}r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=t.Xpm({type:r,selectors:[["app-datepicker-range"]],inputs:{placeholder:"placeholder",displayToggle:"displayToggle",date:"date",disabled:"disabled",minDate:"minDate",widthClass:"widthClass",showButtonConfirm:"showButtonConfirm",from:"from",to:"to"},outputs:{dateChange:"dateChange"},standalone:!0,features:[t._Bn([{provide:m._A,useClass:f.t7,deps:[m.Ad]},{provide:m.sG,useValue:{parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}}}]),t.jDz],decls:8,vars:8,consts:[["appearance","outline",1,"date-range"],["id","dates",3,"min","rangePicker"],["matStartDate","","placeholder","Start date",3,"value","dateChange","click"],["matEndDate","","placeholder","End date",3,"value","dateChange","click"],["matPrefix","",3,"for"],[3,"opened","closed"],["picker",""],[4,"ngIf"],["mat-button","","matDateRangePickerCancel",""],["mat-raised-button","","color","primary","matDateRangePickerApply","",3,"click"]],template:function(n,a){if(1&n){const u=t.EpF();t.TgZ(0,"mat-form-field",0)(1,"mat-date-range-input",1)(2,"input",2),t.NdJ("dateChange",function(c){return a.fromDateChange(c.value)})("click",function(){t.CHM(u);const c=t.MAs(6);return t.KtG(c.open())}),t.qZA(),t.TgZ(3,"input",3),t.NdJ("dateChange",function(c){return a.toDateChange(c.value)})("click",function(){t.CHM(u);const c=t.MAs(6);return t.KtG(c.open())}),t.qZA()(),t._UZ(4,"mat-datepicker-toggle",4),t.TgZ(5,"mat-date-range-picker",5,6),t.NdJ("opened",function(){return a.onOpenDatepicker()})("closed",function(){return a.onCloseDatepicker()}),t.YNc(7,h,6,0,"ng-container",7),t.qZA()()}if(2&n){const u=t.MAs(6);t.Tol(a.widthClass),t.xp6(1),t.Q6J("min",a.minDate)("rangePicker",u),t.xp6(1),t.Q6J("value",a.from),t.xp6(1),t.Q6J("value",a.to),t.xp6(1),t.Q6J("for",u),t.xp6(3),t.Q6J("ngIf",a.showButtonConfirm)}},dependencies:[g.ez,g.O5,m.XK,i.FA,i.nW,i.wx,i.zY,i.By,i._g,i.M5,i.dp,i.DK,l.lN,l.KE,l.qo,_.c,p.u5,d.ot,d.lW],styles:["mat-form-field.date-range.mat-mdc-form-field-type-mat-date-range-input .mat-mdc-form-field-infix{padding-top:12px!important;padding-bottom:12px!important;min-height:45px!important;font-size:14px!important}"]})}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[379],{2379:(X,K,u)=>{u.r(K),u.d(K,{OrdersModule:()=>k});var g=u(6895),m=u(284),L=u(8703),e=u(4650),M=u(2937);class y{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[L.G.downloadOrder]}]}ngOnInit(){}}y.\u0275fac=function(n){return new(n||y)},y.\u0275cmp=e.Xpm({type:y,selectors:[["app-orders"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(n,t){1&n&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&n&&(e.xp6(3),e.Q6J("Tabs",t.ObjectOrderTabs)("usePermissions",!0))},dependencies:[M.e,m.lC]});var h=u(1889),b=u(4782),J=u(8505),r=u(9694),l=u(9568),s=u(2428),p=u(5412),c=u(4006),_=u(6709);class v{constructor(n){this.dialogRef=n,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}}v.\u0275fac=function(n){return new(n||v)(e.Y36(p.so))},v.\u0275cmp=e.Xpm({type:v,selectors:[["app-print-tokopedia"]],decls:17,vars:1,consts:[[1,"container-fluid"],["mat-dialog-title","",1,"text-center","mb-8","fw-bold"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"ngModel","ngModelChange"],[1,"fs-5","pt-1"],[1,"d-flex","align-items-center","justify-content-center","mt-6"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0)(1,"h2",1),e._uU(2,"Cetak label pesanan"),e.qZA(),e.TgZ(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),e._uU(7,"Kamu akan mencetak label yang berisi detail pesanan"),e.qZA(),e.TgZ(8,"div",5)(9,"mat-checkbox",6),e.NdJ("ngModelChange",function(o){return t.tandaiSudahDicetak=o}),e.qZA(),e.TgZ(10,"span",7),e._uU(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),e.qZA()()()()(),e.TgZ(12,"mat-dialog-actions",8)(13,"button",9),e.NdJ("click",function(){return t.onCancel()}),e._uU(14,"Cancel"),e.qZA(),e.TgZ(15,"button",10),e.NdJ("click",function(){return t.onPrint()}),e._uU(16,"Cetak Pesanan"),e.qZA()()()),2&n&&(e.xp6(9),e.Q6J("ngModel",t.tandaiSudahDicetak))},dependencies:[c.JJ,c.On,_.oG,p.uh,p.xY,p.H8]});var V=u(4004),ee=u(9300),te=u(3900),S=u(1318),j=u(7185);class q{constructor(){}convertToCSV(n,t){let i;if("string"==typeof n)i=n;else{var o="object"==typeof n?n:JSON.parse(n);i=this.transformToCSVStringFormat(o)}this.downloadCSV(i,t)}transformToCSVStringFormat(n){if(!n||!n.length)return;const i=Object.keys(n[0]);return n.map(d=>i.map(I=>{let x=null==d[I]?"":d[I];return x=x instanceof Date?x.toLocaleString():x.toString().replace(/"/g,'""'),x.search(/("|,|\n)/g)>=0&&(x=`"${x}"`),x}).join(",")).join("\n")}downloadCSV(n,t){var i=new Blob([n],{type:"text/csv;charset=utf8;"}),o=document.createElement("a");o.setAttribute("href",window.URL.createObjectURL(i)),o.setAttribute("download",t),document.body.appendChild(o),o.click(),document.body.removeChild(o)}}q.\u0275fac=function(n){return new(n||q)},q.\u0275prov=e.Yz7({token:q,factory:q.\u0275fac,providedIn:"root"});class C{constructor(n,t,i,o){this.http=n,this.dialog=t,this.toastr=i,this.exportService=o}loadInitialPage(){return this.http.post("/api/ordersLoader/GetOrder",{})}getNewOrders(n){return this.http.post("/api/orders/GetNewOrder",n).pipe((0,V.U)(t=>t.Data))}getTotalNewOrders(n){return this.http.post("/api/orders/GetCountNewOrder",{ListChannelID:n}).pipe((0,V.U)(i=>i.Count))}printShippingLabelTokopedia(n){const t={OrderNumber:n,Printed:!0};this.dialog.open(v).afterClosed().pipe((0,ee.h)(i=>void 0!==i),(0,te.w)(i=>(t.Printed=i,this.http.post("api/v1/Shippinglabel/Tokopedia",t)))).subscribe(i=>{const o=window.open("about:blank","_blank");o.document.write(i),o.document.close()})}printShippingLabelTiktok(n,t){this.http.post("api/v1/Shippinglabel/Tiktok",{ShopID:t,OrderNumber:n}).subscribe(o=>{null!=o.data?window.open(o.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print")})}printShippingLabelShopee(n,t){this.http.post("api/v1/Shippinglabel/shopee/DownloadShipping",{ShopID:t,OrderNumber:n}).subscribe(o=>{var d=Uint8Array.from(atob(o),x=>x.charCodeAt(0)),I=new Blob([d],{type:"octet/stream"});h.g.openDownloadFile(I,`${n}.pdf`)})}printShippingLabelLazada(n,t){this.http.post("api/v1/Shippinglabel/Lazada/DownloadShipping",{ShopID:t,OrderNumber:n}).subscribe(o=>{null!=o.result.data?window.open(o.result.data.pdf_url,"_blank"):this.toastr.error(o.message,"Cannot Print")})}exportOrders(n,t){return this.http.post("api/Orders/ExportOrder",n).pipe((0,J.b)(i=>{this.exportService.convertToCSV(i,t)}))}}C.\u0275fac=function(n){return new(n||C)(e.LFG(S.O),e.LFG(p.uw),e.LFG(j._W),e.LFG(q))},C.\u0275prov=e.Yz7({token:C,factory:C.\u0275fac});class A{constructor(n,t){this.http=n,this.toastr=t}acceptTokopediaOrders(n){return this.http.post("/api/Orders/AcceptOrderTokopedia",n).pipe((0,J.b)(t=>{this.tokopediaAcceptOrderHandler(t)}))}tokopediaAcceptOrderHandler(n){const t=n.filter(o=>0==o.Status),i=n.filter(o=>1==o.Status);if(0==t.length&&i.length>0){let o=`<ol>${this.generateSuccessMessage(i)}</ol>`;this.toastr.success(o,"Success",{enableHtml:!0})}else if(t.length>0&&i.length>0){let o=`<ol>\n ${this.generateSuccessMessage(i)}\n ${this.generateErrorMessage(t)}\n </ol>`;this.toastr.warning(o,"Warning",{enableHtml:!0})}else{let o=`<ol>${this.generateErrorMessage(t)}</ol>`;this.toastr.error(o,"Error",{enableHtml:!0})}}generateSuccessMessage(n){let t="";return n.forEach(i=>{t+=`<li><b>${i.OrderNumber}</b> was successfully Accept</li>`}),t}generateErrorMessage(n){let t="";return n.forEach(i=>{t+=`<li><b>${i.OrderNumber}</b> ${i.Message}</li>`}),t}}A.\u0275fac=function(n){return new(n||A)(e.LFG(S.O),e.LFG(j._W))},A.\u0275prov=e.Yz7({token:A,factory:A.\u0275fac});var w=u(7481),f=u(8796),N=u(2594);class Z{constructor(){}set typeId(n){this.channelLogo=h.g.getChannelLogoByTypeId(n),this.initChannelName(n)}initChannelName(n){switch(n){case r.x.Tokopedia:this.channelName="Tokopedia";break;case r.x.Tiktok:this.channelName="Tiktok";break;case r.x.WooCommerce:this.channelName="WooCommerce";break;case r.x.ShopeeV2:this.channelName="Shopee";break;case r.x.Lazada:this.channelName="Lazada";break;case r.x.KalCare:this.channelName="Kalcare"}}}Z.\u0275fac=function(n){return new(n||Z)},Z.\u0275cmp=e.Xpm({type:Z,selectors:[["app-channel-logo"]],inputs:{typeId:"typeId"},decls:4,vars:2,consts:[[1,"d-flex","align-items-center"],[2,"width","20px",3,"src"],[1,"ms-3","fw-normal"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e._UZ(1,"img",1),e.TgZ(2,"span",2),e._uU(3),e.qZA()()),2&n&&(e.xp6(1),e.Q6J("src",t.channelLogo,e.LSH),e.xp6(2),e.Oqu(t.channelName))}});var P=u(9640);function ne(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"button",11),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().ngIf,d=e.oxw();return e.KtG(d.onAcceptOrder(o))}),e._UZ(2,"i",12),e._uU(3," Accept "),e.qZA(),e.BQk()}}function ae(a,n){if(1&a&&(e.ynx(0),e.YNc(1,ne,4,0,"ng-container",1),e.BQk()),2&a){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.isTokopediaAvailable&&t.isTokopediaSelected)}}function ie(a,n){if(1&a&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}function oe(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"th",25)(2,"input",26),e.NdJ("ngModelChange",function(o){e.CHM(t);const d=e.oxw(3);return e.KtG(d.isCheckAll=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(2).ngIf,d=e.oxw();return e.KtG(d.onSelectAllOrderData(o))}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw(3);e.xp6(2),e.Q6J("ngModel",t.isCheckAll)}}function re(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"input",26),e.NdJ("ngModelChange",function(o){e.CHM(t);const d=e.oxw(2).$implicit;return e.KtG(d.selected=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(4).ngIf,d=e.oxw();return e.KtG(d.onSelectOrderData(o))}),e.qZA(),e.BQk()}if(2&a){const t=e.oxw(2).$implicit;e.xp6(1),e.Q6J("ngModel",t.selected)}}function le(a,n){if(1&a&&(e.ynx(0),e.TgZ(1,"td"),e.YNc(2,re,2,1,"ng-container",1),e.qZA(),e.BQk()),2&a){const t=e.oxw().$implicit,i=e.oxw(3);e.xp6(2),e.Q6J("ngIf",t.Type==i.tokopediaType)}}function se(a,n){if(1&a&&(e.ynx(0),e.TgZ(1,"span"),e._uU(2),e.qZA(),e.BQk()),2&a){const t=e.oxw().$implicit;e.xp6(2),e.Oqu(t.Number)}}function pe(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(3);e.Q6J("href",i.domain+"/menu/Orders/Order/Sales_Order/Info?ID="+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function ce(a,n){if(1&a&&(e.TgZ(0,"tr"),e.YNc(1,le,3,1,"ng-container",1),e.TgZ(2,"td"),e._uU(3),e.qZA(),e.TgZ(4,"td"),e.YNc(5,se,3,1,"ng-container",15),e.YNc(6,pe,2,2,"ng-template",null,27,e.W1O),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td"),e._uU(11),e.ALo(12,"date"),e.qZA(),e.TgZ(13,"td"),e._UZ(14,"app-channel-logo",28),e.qZA()()),2&a){const t=n.$implicit,i=e.MAs(7),o=e.oxw(3);e.xp6(1),e.Q6J("ngIf",o.isTokopediaAvailable),e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",t.ID==o.guidEmpty)("ngIfElse",i),e.xp6(4),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.xi3(12,7,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.Type)}}function de(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",16)(2,"table",17)(3,"thead",18)(4,"tr",19),e.YNc(5,oe,3,1,"ng-container",1),e.TgZ(6,"th",20),e._uU(7,"Outlet"),e.qZA(),e.TgZ(8,"th",21),e._uU(9,"Order number"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Customer"),e.qZA(),e.TgZ(12,"th",22),e._uU(13,"Created On"),e.qZA(),e.TgZ(14,"th",22),e._uU(15,"Channel"),e.qZA()()(),e.TgZ(16,"tbody"),e.YNc(17,ce,15,10,"tr",23),e.qZA()(),e.TgZ(18,"app-mat-paginator-no-count",24),e.NdJ("total",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.getPaginatonTotal())})("next",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onNextPage())})("previous",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onPreviousPage())}),e.ALo(19,"async"),e.ALo(20,"async"),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw().ngIf,i=e.oxw();let o;e.xp6(5),e.Q6J("ngIf",i.isTokopediaAvailable&&t),e.xp6(12),e.Q6J("ngForOf",t),e.xp6(1),e.Q6J("filter",i.filter)("totaldata",null==(o=e.lcZ(19,5,i.newOrdersData$))?null:o.length)("paginationTotal",e.lcZ(20,7,i.paginationTotal$))}}function ue(a,n){if(1&a&&(e.ynx(0),e.YNc(1,de,21,9,"ng-container",15),e.BQk()),2&a){const t=n.ngIf;e.oxw();const i=e.MAs(26);e.xp6(1),e.Q6J("ngIf",(null==t?null:t.length)>0)("ngIfElse",i)}}function ge(a,n){1&a&&(e.TgZ(0,"div",30),e._UZ(1,"app-empty-state"),e.qZA())}class E{constructor(n,t,i,o,d){this.localDataService=n,this.channelService=t,this.orderService=i,this.toastr=o,this.acceptOrderService=d,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.domain=`https://${this.localDataService.getHostName()}`,this.guidEmpty=h.g.GuidEMpty,this.tokopediaType=r.x.Tokopedia,this.isTokopediaSelected=!1,this.isTokopediaAvailable=!1,this.isCheckAll=!1}ngOnInit(){this.initLoadPage()}initLoadPage(){this.orderService.loadInitialPage().subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.getNewOrders()})}getNewOrders(){this.newOrdersData$=this.orderService.getNewOrders({PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).pipe((0,b.d)(),(0,J.b)(t=>{t.filter(o=>o.Type==r.x.Tokopedia).length>0&&(this.isTokopediaAvailable=!0)}))}getPaginatonTotal(){this.paginationTotal$=this.orderService.getTotalNewOrders(this.filter.ListChannelID).pipe((0,b.d)())}onNextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getNewOrders()}onPreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getNewOrders()}onSelectOrderData(n){this.isTokopediaSelected=!1,n.filter(i=>i.selected).length>0&&(this.isTokopediaSelected=!0)}onSelectAllOrderData(n){n=n.map(t=>(t.Type==r.x.Tokopedia&&(t.selected=this.isCheckAll),t)),this.onSelectOrderData(n)}onAcceptOrder(n){let t=this.getSelectedTokopediaOrders(n);this.acceptOrderService.acceptTokopediaOrders(t).subscribe(i=>{this.isTokopediaSelected=!1,location.reload()})}getSelectedTokopediaOrders(n){return n.filter(i=>i.selected).map(i=>i.Number)}}function he(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.ALo(8,"number"),e.qZA()()),2&a){const t=n.$implicit;e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(e.lcZ(5,3,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(8,5,t.Price))}}function _e(a,n){if(1&a&&(e.TgZ(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"h3",8),e._uU(5,"Outlet Info"),e.qZA()(),e.TgZ(6,"div",4)(7,"div",9),e._uU(8," Outlet : "),e.qZA(),e.TgZ(9,"div",9),e._uU(10),e.qZA()(),e.TgZ(11,"div",4)(12,"div",9),e._uU(13," Date : "),e.qZA(),e.TgZ(14,"div",9),e._uU(15),e.ALo(16,"date"),e.qZA()(),e.TgZ(17,"div",4)(18,"div",9),e._uU(19," Status : "),e.qZA(),e.TgZ(20,"div",9),e._uU(21),e.qZA()(),e.TgZ(22,"div",4)(23,"div",9),e._uU(24," Tax Type : "),e.qZA(),e.TgZ(25,"div",9),e._uU(26),e.qZA()(),e.TgZ(27,"div",4)(28,"div",9),e._uU(29," Due Date : "),e.qZA(),e.TgZ(30,"div",9),e._uU(31),e.ALo(32,"date"),e.qZA()()(),e.TgZ(33,"div",6)(34,"div",7)(35,"h3",8),e._uU(36,"Customer Info"),e.qZA()(),e.TgZ(37,"div",4)(38,"div",9),e._uU(39," Name : "),e.qZA(),e.TgZ(40,"div",9),e._uU(41),e.qZA()(),e.TgZ(42,"div",4)(43,"div",9),e._uU(44," Email : "),e.qZA(),e.TgZ(45,"div",9),e._uU(46),e.qZA()(),e.TgZ(47,"div",4)(48,"div",9),e._uU(49," Mobile : "),e.qZA(),e.TgZ(50,"div",9),e._uU(51),e.qZA()()()(),e.TgZ(52,"div",10)(53,"h3",11),e._uU(54,"Products Sold"),e.qZA(),e.TgZ(55,"div",12)(56,"table",13)(57,"thead",14)(58,"tr",15)(59,"th"),e._uU(60,"Code"),e.qZA(),e.TgZ(61,"th"),e._uU(62,"Quantity"),e.qZA(),e.TgZ(63,"th"),e._uU(64,"Price"),e.qZA()()(),e.TgZ(65,"tbody"),e.YNc(66,he,9,7,"tr",16),e.qZA()()()()()),2&a){const t=e.oxw();e.xp6(10),e.hij(" ",t.model.Outlet," "),e.xp6(5),e.hij(" ",e.xi3(16,9,t.model.Date,"dd MMM yyyy")," "),e.xp6(6),e.hij(" ",t.model.Delivery," "),e.xp6(5),e.hij(" ",t.model.TaxType," "),e.xp6(5),e.hij(" ",e.xi3(32,12,t.model.DueDate,"dd MMM yyyy")," "),e.xp6(10),e.hij(" ",t.model.Customer.Name," "),e.xp6(5),e.hij(" ",t.model.Customer.Email," "),e.xp6(5),e.hij(" ",t.model.Customer.Mobile," "),e.xp6(15),e.Q6J("ngForOf",t.model.Variants)}}E.\u0275fac=function(n){return new(n||E)(e.Y36(l.T),e.Y36(s.T),e.Y36(C),e.Y36(j._W),e.Y36(A))},E.\u0275cmp=e.Xpm({type:E,selectors:[["app-new-order"]],decls:27,vars:13,consts:[["headerTitle","1 - New Order","searchBoxPlaceHolder","Search Orders...",3,"hideSearchBox","onSubmit"],[4,"ngIf"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["EMPTY_STATE",""],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-check"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[2,"width","5px"],["type","checkbox",3,"ngModel","ngModelChange"],["NOT_EMPTY",""],[3,"typeId"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(){return t.getNewOrders()}),e.TgZ(1,"actions"),e.YNc(2,ae,2,1,"ng-container",1),e.ALo(3,"async"),e.qZA(),e.TgZ(4,"filters")(5,"div",2)(6,"div")(7,"h6"),e._uU(8,"Channel"),e.qZA(),e.TgZ(9,"ng-select",3),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(10,ie,3,2,"ng-template",4),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Number"),e.qZA(),e.TgZ(14,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(15,"div")(16,"h6"),e._uU(17,"Page Size"),e.qZA(),e.TgZ(18,"input",6),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(19,"content")(20,"div",7)(21,"div",8)(22,"div",9),e.YNc(23,ue,2,2,"ng-container",1),e.ALo(24,"async"),e.YNc(25,ge,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n&&(e.Q6J("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",e.lcZ(3,9,t.newOrdersData$)),e.xp6(7),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",e.lcZ(24,11,t.newOrdersData$)))},dependencies:[g.sg,g.O5,c.Fj,c.wV,c.Wl,c.JJ,c.On,w.p,f.w9,f.ir,N.n,Z,P.s,g.Ov,g.uU]});const me=function(){return["/menu/Order"]};class Q{constructor(n,t){this.http=n,this.url=t,this.number=this.url.snapshot.queryParams.Number,this.outlet=this.url.snapshot.queryParams.Outlet}ngOnInit(){this.Load()}Load(){this.http.post("/api/orders/GetInvoiceDetail",{Number:this.number,Outlet:this.outlet}).subscribe(t=>{this.model=t})}}function fe(a,n){if(1&a&&(e.TgZ(0,"span",11),e._UZ(1,"img",12),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}Q.\u0275fac=function(n){return new(n||Q)(e.Y36(S.O),e.Y36(m.gz))},Q.\u0275cmp=e.Xpm({type:Q,selectors:[["app-detail-order"]],decls:7,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-secondary","btn-fill","btn-lg","me-3",3,"routerLink"],[1,"container"],["class","row",4,"ngIf"],[1,"row"],[1,"col-4"],[1,"border","my-3","py-3","col-12"],[1,"row","m-2"],[1,"text-center"],[1,"col"],[1,"col-8"],[1,"text-center","my-3","py-3"],[1,"table-responsive"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0)(1,"actions")(2,"a",1),e._uU(3,"Back"),e.qZA()(),e.TgZ(4,"content")(5,"div",2),e.YNc(6,_e,67,15,"div",3),e.qZA()()()),2&n&&(e.Q6J("headerTitle","Order #"+t.number)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("routerLink",e.DdM(5,me)),e.xp6(4),e.Q6J("ngIf",t.model))},dependencies:[g.sg,g.O5,w.p,m.rH,g.JJ,g.uU]});const Te=function(){return["/menu/Order/detail"]},Ce=function(a,n){return{Number:a,Outlet:n}};function Ze(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Te))("queryParams",e.WLB(4,Ce,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function xe(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(2);e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function be(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"a",31),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw(2);return e.KtG(d.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",32),e.qZA()}}function ve(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ze,2,7,"a",24),e.YNc(5,xe,2,2,"a",25),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",26),e.qZA(),e.TgZ(16,"td",27),e.YNc(17,be,2,0,"a",28),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==i.channelType.ShopeeV2||t.TypeID==i.channelType.Tokopedia||t.TypeID==i.channelType.Tiktok||t.TypeID==i.channelType.Lazada)}}function Se(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",13)(2,"table",14)(3,"thead",15)(4,"tr",16)(5,"th",17),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",18),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",19),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",20),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",20),e._uU(16,"Channel"),e.qZA(),e._UZ(17,"th",21),e.qZA()(),e.TgZ(18,"tbody"),e.YNc(19,ve,18,13,"tr",22),e.qZA()(),e.TgZ(20,"app-mat-paginator-no-count",23),e.NdJ("total",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.StoreRowsCountAPIResult())})("next",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.NextPage())})("previous",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(19),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal)}}function we(a,n){1&a&&(e.TgZ(0,"div",33),e._UZ(1,"app-empty-state"),e.qZA())}class Y{constructor(n,t,i,o,d){this.http=n,this.localDataService=t,this.dialog=i,this.orderService=o,this.channelService=d,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0,this.checkboxState=!1,this.channelType=r.x}ngOnInit(){this.Load()}getChannelLogo(n){return h.g.getChannelLogoByTypeId(n)}hasGuidEmpty(n){return n==h.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetReadyToShip",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}onPrintShippingLabel(n,t,i){switch(i){case r.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case r.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case r.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t);break;case r.x.Lazada:this.orderService.printShippingLabelLazada(n,t)}}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Unsent",ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}function De(a,n){if(1&a&&(e.TgZ(0,"span",11),e._UZ(1,"img",12),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}Y.\u0275fac=function(n){return new(n||Y)(e.Y36(S.O),e.Y36(l.T),e.Y36(p.uw),e.Y36(C),e.Y36(s.T))},Y.\u0275cmp=e.Xpm({type:Y,selectors:[["app-ready-to-ship"]],decls:23,vars:8,consts:[["headerTitle","2 - Ready to Ship","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container","",1,""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","60px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(7,fe,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(16,"content")(17,"div",6)(18,"div",7)(19,"div",8),e.YNc(20,Se,21,4,"ng-container",9),e.YNc(21,we,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(22);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",i)}},dependencies:[g.sg,g.O5,c.Fj,c.wV,c.JJ,c.On,w.p,m.rH,f.w9,f.ir,N.n,Z,P.s,g.JJ,g.uU]});const ye=function(){return["/menu/Order/detail"]},Ae=function(a,n){return{Number:a,Outlet:n}};function Ne(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,ye))("queryParams",e.WLB(4,Ae,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Pe(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(2);e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Oe(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"a",31),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw(2);return e.KtG(d.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",32),e.qZA()}}function Ie(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ne,2,7,"a",24),e.YNc(5,Pe,2,2,"a",25),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",26),e.qZA(),e.TgZ(16,"td",27),e.YNc(17,Oe,2,0,"a",28),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==i.channelType.ShopeeV2||t.TypeID==i.channelType.Tokopedia||t.TypeID==i.channelType.Tiktok||t.TypeID==i.channelType.Lazada)}}function Me(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",13)(2,"table",14)(3,"thead",15)(4,"tr",16)(5,"th",17),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",18),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",19),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",20),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",20),e._uU(16,"Channel"),e.qZA(),e._UZ(17,"th",21),e.qZA()(),e.TgZ(18,"tbody"),e.YNc(19,Ie,18,13,"tr",22),e.qZA()(),e.TgZ(20,"app-mat-paginator-no-count",23),e.NdJ("total",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.StoreRowsCountAPIResult())})("next",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.NextPage())})("previous",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(19),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal)}}function qe(a,n){1&a&&(e.TgZ(0,"div",33),e._UZ(1,"app-empty-state"),e.qZA())}class G{constructor(n,t,i,o){this.http=n,this.localDataService=t,this.orderService=i,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0,this.channelType=r.x}ngOnInit(){this.Load()}getChannelLogo(n){return h.g.getChannelLogoByTypeId(n)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}hasGuidEmpty(n){return n==h.g.GuidEMpty}Get(n){this.http.post("api/orders/GetShipped",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}onPrintShippingLabel(n,t,i){switch(i){case r.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case r.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case r.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t);break;case r.x.Lazada:this.orderService.printShippingLabelLazada(n,t)}}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}G.\u0275fac=function(n){return new(n||G)(e.Y36(S.O),e.Y36(l.T),e.Y36(C),e.Y36(s.T))},G.\u0275cmp=e.Xpm({type:G,selectors:[["app-shipped"]],decls:23,vars:8,consts:[["headerTitle","3 - Shipped","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","60px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(7,De,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(16,"content")(17,"div",6)(18,"div",7)(19,"div",8),e.YNc(20,Me,21,4,"ng-container",9),e.YNc(21,qe,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(22);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",i)}},dependencies:[g.sg,g.O5,c.Fj,c.wV,c.JJ,c.On,w.p,m.rH,f.w9,f.ir,N.n,Z,P.s,g.JJ,g.uU]});var Ue=u(501);function ke(a,n){if(1&a&&(e.TgZ(0,"span",11),e._UZ(1,"img",12),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}const Le=function(){return["/menu/Order/detail"]},Je=function(a,n){return{Number:a,Outlet:n}};function Ee(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Le))("queryParams",e.WLB(4,Je,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Qe(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(2);e.Q6J("href",i.customerInfoUrl+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Ye(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"a",31),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw(2);return e.KtG(d.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",32),e.qZA()}}function Ge(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ee,2,7,"a",24),e.YNc(5,Qe,2,2,"a",25),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",26),e.qZA(),e.TgZ(16,"td",27),e.YNc(17,Ye,2,0,"a",28),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==i.channelType.ShopeeV2||t.TypeID==i.channelType.Tokopedia||t.TypeID==i.channelType.Tiktok)}}function Fe(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",13)(2,"table",14)(3,"thead",15)(4,"tr",16)(5,"th",17),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",18),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",19),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",20),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",20),e._uU(16,"Channel"),e.qZA(),e._UZ(17,"th",21),e.qZA()(),e.TgZ(18,"tbody"),e.YNc(19,Ge,18,13,"tr",22),e.qZA()(),e.TgZ(20,"app-mat-paginator-no-count",23),e.NdJ("total",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.StoreRowsCountAPIResult())})("next",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.NextPage())})("previous",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(19),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal)}}function He(a,n){1&a&&(e.TgZ(0,"div",33),e._UZ(1,"app-empty-state"),e.qZA())}class F{constructor(n,t,i,o){this.http=n,this.orderService=t,this.authService=i,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0,this.channelType=r.x}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==h.g.GuidEMpty}getChannelLogo(n){return h.g.getChannelLogoByTypeId(n)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.customerInfoUrl=`${this.authService.getDomain()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetDelivered ",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Paid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}onPrintShippingLabel(n,t,i){switch(i){case r.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case r.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case r.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t)}}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}function Re(a,n){if(1&a&&(e.TgZ(0,"span",11),e._UZ(1,"img",12),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}F.\u0275fac=function(n){return new(n||F)(e.Y36(S.O),e.Y36(C),e.Y36(Ue.e),e.Y36(s.T))},F.\u0275cmp=e.Xpm({type:F,selectors:[["app-delivered"]],decls:23,vars:9,consts:[["headerTitle","4 - Completed","searchBoxPlaceHolder","Search ...",3,"hideSearchBox","onSubmit"],["container","",1,""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","60px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(7,ke,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(16,"content")(17,"div",6)(18,"div",7)(19,"div",8),e.YNc(20,Fe,21,4,"ng-container",9),e.YNc(21,He,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(22);e.Q6J("hideSearchBox",!0),e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",i)}},dependencies:[g.sg,g.O5,c.Fj,c.wV,c.JJ,c.On,w.p,m.rH,f.w9,f.ir,N.n,Z,P.s,g.JJ,g.uU]});const ze=function(){return["/menu/Order/detail"]},$e=function(a,n){return{Number:a,Outlet:n}};function Be(a,n){if(1&a&&(e.TgZ(0,"a",27),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,ze))("queryParams",e.WLB(4,$e,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Ke(a,n){if(1&a&&(e.TgZ(0,"a",28),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(2);e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function je(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Be,2,7,"a",24),e.YNc(5,Ke,2,2,"a",25),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._uU(15),e.qZA(),e.TgZ(16,"td"),e._UZ(17,"app-channel-logo",26),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Oqu(t.State),e.xp6(2),e.Q6J("typeId",t.TypeID)}}function Ve(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",13)(2,"table",14)(3,"thead",15)(4,"tr",16)(5,"th",17),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",18),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",19),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",20),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",21),e._uU(16,"Status"),e.qZA(),e.TgZ(17,"th",20),e._uU(18,"Channel"),e.qZA()()(),e.TgZ(19,"tbody"),e.YNc(20,je,18,13,"tr",22),e.qZA()(),e.TgZ(21,"app-mat-paginator-no-count",23),e.NdJ("total",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.StoreRowsCountAPIResult())})("next",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.NextPage())})("previous",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(20),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal)}}function We(a,n){1&a&&(e.TgZ(0,"div",29),e._UZ(1,"app-empty-state"),e.qZA())}class H{constructor(n,t,i){this.http=n,this.localDataService=t,this.channelService=i,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==h.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetAll ",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter=n,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!1,ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}function Xe(a,n){if(1&a&&(e.TgZ(0,"span",11),e._UZ(1,"img",12),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}H.\u0275fac=function(n){return new(n||H)(e.Y36(S.O),e.Y36(l.T),e.Y36(s.T))},H.\u0275cmp=e.Xpm({type:H,selectors:[["app-all-order"]],decls:23,vars:8,consts:[["headerTitle","All","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","135px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(7,Re,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(16,"content")(17,"div",6)(18,"div",7)(19,"div",8),e.YNc(20,Ve,22,4,"ng-container",9),e.YNc(21,We,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(22);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",i)}},dependencies:[g.sg,g.O5,c.Fj,c.wV,c.JJ,c.On,w.p,m.rH,f.w9,f.ir,N.n,Z,P.s,g.JJ,g.uU]});const et=function(){return["/menu/Order/detail"]},tt=function(a,n){return{Number:a,Outlet:n}};function nt(a,n){if(1&a&&(e.TgZ(0,"a",26),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,et))("queryParams",e.WLB(4,tt,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function at(a,n){if(1&a&&(e.TgZ(0,"a",27),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(2);e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function it(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,nt,2,7,"a",23),e.YNc(5,at,2,2,"a",24),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",25),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,7,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,9,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID)}}function ot(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",13)(2,"table",14)(3,"thead",15)(4,"tr",16)(5,"th",17),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",18),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",19),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",20),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",20),e._uU(16,"Channel"),e.qZA()()(),e.TgZ(17,"tbody"),e.YNc(18,it,16,12,"tr",21),e.qZA()(),e.TgZ(19,"app-mat-paginator-no-count",22),e.NdJ("total",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.StoreRowsCountAPIResult())})("next",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.NextPage())})("previous",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(18),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal)}}function rt(a,n){1&a&&(e.TgZ(0,"div",28),e._UZ(1,"app-empty-state"),e.qZA())}class R{constructor(n,t,i){this.http=n,this.localDataService=t,this.channelService=i,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==h.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetCancelled ",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!0,ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}getChannelLogo(n){return h.g.getChannelLogoByTypeId(n)}}R.\u0275fac=function(n){return new(n||R)(e.Y36(S.O),e.Y36(l.T),e.Y36(s.T))},R.\u0275cmp=e.Xpm({type:R,selectors:[["app-cancelled"]],decls:23,vars:8,consts:[["headerTitle","99 - Cancelled","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container","",1,""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(7,Xe,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(16,"content")(17,"div",6)(18,"div",7)(19,"div",8),e.YNc(20,ot,20,4,"ng-container",9),e.YNc(21,rt,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(22);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",i)}},dependencies:[g.sg,g.O5,c.Fj,c.wV,c.JJ,c.On,w.p,m.rH,f.w9,f.ir,N.n,Z,P.s,g.JJ,g.uU]});var lt=u(2138),O=(()=>{return(a=O||(O={}))[a.DoNothing=0]="DoNothing",a[a.New=1]="New",a[a.Update=2]="Update",O;var a})(),st=u(6082),z=u(9602),$=u(8425),W=u(266);function pt(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",28)(2,"button",29),e.NdJ("click",function(){e.CHM(t),e.oxw();const o=e.MAs(11);return e.KtG(o.previous())}),e._uU(3," Back "),e.qZA(),e.TgZ(4,"button",30),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),d=e.MAs(11);return e.KtG(o.onNext(d))}),e._uU(5," Next "),e.qZA(),e.TgZ(6,"button",31),e._UZ(7,"b",32),e.qZA(),e.TgZ(8,"ul",33)(9,"li",34)(10,"a",35),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.exportOrders())}),e._uU(11," Export "),e.qZA()()()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(4),e.Q6J("disabled",t.checkDisabledNextFilter())}}function ct(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"button",36),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),d=e.MAs(11);return e.KtG(o.onNext(d))}),e._uU(1," Next "),e.qZA()}if(2&a){const t=e.oxw();e.Q6J("disabled",t.checkDisabledNextFilter())}}function dt(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),d=e.MAs(11);return e.KtG(o.onNew(d))}),e._UZ(1,"i",38),e._uU(2," New "),e.qZA()}}function ut(a,n){1&a&&e._uU(0,"Filter")}function gt(a,n){if(1&a&&(e.TgZ(0,"ng-option",39),e._UZ(1,"img",40),e._uU(2),e.qZA()),2&a){const t=n.$implicit;e.Q6J("value",t.ID),e.xp6(1),e.s9C("src",t.Img,e.LSH),e.xp6(1),e.hij("",t.Name," ")}}function ht(a,n){1&a&&e._uU(0,"Preview")}function _t(a,n){if(1&a&&(e.TgZ(0,"th",58),e._uU(1),e.qZA()),2&a){const t=e.oxw(2);e.xp6(1),e.Oqu(0==t.getTypeID()?"Last Status Update":"Created Date")}}function mt(a,n){if(1&a&&(e.TgZ(0,"td"),e._uU(1),e.ALo(2,"date"),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.Date,"dd MMM yyyy HH:mm:ss"),"")}}function ft(a,n){if(1&a&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",t.ActionString," ")}}function Tt(a,n){if(1&a&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&a){const t=n.$implicit;e.xp6(1),e.hij("",t," ")}}function Ct(a,n){if(1&a&&(e.TgZ(0,"ul",63),e.YNc(1,Tt,2,1,"li",59),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.ActionString)}}function Zt(a,n){if(1&a&&(e.TgZ(0,"span",64),e._UZ(1,"i",65),e.qZA()),2&a){const t=e.oxw().$implicit;e.hYB("title","Delivery : ",t.DeliveryState," \nPayment : ",t.PaymentState,"")}}const xt=function(a,n){return{"over-due-today":a,"over-due":n}};function bt(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.YNc(5,mt,3,4,"td",1),e.TgZ(6,"td")(7,"span"),e._uU(8),e.qZA(),e._uU(9),e.qZA(),e.TgZ(10,"td",60)(11,"span"),e._uU(12),e.qZA(),e._uU(13),e.qZA(),e.TgZ(14,"td"),e.YNc(15,ft,2,1,"span",1),e.YNc(16,Ct,2,1,"ul",61),e.qZA(),e.TgZ(17,"td"),e.YNc(18,Zt,2,2,"span",62),e.qZA()()),2&a){const t=n.$implicit,i=n.index,o=e.oxw(3);e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Oqu(t.Number),e.xp6(1),e.Q6J("ngIf",o.getTypeID()!=o.channelType.ShopeeV2),e.xp6(3),e.hij("",t.ChannelStatus," - "),e.xp6(1),e.Oqu(t.ChannelStatusDescription),e.xp6(1),e.Q6J("ngClass",e.WLB(12,xt,(null==t?null:t.Action)==o.actionPreviewOrder.Update,(null==t?null:t.Action)==o.actionPreviewOrder.New))("matTooltip",91==t.POSStatus||"Conflict"==t.POSStatusDescription?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),e.xp6(2),e.hij("",t.POSStatus," - "),e.xp6(1),e.hij("",t.POSStatusDescription," "),e.xp6(2),e.Q6J("ngIf",1==t.ActionString.length),e.xp6(1),e.Q6J("ngIf",t.ActionString.length>1),e.xp6(2),e.Q6J("ngIf",99!=t.ChannelStatus&&99!=t.POSStatus)}}function vt(a,n){if(1&a&&(e.ynx(0),e.YNc(1,bt,19,15,"tr",59),e.BQk()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.displayedPreviewData)}}function St(a,n){1&a&&(e.TgZ(0,"tr",66)(1,"td",67)(2,"div",68),e._UZ(3,"i",69),e.qZA(),e.TgZ(4,"h4",70),e._uU(5,"There is no order to processed"),e.qZA()()())}function wt(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"div",41)(1,"div",42)(2,"div",43)(3,"ul",44)(4,"li",45)(5,"button",46),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.ALL))}),e._uU(6),e.qZA()(),e.TgZ(7,"li",45)(8,"button",47),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.SYNC))}),e._uU(9),e.qZA()(),e.TgZ(10,"li",45)(11,"button",48),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.WRONG))}),e._uU(12),e.qZA()(),e.TgZ(13,"li",45)(14,"button",49),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.UNSYNC))}),e._uU(15),e.qZA()()()(),e.TgZ(16,"table",50)(17,"thead",51)(18,"tr"),e._UZ(19,"th",52),e.TgZ(20,"th",53),e._uU(21,"Number"),e.qZA(),e.YNc(22,_t,2,1,"th",54),e.TgZ(23,"th",55),e._uU(24,"Channel Status"),e.qZA(),e.TgZ(25,"th",55),e._uU(26,"POS Status"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Action"),e.qZA(),e._UZ(29,"th",52),e.qZA()(),e.TgZ(30,"tbody"),e.YNc(31,vt,2,1,"ng-container",56),e.YNc(32,St,6,0,"ng-template",null,57,e.W1O),e.qZA()()()()}if(2&a){const t=e.MAs(33),i=e.oxw();e.xp6(5),e.Q6J("ngClass","all"==i.pillStatus?"btn-secondary text-white":"btn-outline-dark"),e.xp6(1),e.hij("All (",i.allData,")"),e.xp6(2),e.Q6J("ngClass","sync"==i.pillStatus?"btn-success":"btn-outline-success"),e.xp6(1),e.hij("Existing (",i.syncData,")"),e.xp6(2),e.Q6J("ngClass","wrong"==i.pillStatus?"btn-warning text-white":"btn-outline-warning"),e.xp6(1),e.hij("Wrong Status (",i.wrongData,")"),e.xp6(2),e.Q6J("ngClass","unsync"==i.pillStatus?"btn-danger":"btn-outline-danger"),e.xp6(1),e.hij("Missing (",i.unsyncData,")"),e.xp6(7),e.Q6J("ngIf",i.getTypeID()!=i.channelType.ShopeeV2),e.xp6(9),e.Q6J("ngIf",i.displayedPreviewData.length>0)("ngIfElse",t)}}function Dt(a,n){1&a&&e._uU(0,"Finish")}const yt=function(a){return{"over-due":a}};function At(a,n){if(1&a&&(e.TgZ(0,"tr",73)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA()()),2&a){const t=n.$implicit,i=n.index;e.Q6J("ngClass",e.VKq(5,yt,t.Exception)),e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Status),e.xp6(2),e.Oqu(t.Exception)}}function Nt(a,n){if(1&a&&(e.ynx(0),e.YNc(1,At,9,7,"tr",72),e.BQk()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.downloadData)}}function Pt(a,n){1&a&&(e.TgZ(0,"tr",66)(1,"td",67)(2,"div",68),e._UZ(3,"i",69),e.qZA(),e.TgZ(4,"h4",70),e._uU(5,"There is no order to processed"),e.qZA()()())}function Ot(a,n){if(1&a&&(e.TgZ(0,"div",41)(1,"div",42)(2,"table",50)(3,"thead",51)(4,"tr"),e._UZ(5,"th",52),e.TgZ(6,"th"),e._uU(7,"Order Number"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Status"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Exception"),e.qZA()()(),e.TgZ(12,"tbody"),e.YNc(13,Nt,2,1,"ng-container",56),e.YNc(14,Pt,6,0,"ng-template",null,71,e.W1O),e.qZA()()()()),2&a){const t=e.MAs(15),i=e.oxw();e.xp6(13),e.Q6J("ngIf",(null==i.downloadData?null:i.downloadData.length)>0)("ngIfElse",t)}}function It(a,n){1&a&&e._UZ(0,"i",74)}function Mt(a,n){1&a&&e._UZ(0,"i",75)}function qt(a,n){1&a&&e._UZ(0,"i",76)}var T=(()=>{return(a=T||(T={})).ALL="all",a.SYNC="sync",a.WRONG="wrong",a.UNSYNC="unsync",T;var a})();class B{constructor(n,t,i,o,d,I){this.http=n,this.toastr=t,this.datePipe=i,this.url=o,this.productService=d,this.orderService=I,this.pageTitle="Download to POS",this.pillStatus="all",this.displayedPreviewData=[],this.previewData=[],this.channelType=r.x,this.previewStatus=T,this.currentState="filter",this.wrongData=0,this.unsyncData=0,this.syncData=0,this.allData=0,this.actionPreviewOrder=O}ngOnInit(){this.initPageLoader(),this.url.queryParams.subscribe(n=>{this.channelID=n.ChannelID,this.startDate=new Date(n.Date),this.endDate=new Date(n.Date)})}initPageLoader(){this.productService.loader().subscribe(n=>{this.channelOptions=n.Options.Channel})}onDownload(n){this.http.post("/api/Orders/Download",{ID:this.channelID,From:this.startDate,To:this.endDate,ListPreview:this.downloadedPreviewData}).subscribe(i=>{this.downloadData=i.Body,this.onStepperNext(n)})}onPreview(n){this.validateDatePreview()&&this.http.post("/api/Orders/Preview",{ID:this.channelID,From:this.startDate,To:this.endDate}).subscribe(i=>{0!=i.length?(this.previewData=i,this.groupingPreviewData(),this.filterPreviewData(T.ALL),this.initLengthStatusData(),this.onStepperNext(n)):this.toastrEmptyPreview()})}toastrEmptyPreview(){this.toastr.info("There is no orders from "+this.datePipe.transform(this.startDate,"dd MMM yyyy")+" to "+this.datePipe.transform(this.endDate,"dd MMM yyyy")+" !","No Orders!")}validateDatePreview(){let n=!0;return h.g.getDaysDiff(this.startDate,this.endDate)>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Failed"),n=!1),n}setPageTitle(n){this.pageTitle=`\n ${n} (${this.getDateTitle()})\n `}getDateTitle(){const n=h.g.formatTitleFromDate(new Date(this.startDate),new Date(this.endDate)),t=this.datePipe.transform(this.startDate,n);return`${null==n?"":t+"-"} ${this.datePipe.transform(this.endDate,"dd MMM yyyy")}`}onNew(n){this.channelID=null,this.startDate=null,this.endDate=null,this.pageTitle="Download to POS",n.reset()}groupingPreviewData(){let n=this.filterDataByStatus(T.UNSYNC),t=this.filterDataByStatus(T.WRONG);this.downloadedPreviewData=[...n,...t]}filterDataByStatus(n){let t=[];switch(n){case T.ALL:t=this.previewData;break;case T.SYNC:t=this.previewData.filter(i=>i.Action==O.DoNothing);break;case T.WRONG:t=this.previewData.filter(i=>i.Action==O.Update);break;case T.UNSYNC:t=this.previewData.filter(i=>i.Action==O.New)}return t}filterPreviewData(n){this.pillStatus=n,this.displayedPreviewData=this.filterDataByStatus(n)}initLengthStatusData(){this.wrongData=this.filterDataByStatus(T.WRONG).length,this.allData=this.previewData.length,this.syncData=this.filterDataByStatus(T.SYNC).length,this.unsyncData=this.filterDataByStatus(T.UNSYNC).length}getTypeID(){var n=this.channelOptions.find(t=>t.ID==this.channelID)?.TypeID;return n??0}onStepperChange(n){this.currentState=n.selectedStep.state}onStepperNext(n){n.selected.completed=!0,n.next()}onNext(n){switch(this.currentState){case"filter":this.onPreview(n);break;case"preview":this.onDownload(n)}}stepChange(n){switch(n?.selectedStep?.state){case"filter":this.pageTitle="Download To POS",this.resetPreviewData();break;case"preview":let t=this.productService.findChannelById(this.channelID,this.channelOptions);this.setPageTitle(`Preview ${t?.Name}`);break;case"finish":this.setPageTitle("Download")}}resetPreviewData(){this.displayedPreviewData=[],this.previewData=[],this.initLengthStatusData()}checkDisabledNextFilter(){let n=!h.g.isValidDate(this.startDate)||!h.g.isValidDate(this.endDate),t=h.g.IsEmpty(this.channelID);return n||t}exportOrders(){let n={ID:this.channelID,From:this.startDate,To:this.endDate};const t=`Orders ${this.getDateTitle()}`;this.orderService.exportOrders(n,t).subscribe()}}B.\u0275fac=function(n){return new(n||B)(e.Y36(S.O),e.Y36(j._W),e.Y36(g.uU),e.Y36(m.gz),e.Y36(st.M),e.Y36(C))},B.\u0275cmp=e.Xpm({type:B,selectors:[["app-download"]],features:[e._Bn([{provide:lt.gx,useValue:{displayDefaultIndicatorType:!1}}])],decls:47,vars:20,consts:[[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],[4,"ngIf"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2","type","button",3,"disabled","click",4,"ngIf"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2",3,"click",4,"ngIf"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["labelPosition","bottom","linear","",1,"w-100","stepper-download",3,"ngClass","selectionChange"],["stepper",""],["state","filter",3,"editable","completed"],["matStepLabel",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-6"],[1,"text-muted"],["appendTo","body",3,"clearable","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-1rem"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModel","ngModelChange","click"],["matEndDate","","placeholder","End date",3,"ngModel","ngModelChange","click"],["picker",""],["state","preview",3,"editable","completed"],["class","row pt-2",4,"ngIf"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","border-end-0",3,"disabled","click"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-end",2,"min-width","85px !important"],[1,"dropdown-item"],[3,"click"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"disabled","click"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"nav","nav-pills"],[1,"nav-item","mx-3"],[1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["EMPTY",""],["width","15%"],[4,"ngFor","ngForOf"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],["EMPTY_DOWNLOAD",""],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"fa-solid","fa-filter"],[1,"fa-solid","fa-file"],[1,"fa-sharp","fa-solid","fa-flag"]],template:function(n,t){if(1&n){const i=e.EpF();e.TgZ(0,"mainpanel",0)(1,"actions"),e.YNc(2,pt,12,1,"ng-container",1),e.YNc(3,ct,2,1,"button",2),e.YNc(4,dt,3,0,"button",3),e.qZA(),e.TgZ(5,"content")(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7)(10,"mat-stepper",8,9),e.NdJ("selectionChange",function(d){return t.stepChange(d)})("selectionChange",function(d){return t.onStepperChange(d)}),e.TgZ(12,"mat-step",10),e.YNc(13,ut,1,0,"ng-template",11),e.TgZ(14,"div",12)(15,"div",6)(16,"div",5)(17,"div",13)(18,"h5"),e._uU(19,"Select a Channel"),e.qZA(),e.TgZ(20,"p",14),e._uU(21,"Select Channel want to download order"),e.qZA()(),e.TgZ(22,"div",13)(23,"ng-select",15),e.NdJ("ngModelChange",function(d){return t.channelID=d}),e.YNc(24,gt,3,3,"ng-option",16),e.qZA()()(),e.TgZ(25,"div",17)(26,"div",13)(27,"h5"),e._uU(28,"Date Range"),e.qZA(),e.TgZ(29,"p",14),e._uU(30,"Select transaction date of the channel you want to download (Max 2 Weeks)"),e.qZA()(),e.TgZ(31,"div",13)(32,"div",6)(33,"mat-date-range-input",18)(34,"input",19),e.NdJ("ngModelChange",function(d){return t.startDate=d})("click",function(){e.CHM(i);const d=e.MAs(37);return e.KtG(d.open())}),e.qZA(),e.TgZ(35,"input",20),e.NdJ("ngModelChange",function(d){return t.endDate=d})("click",function(){e.CHM(i);const d=e.MAs(37);return e.KtG(d.open())}),e.qZA()(),e._UZ(36,"mat-date-range-picker",null,21),e.qZA()()()()()(),e.TgZ(38,"mat-step",22),e.YNc(39,ht,1,0,"ng-template",11),e.YNc(40,wt,34,11,"div",23),e.qZA(),e.TgZ(41,"mat-step",24),e.YNc(42,Dt,1,0,"ng-template",11),e.YNc(43,Ot,16,2,"div",23),e.qZA(),e.YNc(44,It,1,0,"ng-template",25),e.YNc(45,Mt,1,0,"ng-template",26),e.YNc(46,qt,1,0,"ng-template",27),e.qZA()()()()()()()}if(2&n){const i=e.MAs(11),o=e.MAs(37);e.Q6J("headerTitle",t.pageTitle)("description",t.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("ngIf","preview"==t.currentState),e.xp6(1),e.Q6J("ngIf","filter"==t.currentState),e.xp6(1),e.Q6J("ngIf","finish"==t.currentState),e.xp6(6),e.s9C("ngClass","last-edited-step-"+i.selectedIndex),e.xp6(2),e.Q6J("editable","finish"!=t.currentState)("completed",!1),e.xp6(11),e.Q6J("clearable",!1)("ngModel",t.channelID),e.xp6(1),e.Q6J("ngForOf",t.channelOptions),e.xp6(9),e.Q6J("rangePicker",o),e.xp6(1),e.Q6J("ngModel",t.startDate),e.xp6(1),e.Q6J("ngModel",t.endDate),e.xp6(3),e.Q6J("editable","finish"!=t.currentState)("completed",!1),e.xp6(2),e.Q6J("ngIf","preview"==t.currentState),e.xp6(3),e.Q6J("ngIf","finish"==t.currentState)}},dependencies:[g.mk,g.sg,g.O5,c.Fj,c.JJ,c.On,w.p,f.w9,f.jq,z.wx,z.zY,z.By,z._g,$.C0,$.VY,$.Vq,$.z9,W.gM,g.uU],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container mat-step-header>div.mat-step-label{padding-top:8px} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}"]});var D=u(8063);const Ut=[{path:"",component:y,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:E,canActivate:[D.a],data:{title:"New Order"}},{path:"detail",component:Q,canActivate:[D.a],data:{title:"Orders detail"}},{path:"ready_to_ship",component:Y,canActivate:[D.a],data:{title:"Ready To Ship"}},{path:"Shipped",component:G,canActivate:[D.a],data:{title:"Shipped"}},{path:"Delivered",component:F,canActivate:[D.a],data:{title:"Delivered"}},{path:"All",component:H,canActivate:[D.a],data:{title:"All Order"}},{path:"Cancelled",component:R,canActivate:[D.a],data:{title:"Cancelled"}},{path:"Download",component:B,canActivate:[D.a],data:{title:"Download"}}]}];class U{}U.\u0275fac=function(n){return new(n||U)},U.\u0275mod=e.oAB({type:U}),U.\u0275inj=e.cJS({imports:[g.ez,m.Bz.forChild(Ut)]});var kt=u(8739),Lt=u(3238),Jt=u(1108),Et=u(4385);class k{}k.\u0275fac=function(n){return new(n||k)},k.\u0275mod=e.oAB({type:k}),k.\u0275inj=e.cJS({providers:[C,A],imports:[g.ez,c.u5,U,M.Z,w.R,kt.TU,m.Bz,f.A0,z.FA,Lt.XK,N.n,$.T5,W.AV,Jt.f,_.p9,p.Is,Et.LD,P.s]})},6082:(X,K,u)=>{u.d(K,{M:()=>b});var g=u(8505),m=u(262),L=u(2843),e=u(1889),M=u(4650),y=u(1318),h=u(7185);class b{constructor(r,l){this.httpService=r,this.toastrService=l}loader(r=e.g.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:r})}LoadInPOS(r=e.g.GuidEMpty){return this.httpService.post("/api/product/LoadInPOS",{ID:r})}filterChannelByTypeId(r,l){return r.filter(s=>-1!==l.findIndex(p=>s.TypeID==p))}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(r){return this.httpService.post("/api/product/TotalProductLive",{ID:r})}clearCacheChannel(r){return this.httpService.post("/api/Channel/ClearCacheChannel",{ID:r})}uploadSingleProduct(r,l){return this.httpService.post("api/product/UploadMultipleChannel",{Channel:l,Products:r}).pipe((0,g.b)(p=>{this.showToastrSuccessUploadSingle(p,r[0])}),(0,m.K)(p=>(this.showToastErrorUploadSingle(p,r[0]),(0,L._)(()=>new Error(p)))))}uploadMultipleProduct(r,l){return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",{Channel:l,Products:r}).pipe((0,g.b)(p=>{this.showToastrUploadMultiple(p.Message)}),(0,m.K)(p=>(this.showToastrUploadMultiple(p.error?.Message),(0,L._)(()=>new Error(p)))))}uploadNotInChannel(r,l){return this.httpService.post("/api/product/UploadProductNotInChannelToChannel",{Products:r,Channel:l}).pipe((0,g.b)(p=>{this.showToastrUploadMultiple(p)}),(0,m.K)(p=>(this.showToastrUploadMultiple(p.error?.Message),(0,L._)(()=>new Error(p)))))}scanSingle(r,l){return this.httpService.post("/api/product/ScanSingle",{ID:r,SKU:l})}scanNotInChannel(r){return this.httpService.post("/api/product/ScanNotinChannel",{ID:r})}findAllSoldInChannel(r){return this.httpService.post("/api/product/GetSoldInChannel",r)}scanAll(r,l,s,p=!1){return this.httpService.post("/api/product/ScanOptimized",{ID:r,ScanFull:l,UpdatedProduct:s,Async:p})}scanCompareToPos(r){return this.httpService.post("/api/product/CompareMarketplaceToPOS",r)}getVariantCodesProduct(r){return r.Variants.map(s=>s.Code)}downloadMultipleProduct(r){let l=r.map(s=>({ChannelItemID:s.ChannelItemID,ChannelID:s.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",l).pipe((0,g.b)(s=>{this.toastrService.success(`${s.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(r){return this.httpService.post("/api/product/DownloadProductFromChannel",{ChannelItemID:r.ChannelItemID,ChannelID:r.ChannelID}).pipe((0,g.b)(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(r=[]){let l=[];return r.forEach(s=>{s.Variants.forEach(p=>{l=[...l,p.Code]})}),l}filterUnselectedChannel(r,l){let p,s=[];if(r.forEach(c=>{s=[...s,...c.Channel]}),s&&0!=s.length){let c=[];p=l.filter(_=>(c=s.filter(v=>v.ChannelID==_.ID),c.length!==r.length))}else p=l;return p}findChannelById(r,l){return l.find(s=>s.ID==r)}sortChannel(r=[]){return r.sort((l,s)=>l.TypeID<s.TypeID?1:l.TypeID===s.TypeID?0:-1)}hasSelection(r=[]){return this.selectedProduct(r).length>0}selectedProduct(r=[]){return r.filter(l=>l.selected)}hasSelectionVariant(r){return this.selectedVariantProduct(r).length>0}selectedVariantProduct(r){let l=[];return r.forEach(s=>{l=[...l,...null!=s.Variants?s.Variants.filter(p=>p.selected):""]}),l}getChannelProduct(r){const l=r.Variants;let s=[];for(let p of l)if(null!=p.Channel)for(let c of p.Channel)0==s.filter(_=>_.ChannelID==c.ChannelID).length&&s.push(c);return this.sortChannel(s)}successToastrScanAllProduct(r,l,s){if(s){const p=r?.NotInPOS?.Product?r?.NotInPOS?.Product:0,c=r?.InChannel?.Product?r?.InChannel?.Product:0;this.toastrService.success(`\n ${p+c} found in ${l.Name} </br>\n (${c} In POS + ${p} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}else this.toastrService.success(`${r.InChannel?r.InChannel.Product:0} product updates in ${l.Name} </br> \n since ${r.LastUpdate}`,"Scan Complete!",{enableHtml:!0})}checkProductHasScanButton(r,l){let s;return r.map(p=>(p.Channel=this.getChannelProduct(p),s=this.filterUnselectedChannel([p],l),p.hasScan=s.length>0,p))}checkProductHasUploadBtn(r,l){let s;return r.map(p=>(p.Channel=this.getChannelProduct(p),s=this.filterUnselectedChannel([p],l),p.hasUpload=s.length>0,p))}showToastrUploadMultiple(r=[]){let l=[],s=[];if(r.forEach(p=>{"string"==typeof p?.Response?s=[...s,`<li>${p.Response}</li>`]:(p?.Response?.Success.forEach(c=>{l=[...l,`<li>Product ${c} was <b>successfully</b> uploaded to ${p.Name}</li>`]}),p?.Response.Fail.forEach(c=>{s=[...s,`<li>${c} in <b>${p.Name}</b></li>`]}))}),s.length>0&&l.length>0){const p=[...l,...s];this.toastrService.warning(this.concatMessage(p),"Warning!",{enableHtml:!0})}else l.length>0&&0==s.length?this.toastrService.success(this.concatMessage(l),"Success",{enableHtml:!0}):this.toastrService.error(this.concatMessage(s),"Error",{enableHtml:!0})}concatMessage(r=[]){let l="";return r.forEach(s=>{l+=s}),`<ol>${l}</ol>`}showToastrSuccessUploadSingle(r,l){let s=r.filter(_=>0==_.Status),p=r.filter(_=>1==_.Status),c=this.generateToastrMessage(s,p,l);this.toastrService.success(c.message,"Success",{enableHtml:!0})}showToastErrorUploadSingle(r,l){let s=r?.error?.Message.filter(_=>0==_.Status),p=r?.error?.Message.filter(_=>1==_.Status),c=this.generateToastrMessage(s,p,l);"WARNING"==c.status?this.toastrService.warning(c.message,"Warning!",{enableHtml:!0}):this.toastrService.error(c.message,`Error - ${r.status}`,{enableHtml:!0})}generateToastrMessage(r,l,s){let c,p="";return 0==r.length&&l.length>0?(c="SUCCESS",p=this.createSuccessResponse(l,s)):r.length>0&&0==l.length?(c="ERROR",p=this.createErrResponse(r,s)):(c="WARNING",p=`${this.createSuccessResponse(l,s)} ${this.createErrResponse(r,s)}`),p=`<ol>${p}</ol>`,{status:c,message:p}}createErrResponse(r,l){let s="";return r.forEach((p,c)=>{s+=`<li><b>${p.Response}</b> for ${l.Name} in ${p.Name}</li>`}),s}createSuccessResponse(r,l){let s="";return r.forEach((p,c)=>{s+=`<li>Product ${l.Name} was <b>successfully</b> uploaded to ${p.Name}</li>`}),s}getHostName(){if(e.g.IsEmpty(this.hostName)){const r=localStorage.getItem("Authorization");this.hostName=JSON.parse(r)?.Host}return this.hostName}}b.\u0275fac=function(r){return new(r||b)(M.LFG(y.O),M.LFG(h._W))},b.\u0275prov=M.Yz7({token:b,factory:b.\u0275fac,providedIn:"root"})}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[395],{9395:(Pn,w,s)=>{s.r(w),s.d(w,{InventoryModule:()=>m});var p=s(6895),n=s(4650),I=s(284),F=s(2937);class d{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}}d.\u0275fac=function(t){return new(t||d)},d.\u0275cmp=n.Xpm({type:d,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,e){1&t&&(n.TgZ(0,"nav",0)(1,"div",1)(2,"div"),n._UZ(3,"nav-tab",2),n.qZA()()(),n._UZ(4,"router-outlet")),2&t&&(n.xp6(3),n.Q6J("Tabs",e.inventoryTabs))},dependencies:[I.lC,F.e]});var A=s(8231),L=s(6304),b=s(8505),C=s(9300),h=s(1889),f=s(8705),N=s(1318),T=s(7185),S=s(5412),D=s(9425),J=s(6082),Z=s(7481),P=s(6114);function O(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"button",17),n.NdJ("click",function(){n.CHM(e);const i=n.oxw(3);return n.KtG(i.openScanDialog())}),n._UZ(1,"i",18),n._uU(2," Scan Channel "),n.qZA()}}function E(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"button",19),n.NdJ("click",function(){n.CHM(e);const i=n.oxw().ngIf,l=n.oxw(2);return n.KtG(l.onUpdateItems(i))}),n._UZ(1,"i",20),n._uU(2," Update "),n.qZA()}}function Y(a,t){if(1&a&&(n.TgZ(0,"actions")(1,"div",14)(2,"div"),n.YNc(3,O,3,0,"button",15),n.YNc(4,E,3,0,"button",16),n.qZA()()()),2&a){const e=t.ngIf,o=n.oxw(2);n.xp6(3),n.Q6J("ngIf",!o.productService.hasSelectionVariant(e)),n.xp6(1),n.Q6J("ngIf",o.productService.hasSelectionVariant(e))}}function $(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"app-table",21),n.NdJ("onToggle",function(i){n.CHM(e);const l=n.oxw(2);return n.KtG(l.onShowDifferenceStock(i))})("onSubmit",function(i){const r=n.CHM(e).ngIf,c=n.oxw(2);return n.KtG(c.updateStockByVariant(i,r))}),n.qZA()}if(2&a){const e=t.ngIf,o=n.oxw(2);n.Q6J("data",e)("channel",o.channelOptions)("showProductToggle",!0)("filter",o.searchFilter)}}function R(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"span",22),n.NdJ("click",function(){n.CHM(e);const i=n.oxw(2);return n.KtG(i.getRowCount())}),n.TgZ(1,"i",23),n._uU(2,"?"),n.qZA()()}}function q(a,t){if(1&a&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&a){const e=t.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,e))}}function H(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"a",24),n.NdJ("click",function(){n.CHM(e);const i=n.oxw(2);return n.KtG(i.nextPage())}),n._UZ(1,"i",25),n._uU(2," Next"),n.qZA()}}function V(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"a",26),n.NdJ("click",function(){n.CHM(e);const i=n.oxw(2);return n.KtG(i.getAllData())}),n._UZ(1,"i",27),n._uU(2," Last"),n.qZA()}}function B(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(i){n.CHM(e);const l=n.oxw();return n.KtG(l.onSearch(i))}),n.YNc(1,Y,5,2,"actions",2),n.ALo(2,"async"),n.TgZ(3,"content")(4,"div",3)(5,"div",4)(6,"div",5),n.YNc(7,$,1,4,"app-table",6),n.ALo(8,"async"),n.ynx(9),n.TgZ(10,"div",7)(11,"div",8)(12,"div",9),n._uU(13),n.ALo(14,"number"),n.ALo(15,"async"),n.YNc(16,R,3,0,"span",10),n.YNc(17,q,3,3,"span",2),n.ALo(18,"async"),n._uU(19),n.qZA()(),n.TgZ(20,"div",11),n.YNc(21,H,3,0,"a",12),n.YNc(22,V,3,0,"a",13),n.qZA()(),n.BQk(),n.qZA()()()()()}if(2&a){const e=n.oxw();let o;n.Q6J("pageData",e.pageData)("hideSearchBox",!1)("hideSearchDropdown",!0)("textButton","Search"),n.xp6(1),n.Q6J("ngIf",n.lcZ(2,12,e.paginationService.data$)),n.xp6(6),n.Q6J("ngIf",n.lcZ(8,14,e.paginationService.data$)),n.xp6(6),n.hij(" Showing 1 - ",n.lcZ(14,16,null==(o=n.lcZ(15,18,e.paginationService.data$))?null:o.length)," of "),n.xp6(3),n.Q6J("ngIf",e.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(18,20,!e.paginationService.hideCount&&e.allDataCount$)),n.xp6(2),n.hij(" records ~ ",e.paginationService.footerPageNumber," Page "),n.xp6(2),n.Q6J("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}class x{constructor(t,e,o,i,l){this.http=t,this.toastr=e,this.dialog=o,this.paginationService=i,this.productService=l,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe((0,b.b)(t=>{this.channelOptions=t.Options.Channel,t.Filter={PageNumber:t.Filter.PageNumber,filterModel:f.v.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.paginationService.resetToFirstPage(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}updateStock(t,e){let o=this.productService.selectedVariantProduct(t);if(o.length>0){let l=o.map(c=>({ID:c.ID,Code:c.Code,Inventory:c.Inventory})),r={ListChannelID:e.filter(c=>c.selected).map(c=>c.ID),List:l};this.http.post("/api/Inventory/UpdateChannel",r).subscribe(c=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+r.List.length+" variants in "+r.ListChannelID.length+" channels","Success")})}}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(A.j,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,C.h)(o=>h.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct),this.initPageLoader()}this.searchFilter.ChannelID=h.g.GuidEMpty})}updateStockByVariant(t,e){let o={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",o).subscribe(i=>{let l=this.productService.findChannelById(o.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+l.Name+" to "+o.NewQuantity,"Success")})}onShowDifferenceStock(t){this.searchFilter.filterModel=t?f.v.DIFFERENCE:f.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}onUpdateItems(t){const e=this.productService.selectedVariantProduct(t);this.dialog.open(L.j,{data:{selectedItems:e,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe((0,C.h)(o=>h.g.IsNotEmpty(o))).subscribe(o=>{this.updateStock(t,o)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,{text:this.searchFilter.text})}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}}x.\u0275fac=function(t){return new(t||x)(n.Y36(N.O),n.Y36(T._W),n.Y36(S.uw),n.Y36(D.b),n.Y36(J.M))},x.\u0275cmp=n.Xpm({type:x,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(t,e){1&t&&(n.YNc(0,B,23,22,"mainpanel",0),n.ALo(1,"async")),2&t&&n.Q6J("ngIf",n.lcZ(1,1,e.loader$))},dependencies:[p.O5,Z.p,P.a,p.Ov,p.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});var G=s(7945),K=s(9608),j=s(6779),_=s(4006),W=s(6401),M=s(8796);function z(a,t){if(1&a&&(n.TgZ(0,"ng-option",4),n._UZ(1,"img",5),n._uU(2),n.qZA()),2&a){const e=t.$implicit;n.Q6J("value",e.ID),n.xp6(1),n.Q6J("src",e.Img,n.LSH),n.xp6(1),n.hij("",e.Name," ")}}class v{constructor(t,e){this.data=t,this.dialogRef=e,this.channelOptions=t.channelOptions,this.channel=t.selectedChannel?t.selectedChannel:new K.$}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new j.O,this.modalConfig.title="Choose Channel",this.modalConfig.customWidth="350px",this.modalConfig.okText="SAVE"}onSelectChannel(t){let e=this.channelOptions.find(o=>o.ID==t);this.channel=e,this.channel&&(this.channel.logo=h.g.getChannelLogoByTypeId(e.TypeID))}onClose(){this.dialogRef.close()}onOk(){this.dialogRef.close(this.channel)}}v.\u0275fac=function(t){return new(t||v)(n.Y36(S.WI),n.Y36(S.so))},v.\u0275cmp=n.Xpm({type:v,selectors:[["app-modal-choose-channel"]],decls:4,vars:4,consts:[[3,"config","onClose","onCancel","onOk"],["content",""],["appendTo","body",3,"clearable","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(t,e){1&t&&(n.TgZ(0,"modal-material",0),n.NdJ("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onOk()}),n.TgZ(1,"div",1)(2,"ng-select",2),n.NdJ("ngModelChange",function(i){return e.onSelectChannel(i)}),n.YNc(3,z,3,3,"ng-option",3),n.qZA()()()),2&t&&(n.Q6J("config",e.modalConfig),n.xp6(2),n.Q6J("clearable",!1)("ngModel",e.channel.ID),n.xp6(1),n.Q6J("ngForOf",e.channelOptions))},dependencies:[p.sg,_.JJ,_.On,W.M,M.w9,M.jq]});var X=s(1739);class u{constructor(t){this.toastrService=t}showToastrUpdateInventory(t,e){const o=t.length>0,i=e.length>0;if(!i&&o&&this.toastrService.success(`${this.generateSuccessMessage(t.length)}`,"Success",{enableHtml:!0}),i&&o){const l=`<li>${this.generateSuccessMessage(t.length)}</li>`,r=this.generateErrorMessage(e);this.toastrService.warning(`<ol>${l} ${r}</ol>`,"Warning",{enableHtml:!0})}if(i&&!o){const l=`<ol>${this.generateErrorMessage(e)}</ol>`;this.toastrService.error(l,"Error",{enableHtml:!0})}}generateSuccessMessage(t){return`<span class="fw-bold">Successfully</span> updated ${t} variants in 1 channels`}generateErrorMessage(t=[]){let e="";return t.forEach((o,i)=>{e+=`<li><span class="fw-bold">Error</span> Updating stock for [${o.Name}] - <b>${o.Message}</b></li>`}),e}}u.\u0275fac=function(t){return new(t||u)(n.LFG(T._W))},u.\u0275prov=n.Yz7({token:u,factory:u.\u0275fac});var k=s(455),U=s(266);function nn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"button",36),n.NdJ("click",function(){n.CHM(e);const i=n.oxw(2).ngIf,l=n.oxw();return n.KtG(l.openScanDialog(i))}),n._UZ(1,"i",37),n._uU(2," Scan Channel "),n.qZA()}}function en(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"button",38),n.NdJ("click",function(){n.CHM(e);const i=n.oxw().ngIf,l=n.oxw(2);return n.KtG(l.updateStock(i))}),n._UZ(1,"i",39),n._uU(2," Update"),n.qZA()}}function tn(a,t){if(1&a&&(n.TgZ(0,"div"),n.YNc(1,nn,3,0,"button",34),n.YNc(2,en,3,0,"button",35),n.qZA()),2&a){const e=t.ngIf,o=n.oxw(2);n.xp6(1),n.Q6J("ngIf",!o.productService.hasSelectionVariant(e)),n.xp6(1),n.Q6J("ngIf",o.productService.hasSelectionVariant(e))}}function an(a,t){1&a&&(n.TgZ(0,"div",40)(1,"span"),n._uU(2," showing only different stock, please press next to populate more data "),n.qZA()())}function on(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"th")(1,"input",41),n.NdJ("ngModelChange",function(i){n.CHM(e);const l=n.oxw(2);return n.KtG(l.checkboxState=i)})("ngModelChange",function(){const l=n.CHM(e).ngIf,r=n.oxw(2);return n.KtG(r.onCheckboxStateChange(l))}),n.qZA()()}if(2&a){const e=n.oxw(2);n.xp6(1),n.Q6J("ngModel",e.checkboxState)}}function ln(a,t){1&a&&(n.ynx(0),n.TgZ(1,"th",42),n._uU(2," Reserved "),n.qZA(),n.BQk())}function sn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"input",66),n.NdJ("ngModelChange",function(i){n.CHM(e);const l=n.oxw(3).$implicit;return n.KtG(l.selected=i)})("ngModelChange",function(){n.CHM(e);const i=n.oxw(3).$implicit,l=n.oxw(2);return n.KtG(l.onCheckboxStateProduct(i))}),n.qZA()}if(2&a){const e=n.oxw(3).$implicit;n.Q6J("ngModel",e.selected)}}function rn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"img",67),n.NdJ("click",function(i){n.CHM(e);const l=n.oxw(3).$implicit,r=n.oxw(2);return n.KtG(r.onZoomImage(i,null==l?null:l.ImageUrl))}),n.qZA()}if(2&a){const e=n.oxw(3).$implicit;n.s9C("src",null==e?null:e.ThumbnailUrl,n.LSH)}}function cn(a,t){1&a&&n._UZ(0,"img",68)}function pn(a,t){if(1&a&&(n.ynx(0),n.TgZ(1,"td",57)(2,"div",58),n.YNc(3,sn,1,1,"input",59),n.YNc(4,rn,1,1,"img",60),n.YNc(5,cn,1,0,"ng-template",null,61,n.W1O),n.qZA()(),n.TgZ(7,"td",62)(8,"span",63),n._uU(9),n.qZA(),n._UZ(10,"br"),n.TgZ(11,"div",64),n._UZ(12,"i",65),n.TgZ(13,"small"),n._uU(14),n.qZA()()(),n.BQk()),2&a){const e=n.MAs(6),o=n.oxw().$implicit,i=n.oxw().$implicit;n.xp6(1),n.Q6J("rowSpan",null==i?null:i.Variants.length),n.xp6(2),n.Q6J("ngIf",(null==o?null:o.Inventory)>=0||i.Variants.length>1),n.xp6(1),n.Q6J("ngIf",null==i?null:i.ThumbnailUrl)("ngIfElse",e),n.xp6(3),n.Q6J("rowSpan",null==i?null:i.Variants.length),n.xp6(2),n.Oqu(null==i?null:i.Name),n.xp6(5),n.hij("(",null==i?null:i.Category,")")}}function hn(a,t){if(1&a){const e=n.EpF();n.ynx(0),n.TgZ(1,"input",41),n.NdJ("ngModelChange",function(i){n.CHM(e);const l=n.oxw(2).$implicit;return n.KtG(l.selected=i)}),n.qZA(),n.BQk()}if(2&a){const e=n.oxw(2).$implicit;n.xp6(1),n.Q6J("ngModel",e.selected)}}function _n(a,t){if(1&a&&(n.ynx(0),n.YNc(1,hn,2,1,"ng-container",3),n.BQk()),2&a){const e=n.oxw().$implicit;n.xp6(1),n.Q6J("ngIf",(null==e?null:e.Inventory)<=1e5)}}function un(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"input",41),n.NdJ("ngModelChange",function(i){n.CHM(e);const l=n.oxw(2).$implicit;return n.KtG(l.selected=i)}),n.qZA()}if(2&a){const e=n.oxw(2).$implicit;n.Q6J("ngModel",e.selected)}}function gn(a,t){if(1&a&&n.YNc(0,un,1,1,"input",69),2&a){const e=n.oxw().$implicit;n.Q6J("ngIf",(null==e?null:e.Inventory)>=0)}}function mn(a,t){if(1&a&&(n.TgZ(0,"span")(1,"span",70),n._uU(2),n.ALo(3,"number"),n.qZA(),n._uU(4," => "),n.TgZ(5,"span",71),n._uU(6),n.ALo(7,"number"),n.qZA()()),2&a){const e=n.oxw().$implicit;n.xp6(2),n.hij(" ",n.lcZ(3,2,null==e||null==e.I?null:e.I.Available),""),n.xp6(4),n.Oqu(n.lcZ(7,4,null==e?null:e.Inventory))}}function dn(a,t){if(1&a&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&a){const e=n.oxw().$implicit;n.xp6(1),n.hij(" ",n.lcZ(2,1,null==e?null:e.Inventory)," ")}}const Cn=function(a){return{"bg-gradient-warning":a}};function fn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"td",72)(1,"span",73),n.NdJ("click",function(){n.CHM(e);const i=n.oxw().$implicit,l=n.oxw(),r=l.$implicit,c=l.ngForOf,Jn=n.oxw(2);return n.KtG(Jn.openTableDialog(r,i,c))}),n._uU(2),n.ALo(3,"number"),n.qZA()()}if(2&a){const e=n.oxw().$implicit;n.Q6J("ngClass",n.VKq(4,Cn,(null==e?null:e.Inventory)!=(null==e||null==e.Channel[0]?null:e.Channel[0].Inventory))),n.xp6(2),n.hij(" ",n.lcZ(3,2,null==e||null==e.Channel[0]?null:e.Channel[0].Inventory)," ")}}function xn(a,t){if(1&a&&(n.ynx(0),n.TgZ(1,"span",75),n._uU(2),n.ALo(3,"number"),n.qZA(),n.BQk()),2&a){const e=n.oxw(2).$implicit;n.xp6(2),n.hij(" (",n.lcZ(3,1,null==e||null==e.Channel[0]?null:e.Channel[0].InventoryReserved),") ")}}function vn(a,t){1&a&&n._uU(0," - ")}function yn(a,t){if(1&a&&(n.ynx(0),n.TgZ(1,"td",44),n.YNc(2,xn,4,3,"ng-container",50),n.YNc(3,vn,1,0,"ng-template",null,74,n.W1O),n.qZA(),n.BQk()),2&a){const e=n.MAs(4),o=n.oxw().$implicit;n.xp6(2),n.Q6J("ngIf",null==o||null==o.Channel[0]?null:o.Channel[0].InventoryReserved)("ngIfElse",e)}}function Sn(a,t){1&a&&(n.ynx(0),n._uU(1," - "),n.BQk())}function In(a,t){if(1&a&&(n.TgZ(0,"span",76),n.ALo(1,"date"),n._uU(2),n.ALo(3,"date"),n.qZA()),2&a){const e=n.oxw().$implicit;n.Q6J("matTooltip",n.xi3(1,2,null==e||null==e.Channel[0]?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),n.xp6(2),n.hij(" ",n.xi3(3,5,null==e||null==e.Channel[0]?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function bn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"tr"),n.YNc(1,pn,15,7,"ng-container",3),n.TgZ(2,"td",43),n._uU(3),n.qZA(),n.TgZ(4,"td",44)(5,"div",45)(6,"span"),n._uU(7),n.qZA(),n.TgZ(8,"span",46)(9,"a",47),n._UZ(10,"i",48),n.qZA()()()(),n.TgZ(11,"td",49),n.YNc(12,_n,2,1,"ng-container",50),n.YNc(13,gn,1,1,"ng-template",null,51,n.W1O),n.qZA(),n.TgZ(15,"td",44),n.YNc(16,mn,8,6,"span",3),n.YNc(17,dn,3,3,"span",3),n.qZA(),n.YNc(18,fn,4,6,"td",52),n.YNc(19,yn,5,2,"ng-container",3),n.TgZ(20,"td",26),n.YNc(21,Sn,2,0,"ng-container",50),n.YNc(22,In,4,8,"ng-template",null,53,n.W1O),n.qZA(),n.TgZ(24,"td")(25,"div",12)(26,"div",54)(27,"a",47),n._UZ(28,"i",48),n.qZA(),n._uU(29," \xa0\xa0 "),n.TgZ(30,"span",55),n.NdJ("click",function(){const l=n.CHM(e).$implicit,r=n.oxw(3);return n.KtG(r.refreshInventory(null==l||null==l.Channel[0]?null:l.Channel[0].ChannelItemID,null==l||null==l.Channel[0]?null:l.Channel[0].ChannelVariationID,null==l||null==l.Channel[0]?null:l.Channel[0].ChannelID,null==l?null:l.ID))}),n._UZ(31,"i",56),n.qZA()()()()()}if(2&a){const e=t.$implicit,o=t.index,i=n.MAs(14),l=n.MAs(23),r=n.oxw(3);n.xp6(1),n.Q6J("ngIf",0==o),n.xp6(2),n.Oqu(null==e?null:e.Model),n.xp6(4),n.Oqu(null==e?null:e.Code),n.xp6(2),n.Q6J("href","https://"+r.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==e?null:e.ID),n.LSH),n.xp6(3),n.Q6J("ngIf",1==(null==e?null:e.Channel[0].TypeID))("ngIfElse",i),n.xp6(4),n.Q6J("ngIf",(null==e?null:e.Inventory)!=(null==e||null==e.I?null:e.I.Available)),n.xp6(1),n.Q6J("ngIf",(null==e?null:e.Inventory)==(null==e||null==e.I?null:e.I.Available)),n.xp6(1),n.Q6J("ngIf",null==e?null:e.Channel),n.xp6(1),n.Q6J("ngIf",r.isShowReservedColumn),n.xp6(2),n.Q6J("ngIf",(null==e||null==e.Channel[0]?null:e.Channel[0].LastInventorySync)==r.minDate)("ngIfElse",l),n.xp6(6),n.Q6J("href",null==e||null==e.Channel[0]?null:e.Channel[0].Url,n.LSH)}}function Tn(a,t){if(1&a&&(n.TgZ(0,"tbody"),n.YNc(1,bn,32,13,"tr",28),n.qZA()),2&a){const e=t.$implicit;n.xp6(1),n.Q6J("ngForOf",e.Variants)}}function Zn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"span",77),n.NdJ("click",function(){n.CHM(e);const i=n.oxw(2);return n.KtG(i.getRowCount())}),n.TgZ(1,"i",78),n._uU(2,"?"),n.qZA()()}}function Mn(a,t){if(1&a&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&a){const e=t.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,null==e?null:e.Total))}}function wn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"a",82),n.NdJ("click",function(){n.CHM(e);const i=n.oxw(3);return n.KtG(i.onNextPage())}),n._UZ(1,"i",83),n._uU(2," Next"),n.qZA()}}function Fn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"a",84),n.NdJ("click",function(){n.CHM(e);const i=n.oxw(3);return n.KtG(i.onLastPage())}),n._UZ(1,"i",85),n._uU(2," Last"),n.qZA()}}function An(a,t){if(1&a&&(n.TgZ(0,"div",79),n.YNc(1,wn,3,0,"a",80),n.YNc(2,Fn,3,0,"a",81),n.qZA()),2&a){const e=n.oxw(2);n.xp6(1),n.Q6J("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}function Nn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(i){n.CHM(e);const l=n.oxw();return n.KtG(l.onSearch(i))}),n.TgZ(1,"actions")(2,"div",2),n.YNc(3,tn,3,2,"div",3),n.ALo(4,"async"),n.qZA()(),n.TgZ(5,"filters")(6,"div",2)(7,"div",4)(8,"div")(9,"label",5),n._uU(10,"PageNumber"),n.qZA(),n.TgZ(11,"input",6),n.NdJ("ngModelChange",function(i){n.CHM(e);const l=n.oxw();return n.KtG(l.searchFilter.PageNumber=i)}),n.qZA()(),n.TgZ(12,"div")(13,"label",7),n._uU(14,"Page Size"),n.qZA(),n.TgZ(15,"input",8),n.NdJ("ngModelChange",function(i){n.CHM(e);const l=n.oxw();return n.KtG(l.searchFilter.RowCount=i)}),n.qZA()(),n.TgZ(16,"div")(17,"h6"),n._uU(18,"Quantity From - To"),n.qZA(),n.TgZ(19,"input",9),n.NdJ("ngModelChange",function(i){n.CHM(e);const l=n.oxw();return n.KtG(l.searchFilter.QuantityFrom=i)}),n.qZA(),n._uU(20," - "),n.TgZ(21,"input",10),n.NdJ("ngModelChange",function(i){n.CHM(e);const l=n.oxw();return n.KtG(l.searchFilter.QuantityTo=i)}),n.qZA()()()()(),n.TgZ(22,"content")(23,"div",11)(24,"div",12)(25,"div",13),n.YNc(26,an,3,0,"div",14),n.TgZ(27,"table",15)(28,"thead",16)(29,"tr")(30,"th",17),n._uU(31,"Product "),n._UZ(32,"br"),n.TgZ(33,"mat-slide-toggle",18),n.NdJ("toggleChange",function(){n.CHM(e);const i=n.oxw();return i.showDifferenceStock=!i.showDifferenceStock,n.KtG(i.onShowDifferenceStock())}),n.TgZ(34,"small",19),n._uU(35,"FILTER DIFFERENT INVENTORY"),n.qZA()()(),n.TgZ(36,"th",20),n._uU(37,"Variant"),n.qZA(),n.TgZ(38,"th",21),n._uU(39,"SKU"),n.qZA(),n.YNc(40,on,2,1,"th",3),n.ALo(41,"async"),n.TgZ(42,"th",22),n._uU(43,"POS"),n.qZA(),n.TgZ(44,"th",23)(45,"div",24),n.NdJ("click",function(){n.CHM(e);const i=n.oxw();return n.KtG(i.onChangeChannel())}),n._UZ(46,"img",25),n._uU(47),n.qZA()(),n.YNc(48,ln,3,0,"ng-container",3),n.TgZ(49,"th",26),n._uU(50,"Last Sync"),n.qZA(),n._UZ(51,"th",27),n.qZA()(),n.YNc(52,Tn,2,1,"tbody",28),n.ALo(53,"async"),n.qZA(),n.TgZ(54,"div",29)(55,"div",30)(56,"div",31),n._uU(57),n.ALo(58,"number"),n.ALo(59,"async"),n.YNc(60,Zn,3,0,"span",32),n.YNc(61,Mn,3,3,"span",3),n.ALo(62,"async"),n._uU(63),n.qZA()(),n.YNc(64,An,3,2,"div",33),n.ALo(65,"async"),n.qZA()()()()()()}if(2&a){const e=n.oxw();let o,i;n.Q6J("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),n.xp6(3),n.Q6J("ngIf",n.lcZ(4,20,e.paginationService.data$)),n.xp6(8),n.Q6J("ngModel",e.searchFilter.PageNumber),n.xp6(4),n.Q6J("ngModel",e.searchFilter.RowCount),n.xp6(4),n.Q6J("ngModel",e.searchFilter.QuantityFrom),n.xp6(2),n.Q6J("ngModel",e.searchFilter.QuantityTo),n.xp6(5),n.Q6J("ngIf",3==(null==e.searchFilter?null:e.searchFilter.filterModel)),n.xp6(14),n.Q6J("ngIf",n.lcZ(41,22,e.paginationService.data$)),n.xp6(5),n.Q6J("matTooltip","Change "+(null==e.selectedChannel?null:e.selectedChannel.Name)),n.xp6(1),n.Q6J("src",e.selectedChannel.logo,n.LSH),n.xp6(1),n.hij(" ",null!=e.selectedChannel&&e.selectedChannel.Name?null==e.selectedChannel?null:e.selectedChannel.Name:"Choose Channel ..."," "),n.xp6(1),n.Q6J("ngIf",e.isShowReservedColumn),n.xp6(4),n.Q6J("ngForOf",n.lcZ(53,24,e.products$)),n.xp6(5),n.hij(" Showing 1 - ",n.lcZ(58,26,null==(o=n.lcZ(59,28,e.paginationService.data$))?null:o.length)," of "),n.xp6(3),n.Q6J("ngIf",e.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(62,30,!e.paginationService.hideCount&&e.rowCount$)),n.xp6(2),n.hij(" records ~ ",e.paginationService.footerPageNumber," Page "),n.xp6(1),n.Q6J("ngIf",(null==(i=n.lcZ(65,32,e.paginationService.data$))?null:i.length)>0)}}class y{constructor(t,e,o,i,l,r,c){this.http=t,this.toastr=e,this.dialog=o,this.paginationService=i,this.productService=l,this.biggerPictureService=r,this.inventoryService=c,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=h.g.MinDate,this.isShowReservedColumn=!0,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]},this.hostName=l.getHostName()}ngOnInit(){this.initPageLoader(),this.products$=this.paginationService.data$.pipe((0,b.b)(t=>{this.checkShowReservedColumn(t)}))}checkShowReservedColumn(t){let o,e=0;t.forEach(i=>{o=i.Variants.find(l=>h.g.IsNotEmpty(l?.Channel[0]?.InventoryReserved)),o&&(e+=1)}),this.isShowReservedColumn=e>0}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe((0,b.b)(t=>{this.channelOptions=t.Options.Channel,this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.initSelectedChannel(),this.paginationService.resetToFirstPage(this.searchFilter),t.Filter.IsMarketplaceAppActive||this.toastr.warning("Automatic inventory sync disabled.\n Please enable Dealpos X Marketplace Apps integration in POS Configuration","Warning")}))}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(t=>t.ID==this.searchFilter.ChannelID),this.selectedChannel&&(this.selectedChannel.logo=h.g.getChannelLogoByTypeId(this.selectedChannel.TypeID))}onChangeChannel(){this.dialog.open(v,{data:{channelOptions:this.channelOptions,selectedChannel:this.selectedChannel}}).afterClosed().pipe((0,C.h)(t=>h.g.IsNotEmpty(t))).subscribe(t=>{this.selectedChannel=t,this.onFilterChannel(t.ID)})}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}onFilterChannel(t){this.searchFilter.ChannelID=t,this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter)}updateStock(t){const e=this.productService.selectedVariantProduct(t);if(e.length>0){let o=e.map(l=>({ID:l.ID,Code:l.Code,Inventory:l.Inventory}));this.http.post("/api/Inventory/UpdateChannel",{ListChannelID:[this.searchFilter.ChannelID],List:o}).subscribe(l=>{this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter),this.checkboxState=!1,this.handlingUpdateStock(l)})}}handlingUpdateStock(t){t[0]?.StatusProduct?this.inventoryService.showToastrUpdateInventory(t[0].StatusProduct.Success_list,t[0].StatusProduct.Fail_list):this.toastr.error(t[0]?.Exception,"Error")}openScanDialog(t){const e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=h.g.GuidEMpty,this.dialog.open(A.j,{data:{filter:e,channelOptions:t.Options.Channel},width:"600px"}).afterClosed().pipe((0,C.h)(i=>h.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scannALl(t)})}scannALl(t){const e=this.productService.findChannelById(this.searchFilter.ChannelID,t.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(o=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.searchFilter.ScanFull=!1,this.initPageLoader(),this.toastr.success("Successfully scanned from "+e?.Name,"Success"))})}refreshInventory(t,e,o,i){this.http.post("/api/Inventory/RefreshInventoryChannel",{ChannelItemID:t,ChannelVariationID:e,ChannelID:o,VariantID:i}).subscribe(r=>{this.toastr.success("Successfully updated","Success"),this.paginationService.resetToFirstPage(this.searchFilter)})}onCheckboxStateProduct(t){t.Variants=t.Variants.map(e=>(e.Inventory>=0&&(e.selected=t.selected),e))}onCheckboxStateChange(t){t=t.map(e=>(e.Variants=e.Variants.map(o=>(o.selected=this.checkboxState,o)),e))}openTableDialog(t,e,o){this.dialog.open(G.k,{data:{Name:t.Name,Variant:e,ChannelID:e?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:t.ChannelItemID}}).afterClosed().pipe((0,C.h)(l=>h.g.IsNotEmpty(l))).subscribe(l=>{this.updateItemAfterDialog(l,o)})}updateItemAfterDialog(t,e){let o={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};const i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.http.post("/api/Inventory/UpdateQuantityByItem",o).subscribe(l=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+i?.Name+" to "+o.NewQuantity,"Success")})}onShowDifferenceStock(){this.searchFilter.filterModel=this.showDifferenceStock?f.v.DIFFERENCE:f.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}getRowCount(){const t={ChannelID:this.searchFilter.ChannelID,PageNumber:1,text:this.searchFilter.text};this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`${this.rowCountApi}`,t)}onLastPage(){this.http.post(`${this.rowCountApi}`,{ChannelID:this.searchFilter.ChannelID,PageNumber:1}).subscribe({next:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e.Total)}})}onZoomImage(t,e){this.biggerPictureService.openBiggerPicture(t,e)}ngOnDestroy(){this.paginationService.destroy()}}y.\u0275fac=function(t){return new(t||y)(n.Y36(N.O),n.Y36(T._W),n.Y36(S.uw),n.Y36(D.b),n.Y36(J.M),n.Y36(X.k),n.Y36(u))},y.\u0275cmp=n.Xpm({type:y,selectors:[["app-single-channel-comparison"]],decls:2,vars:3,consts:[["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],["type","number","name","QuantityFrom",1,"w-25","me-2",3,"ngModel","ngModelChange"],["type","number","name","QuantityTo",1,"w-25","ms-2",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],[1,"fw-bold"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","100px"],["matTooltipPosition","above",1,"d-inline-block","text-truncate","mt-3","cursor-pointer",2,"max-width","114px",3,"matTooltip","click"],[2,"width","16px",3,"src"],[1,"text-center"],[2,"width","4%"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModel","ngModelChange"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-start"],[1,"text-end"],[1,"d-flex","align-items-center","justify-content-end"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"align-middle"],[4,"ngIf","ngIfElse"],["OTHER_CHANNEL",""],["class","text-end",3,"ngClass",4,"ngIf"],["SYNCDATE",""],[1,"col-12","ps-0","d-flex","justify-content-between"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["title","Allocated"],["title","Inventory below minimum inventory"],[1,"text-end",3,"ngClass"],[1,"cursor",3,"click"],["EMPTY_RESERVED",""],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(t,e){1&t&&(n.YNc(0,Nn,66,34,"mainpanel",0),n.ALo(1,"async")),2&t&&n.Q6J("ngIf",n.lcZ(1,1,e.loader$))},dependencies:[p.mk,p.sg,p.O5,_.Fj,_.wV,_.Wl,_.JJ,_.On,k.Rr,Z.p,U.gM,p.Ov,p.JJ,p.uU],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});var Q=s(8063);const Dn=[{path:"",component:d,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:x,canActivate:[Q.a],data:{title:"Inventory Comparison"}},{path:"bychannel",component:y,canActivate:[Q.a],data:{title:"Inventory Comparison"}}]}];class g{}g.\u0275fac=function(t){return new(t||g)},g.\u0275mod=n.oAB({type:g}),g.\u0275inj=n.cJS({imports:[p.ez,I.Bz.forChild(Dn)]});class m{}m.\u0275fac=function(t){return new(t||m)},m.\u0275mod=n.oAB({type:m}),m.\u0275inj=n.cJS({providers:[u],imports:[p.ez,g,I.Bz,F.Z,_.u5,M.A0,k.rP,Z.R,P.a,U.AV]})}}]);
|