marketplacepos 5.33.2 → 5.33.3

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.
Files changed (56) hide show
  1. package/Marketplace/{chunk-6KOGCWHI.js → chunk-2VO6Y2JY.js} +1 -1
  2. package/Marketplace/{chunk-5E7C2QHD.js → chunk-3CPUV2QC.js} +1 -1
  3. package/Marketplace/{chunk-NNQLRLNB.js → chunk-3LR4RLA6.js} +1 -1
  4. package/Marketplace/chunk-47DMD3UG.js +1 -0
  5. package/Marketplace/{chunk-PNVJ62RQ.js → chunk-4LJDBY23.js} +1 -1
  6. package/Marketplace/{chunk-EFXWMCWY.js → chunk-4YUEEL6J.js} +1 -1
  7. package/Marketplace/{chunk-LJHZMQZD.js → chunk-5VEPYUMQ.js} +1 -1
  8. package/Marketplace/{chunk-CCP4DXYC.js → chunk-6IB7KPKP.js} +1 -1
  9. package/Marketplace/{chunk-IQ7CJD65.js → chunk-6KZX5MHR.js} +1 -1
  10. package/Marketplace/{chunk-IHNDCM7T.js → chunk-6LYDZOAJ.js} +1 -1
  11. package/Marketplace/{chunk-P2A5AQIO.js → chunk-6XIV3N7A.js} +1 -1
  12. package/Marketplace/{chunk-KK2Q5Q3P.js → chunk-7OCXVLNV.js} +1 -1
  13. package/Marketplace/{chunk-DLNXH2FE.js → chunk-7XUSMPAA.js} +1 -1
  14. package/Marketplace/chunk-AK46UZMO.js +1 -0
  15. package/Marketplace/{chunk-IP23AD3S.js → chunk-AZZYTM37.js} +2 -2
  16. package/Marketplace/{chunk-TQ3TU52C.js → chunk-B3Z4Y52F.js} +1 -1
  17. package/Marketplace/{chunk-3HXO7QJQ.js → chunk-BOFVAVH7.js} +1 -1
  18. package/Marketplace/{chunk-OJFTMV7L.js → chunk-DDDZ234H.js} +1 -1
  19. package/Marketplace/{chunk-4PQYITAE.js → chunk-DODVHXOC.js} +1 -1
  20. package/Marketplace/{chunk-QCC5ZGGN.js → chunk-DVSSWF73.js} +1 -1
  21. package/Marketplace/{chunk-YND7NT66.js → chunk-EPWKKU4V.js} +1 -1
  22. package/Marketplace/{chunk-5SZSDHJB.js → chunk-H4I5VT2Y.js} +1 -1
  23. package/Marketplace/{chunk-P5YVNHLJ.js → chunk-HHQCIJX5.js} +1 -1
  24. package/Marketplace/{chunk-HTVQCXM6.js → chunk-HUC4WXNS.js} +1 -1
  25. package/Marketplace/{chunk-FYULKTNX.js → chunk-JA3YPIEI.js} +1 -1
  26. package/Marketplace/{chunk-2TVASR35.js → chunk-JYRTO7M3.js} +1 -1
  27. package/Marketplace/{chunk-5BGZXXFA.js → chunk-KVFB6XBL.js} +1 -1
  28. package/Marketplace/{chunk-XFTUE2ST.js → chunk-LUY3WZJE.js} +1 -1
  29. package/Marketplace/{chunk-2JQFQKKW.js → chunk-M4DRRFIZ.js} +1 -1
  30. package/Marketplace/{chunk-IOOEU477.js → chunk-MCYU6XCA.js} +1 -1
  31. package/Marketplace/{chunk-OXWBU2ND.js → chunk-MEZONX3R.js} +1 -1
  32. package/Marketplace/{chunk-MP6SRJJL.js → chunk-MM4YTMYD.js} +1 -1
  33. package/Marketplace/{chunk-MBG6WYMK.js → chunk-MRTUGQ56.js} +1 -1
  34. package/Marketplace/{chunk-QNKFNW7X.js → chunk-OSA3WANL.js} +1 -1
  35. package/Marketplace/{chunk-LB6JFX4H.js → chunk-P5UOWO2P.js} +1 -1
  36. package/Marketplace/{chunk-I7Q2FSST.js → chunk-RCYZRSCU.js} +1 -1
  37. package/Marketplace/{chunk-DDHEMRO7.js → chunk-S2Z3ZGU7.js} +1 -1
  38. package/Marketplace/{chunk-BNKFF5IF.js → chunk-TBNR5NJS.js} +1 -1
  39. package/Marketplace/{chunk-IUKHWWDP.js → chunk-URCHO4IV.js} +1 -1
  40. package/Marketplace/{chunk-5UYLNF4H.js → chunk-VEJSM4DU.js} +2 -2
  41. package/Marketplace/{chunk-T4PET7OJ.js → chunk-VHMDV7XB.js} +1 -1
  42. package/Marketplace/{chunk-JNIA6WXE.js → chunk-VRXNR7QX.js} +1 -1
  43. package/Marketplace/{chunk-Q7ZZFOG6.js → chunk-WQOM5LDR.js} +1 -1
  44. package/Marketplace/{chunk-N3TTJVBG.js → chunk-X2TVRY2Z.js} +1 -1
  45. package/Marketplace/chunk-X2UZ26AC.js +1 -0
  46. package/Marketplace/chunk-YAVQ35MM.js +1 -0
  47. package/Marketplace/{chunk-QK46N4UF.js → chunk-YVN2BEFU.js} +1 -1
  48. package/Marketplace/{chunk-P64M4BHW.js → chunk-ZQWAIH5X.js} +1 -1
  49. package/Marketplace/{chunk-BR3BSUIQ.js → chunk-ZYY6USWK.js} +1 -1
  50. package/Marketplace/index.html +2 -2
  51. package/Marketplace/{main-LUFJVAF3.js → main-ZOCGLFVD.js} +1 -1
  52. package/package.json +1 -1
  53. package/Marketplace/chunk-64G3XLI6.js +0 -1
  54. package/Marketplace/chunk-FPVVWF7G.js +0 -1
  55. package/Marketplace/chunk-G2DFMLE4.js +0 -1
  56. package/Marketplace/chunk-KDCBSUBB.js +0 -1
@@ -1 +1 @@
1
- import"./chunk-TQ3TU52C.js";import{a as Ue}from"./chunk-4PQYITAE.js";import{a as Ke}from"./chunk-6U6JR5K6.js";import"./chunk-7LZ5ZSXM.js";import{a as E}from"./chunk-BVIRHZTZ.js";import"./chunk-P5YVNHLJ.js";import"./chunk-IHNDCM7T.js";import{b as Je}from"./chunk-JXTGH22T.js";import{c as Ze}from"./chunk-ADRVUMMW.js";import{b as Ye}from"./chunk-BQ7NR3ET.js";import{c as qe}from"./chunk-UMNGKENU.js";import{a as f}from"./chunk-2TVASR35.js";import{g as Qe}from"./chunk-HCDKYABV.js";import{a as Be,d as Re,e as $}from"./chunk-CCXKODFV.js";import{a as Pe,c as ze,j as Le}from"./chunk-QK46N4UF.js";import"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{a as Ve,g as He,j as J,n as Ge}from"./chunk-BO4PPSB5.js";import{t as We,u as F}from"./chunk-HUUFOAKH.js";import{F as je,K as Z,u as $e,x as Fe}from"./chunk-E5GGIVK7.js";import{h as Ee,m as De,y as U,z as ke}from"./chunk-BSN7ZAXG.js";import{e as Ne,f as Ae}from"./chunk-64G3XLI6.js";import{n as Te,p as Oe,q as we,r as Y}from"./chunk-OVEJFFL6.js";import{$b as O,Bb as me,Cd as M,Da as I,Ea as T,Eb as h,G as ee,Gb as d,Gc as q,Hb as pe,Hc as Q,Ib as z,Jc as R,Kb as G,M as te,Na as re,Nb as ge,Pa as P,R as ie,Sb as l,Tb as s,Ub as b,Uc as be,Va as le,Vb as N,Wb as A,Yb as he,bc as c,bd as V,ca as ne,f as H,gb as se,gd as Ce,hc as fe,ic as ue,jb as r,jc as _e,ka as u,kb as g,ld as ve,mc as L,nc as p,oc as y,pa as x,pc as w,qb as de,sb as ce,sd as ye,ta as v,ua as _,ud as Me,v as k,va as ae,vc as B,vd as Se,yd as xe,za as oe,zd as Ie}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var j=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[E.dashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/Order",Roles:[E.orderView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[E.orderView]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[E.channelView]},{Icon:"fas fa-file-alt",Title:"Dev Logs",Url:"/menu/log",Roles:[]},{Icon:"fas fa-bell",Title:"Notification",Url:"/menu/notification",Badge:!0,Roles:[]},{Icon:"fa-solid fa-wand-magic-sparkles",Title:"What`s New",Url:`https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete&v=${Pe.version}`,ExternalLink:!0,CustomColor:"#ff2323",Badge:!0,Roles:[]}]}get getMenu(){return this.menus}};var rt=0,Xe="mat-badge-content",W=new Set,lt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=v({type:e,selectors:[["ng-component"]],standalone:!0,features:[B],decls:0,vars:0,template:function(n,a){},styles:[".mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color);color:var(--mat-badge-text-color);font-family:var(--mat-badge-text-font);font-weight:var(--mat-badge-text-weight);border-radius:var(--mat-badge-container-shape)}.cdk-high-contrast-active .mat-badge-content{outline:solid 1px;border-radius:0}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color);color:var(--mat-badge-disabled-state-text-color)}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, unset);min-height:var(--mat-badge-small-size-container-size, unset);line-height:var(--mat-badge-legacy-small-size-container-size, var(--mat-badge-small-size-container-size));padding:var(--mat-badge-small-size-container-padding);font-size:var(--mat-badge-small-size-text-size);margin:var(--mat-badge-small-size-container-offset)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, unset);min-height:var(--mat-badge-container-size, unset);line-height:var(--mat-badge-legacy-container-size, var(--mat-badge-container-size));padding:var(--mat-badge-container-padding);font-size:var(--mat-badge-text-size);margin:var(--mat-badge-container-offset)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, unset);min-height:var(--mat-badge-large-size-container-size, unset);line-height:var(--mat-badge-legacy-large-size-container-size, var(--mat-badge-large-size-container-size));padding:var(--mat-badge-large-size-container-padding);font-size:var(--mat-badge-large-size-text-size);margin:var(--mat-badge-large-size-container-offset)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset)}"],encapsulation:2,changeDetection:0});let t=e;return t})(),et=(()=>{let e=class e{get color(){return this._color}set color(i){this._setColor(i),this._color=i}get content(){return this._content}set content(i){this._updateRenderedContent(i)}get description(){return this._description}set description(i){this._updateDescription(i)}constructor(i,n,a,m,S){this._ngZone=i,this._elementRef=n,this._ariaDescriber=a,this._renderer=m,this._animationMode=S,this._color="primary",this.overlap=!0,this.position="above after",this.size="medium",this._id=rt++,this._isInitialized=!1,this._interactivityChecker=x(Fe),this._document=x(ve);let C=x(be);if(!W.has(C)){W.add(C);let X=Ce(lt,{environmentInjector:x(oe)});C.onDestroy(()=>{W.delete(C),W.size===0&&X.destroy()})}}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let i=this._renderer.createElement("span"),n="mat-badge-active";return i.setAttribute("id",`mat-badge-content-${this._id}`),i.setAttribute("aria-hidden","true"),i.classList.add(Xe),this._animationMode==="NoopAnimations"&&i.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(i),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{i.classList.add(n)})}):i.classList.add(n),i}_updateRenderedContent(i){let n=`${i??""}`.trim();this._isInitialized&&n&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=n),this._content=n}_updateDescription(i){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!i||this._isHostInteractive())&&this._removeInlineDescription(),this._description=i,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,i):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(i){let n=this._elementRef.nativeElement.classList;n.remove(`mat-badge-${this._color}`),i&&n.add(`mat-badge-${i}`)}_clearExistingBadges(){let i=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Xe}`);for(let n of Array.from(i))n!==this._badgeElement&&n.remove()}};e.\u0275fac=function(n){return new(n||e)(g(ce),g(re),g($e),g(de),g(le,8))},e.\u0275dir=ae({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(n,a){n&2&&z("mat-badge-overlap",a.overlap)("mat-badge-above",a.isAbove())("mat-badge-below",!a.isAbove())("mat-badge-before",!a.isAfter())("mat-badge-after",a.isAfter())("mat-badge-small",a.size==="small")("mat-badge-medium",a.size==="medium")("mat-badge-large",a.size==="large")("mat-badge-hidden",a.hidden||!a.content)("mat-badge-disabled",a.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",V],disabled:[2,"matBadgeDisabled","disabled",V],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",V]},standalone:!0,features:[me]});let t=e;return t})(),tt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[je,Z,Z]});let t=e;return t})();function dt(t,e){if(t&1&&(N(0),l(1,"p",23),p(2),s(),A()),t&2){let o=c(3).$implicit;r(2),w(" ",o.Title," ")}}function ct(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(3).$implicit;r(),y(o.Title)}}function mt(t,e){if(t&1&&(l(0,"a",22),b(1,"i"),h(2,dt,3,1,"ng-container",20)(3,ct,2,1,"ng-template",null,1,R),s()),t&2){let o=L(4),i=c(2).$implicit;d("href",i.Url,se),r(),G(i.Icon),r(),d("ngIf",i.Badge)("ngIfElse",o)}}function pt(t,e){if(t&1&&(N(0),h(1,mt,5,5,"a",21),A()),t&2){let o=c().$implicit;r(),d("ngxPermissionsOnly",o.Roles)}}function gt(t,e){if(t&1&&(l(0,"p",23),p(1),s()),t&2){let o=c(4).$implicit;r(),w(" ",o.Title," ")}}function ht(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(4).$implicit;r(),y(o.Title)}}function ft(t,e){if(t&1&&(N(0),h(1,gt,2,1,"p",23),q(2,"async"),h(3,ht,2,1,"p"),A()),t&2){let o=c(4);r(),ge(Q(2,1,o.notifications$)!=0?1:3)}}function ut(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(3).$implicit;r(),y(o.Title)}}function _t(t,e){if(t&1&&(l(0,"a",25),b(1,"i"),h(2,ft,4,3,"ng-container",20)(3,ut,2,1,"ng-template",null,2,R),s()),t&2){let o=L(4),i=c(2).$implicit,n=c();d("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),r(),G(i.Icon),r(),d("ngIf",i.Badge)("ngIfElse",o)}}function bt(t,e){if(t&1&&h(0,_t,5,6,"a",24),t&2){let o=c().$implicit;d("ngxPermissionsOnly",o.Roles)}}function Ct(t,e){if(t&1&&(l(0,"li",19),h(1,pt,2,1,"ng-container",20)(2,bt,1,1,"ng-template",null,0,R),s()),t&2){let o=e.$implicit,i=L(3);r(),d("ngIf",o.ExternalLink)("ngIfElse",i)}}var it=(()=>{let e=class e{constructor(i,n,a,m){this.toggleSidebarService=i,this.notificationService=n,this.decodeTokenService=a,this.authService=m,this.Menu={},this.isCollapseSidebar=!1,this.token=a.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new j().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(k(i=>i.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(i){if(i){let n,a=i.split(" ");return a.length==1?n=a[0].substring(0,2):n=a.shift().charAt(0)+a.pop().charAt(0),n}}};e.\u0275fac=function(n){return new(n||e)(g(Ve),g(Ue),g(ze),g(Le))},e.\u0275cmp=v({type:e,selectors:[["app-menu"]],decls:23,vars:9,consts:[["DEFAULT_ROUTE",""],["NO_BADGE",""],["WITHOUT_BADGE",""],[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",4,"ngFor","ngForOf"],[1,"main-panel"],["routerLinkActive","active"],[4,"ngIf","ngIfElse"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(n,a){n&1&&(l(0,"div",3),q(1,"async"),l(2,"div",4)(3,"button",5),O("click",function(){return a.onCallapseSidebar()}),b(4,"i",6),s(),l(5,"div",7)(6,"div",8)(7,"a",9),p(8),s(),l(9,"div",10)(10,"div",11),p(11),s(),b(12,"div",12),l(13,"a",13),O("click",function(){return a.onLogout()}),b(14,"i",14),p(15,"\xA0 "),l(16,"span"),p(17," Log Out"),s()()()()(),l(18,"div",15)(19,"ul",16),h(20,Ct,4,2,"li",17),s()()(),l(21,"div",18),b(22,"router-outlet"),s()()),n&2&&(z("nav-open",Q(1,7,a.toggleState$)),r(2),d("ngClass",a.isCollapseSidebar?"collapses":""),r(2),d("ngClass",a.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),r(4),w(" ",a.storeName," "),r(3),w(" ",a.token==null?null:a.token.LID," "),r(9),d("ngForOf",a.Menu))},dependencies:[ye,Me,Se,Te,Oe,we,We,et,Ne,xe],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]});let t=e;return t})();var vt=[{path:"",component:it,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"dashboard",loadChildren:()=>import("./chunk-OXWBU2ND.js").then(t=>t.DashboardModule),canActivate:[f],data:{title:"Dashboard"}},{path:"products",loadChildren:()=>import("./chunk-IOOEU477.js").then(t=>t.ProductModule),canActivate:[f],data:{title:"Products"}},{path:"inventory",loadChildren:()=>import("./chunk-I7Q2FSST.js").then(t=>t.InventoryRoutingModule),canActivate:[f],data:{title:"Inventory"}},{path:"price",loadChildren:()=>import("./chunk-MBG6WYMK.js").then(t=>t.PriceRoutingModule),canActivate:[f],data:{title:"Price"}},{path:"Order",loadChildren:()=>import("./chunk-5UYLNF4H.js").then(t=>t.OrdersModule),canActivate:[f],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-T4PET7OJ.js").then(t=>t.ReportModule),canActivate:[f],data:{title:"Report"}},{path:"Logistic",loadChildren:()=>import("./chunk-3HXO7QJQ.js").then(t=>t.LogisticModule),canActivate:[f],data:{title:"Logistic"}},{path:"channel",loadChildren:()=>import("./chunk-IP23AD3S.js").then(t=>t.ChannelsModule),canActivate:[f],data:{title:"Marketplace"}},{path:"log",loadChildren:()=>import("./chunk-FPVVWF7G.js").then(t=>t.LogsModule),canActivate:[f],data:{title:"Orders"}},{path:"notification",loadChildren:()=>import("./chunk-BR3BSUIQ.js").then(t=>t.NotificationModule),canActivate:[f],data:{title:"Push Notification"}}]}],nt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[Y.forChild(vt),Y]});let t=e;return t})();var Mt=["selectId"];function St(t,e){if(t&1&&(l(0,"span",3),p(1),s()),t&2){let o=e.item,i=c();d("title",o[i.bindLabel]),r(),y(o[i.bindLabel])}}var at=(()=>{let e=class e{set items(i){this.ngSelectInfiniteScroll.data=i,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(i){this._selected=i,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new K,this.selectedChange=new P,this.selectedLabel=new P,this.onOpen=new P}onOpenSelect(){this.onOpen.emit()}onSelectChange(i){i?(this.selectedChange.emit(i[this.bindValue]),this.selectedLabel.emit(i[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=v({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(n,a){if(n&1&&fe(Mt,7),n&2){let m;ue(m=_e())&&(a.ngSelectElement=m.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},standalone:!0,features:[B],decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(n,a){if(n&1){let m=he();l(0,"ng-select",1,0),O("clear",function(){return I(m),T(a.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return I(m),T(a.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return I(m),T(a.onOpenSelect())})("change",function(C){return I(m),T(a.onSelectChange(C))}),h(2,St,2,2,"ng-template",2),s()}n&2&&(pe("width",a.width),d("appendTo",a.parent)("disabled",a.disabled)("virtualScroll",!0)("typeahead",a.ngSelectInfiniteScroll.input$)("items",a.ngSelectInfiniteScroll.bufferData)("bindLabel",a.bindLabel)("bindValue",a.bindValue)("placeholder",a.placeholder)("ngModel",a.selected)("clearable",a.clearable))},dependencies:[M,$,Re,Be,U,Ee,De]});let t=e;return t})(),K=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new H,this._destroy$=new H,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(te(200),ie(),k(e=>(e&&(e=e.toLowerCase()),this.filterData(e))),ee(e=>e!==void 0),ne(this._destroy$)).subscribe(e=>{this._dataBuffer=e.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(e){let o=-1,i;return this._data.filter(a=>(i=JSON.stringify(a).toLowerCase(),o=i.indexOf(e),o!==-1||e==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(e){this._data=e||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(e,o){if(Ke.IsNotEmpty(e)){let i=this._data.filter(n=>n[o].toString().toLowerCase().indexOf(e)!==-1);this._dataBuffer=i.slice(0,this._bufferSize)}}set bufferSize(e){this._bufferSize=e}onScrollToEnd(){this.fetchMore()}fetchMore(){let e=this._dataBuffer.length,o=this._data.slice(e,this._bufferSize+e);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(o)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var ot=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[M,U,He,qe,Ze,Qe,Ye,Je,F,J,at,$,ke]});let t=e;return t})();var _n=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({providers:[Ie],imports:[M,nt,Ge,F,ot,tt,Ae.forChild()]});let t=e;return t})();export{_n as MenuModule};
1
+ import"./chunk-B3Z4Y52F.js";import{a as Ue}from"./chunk-DODVHXOC.js";import{a as Ke}from"./chunk-6U6JR5K6.js";import"./chunk-7LZ5ZSXM.js";import{a as E}from"./chunk-BVIRHZTZ.js";import"./chunk-HHQCIJX5.js";import"./chunk-6LYDZOAJ.js";import{b as Je}from"./chunk-JXTGH22T.js";import{c as Ze}from"./chunk-ADRVUMMW.js";import{b as Ye}from"./chunk-BQ7NR3ET.js";import{c as qe}from"./chunk-UMNGKENU.js";import{a as f}from"./chunk-JYRTO7M3.js";import{g as Qe}from"./chunk-HCDKYABV.js";import{a as Be,d as Re,e as $}from"./chunk-CCXKODFV.js";import{a as Pe,c as ze,j as Le}from"./chunk-YVN2BEFU.js";import"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{a as Ve,g as He,j as J,n as Ge}from"./chunk-BO4PPSB5.js";import{t as We,u as F}from"./chunk-HUUFOAKH.js";import{F as je,K as Z,u as $e,x as Fe}from"./chunk-E5GGIVK7.js";import{h as Ee,m as De,y as U,z as ke}from"./chunk-BSN7ZAXG.js";import{e as Ne,f as Ae}from"./chunk-47DMD3UG.js";import{n as Te,p as Oe,q as we,r as Y}from"./chunk-OVEJFFL6.js";import{$b as O,Bb as me,Cd as M,Da as I,Ea as T,Eb as h,G as ee,Gb as d,Gc as q,Hb as pe,Hc as Q,Ib as z,Jc as R,Kb as G,M as te,Na as re,Nb as ge,Pa as P,R as ie,Sb as l,Tb as s,Ub as b,Uc as be,Va as le,Vb as N,Wb as A,Yb as he,bc as c,bd as V,ca as ne,f as H,gb as se,gd as Ce,hc as fe,ic as ue,jb as r,jc as _e,ka as u,kb as g,ld as ve,mc as L,nc as p,oc as y,pa as x,pc as w,qb as de,sb as ce,sd as ye,ta as v,ua as _,ud as Me,v as k,va as ae,vc as B,vd as Se,yd as xe,za as oe,zd as Ie}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var j=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[E.dashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/Order",Roles:[E.orderView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[E.orderView]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[E.channelView]},{Icon:"fas fa-file-alt",Title:"Dev Logs",Url:"/menu/log",Roles:[]},{Icon:"fas fa-bell",Title:"Notification",Url:"/menu/notification",Badge:!0,Roles:[]},{Icon:"fa-solid fa-wand-magic-sparkles",Title:"What`s New",Url:`https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete&v=${Pe.version}`,ExternalLink:!0,CustomColor:"#ff2323",Badge:!0,Roles:[]}]}get getMenu(){return this.menus}};var rt=0,Xe="mat-badge-content",W=new Set,lt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=v({type:e,selectors:[["ng-component"]],standalone:!0,features:[B],decls:0,vars:0,template:function(n,a){},styles:[".mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color);color:var(--mat-badge-text-color);font-family:var(--mat-badge-text-font);font-weight:var(--mat-badge-text-weight);border-radius:var(--mat-badge-container-shape)}.cdk-high-contrast-active .mat-badge-content{outline:solid 1px;border-radius:0}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color);color:var(--mat-badge-disabled-state-text-color)}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, unset);min-height:var(--mat-badge-small-size-container-size, unset);line-height:var(--mat-badge-legacy-small-size-container-size, var(--mat-badge-small-size-container-size));padding:var(--mat-badge-small-size-container-padding);font-size:var(--mat-badge-small-size-text-size);margin:var(--mat-badge-small-size-container-offset)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, unset);min-height:var(--mat-badge-container-size, unset);line-height:var(--mat-badge-legacy-container-size, var(--mat-badge-container-size));padding:var(--mat-badge-container-padding);font-size:var(--mat-badge-text-size);margin:var(--mat-badge-container-offset)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, unset);min-height:var(--mat-badge-large-size-container-size, unset);line-height:var(--mat-badge-legacy-large-size-container-size, var(--mat-badge-large-size-container-size));padding:var(--mat-badge-large-size-container-padding);font-size:var(--mat-badge-large-size-text-size);margin:var(--mat-badge-large-size-container-offset)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset)}"],encapsulation:2,changeDetection:0});let t=e;return t})(),et=(()=>{let e=class e{get color(){return this._color}set color(i){this._setColor(i),this._color=i}get content(){return this._content}set content(i){this._updateRenderedContent(i)}get description(){return this._description}set description(i){this._updateDescription(i)}constructor(i,n,a,m,S){this._ngZone=i,this._elementRef=n,this._ariaDescriber=a,this._renderer=m,this._animationMode=S,this._color="primary",this.overlap=!0,this.position="above after",this.size="medium",this._id=rt++,this._isInitialized=!1,this._interactivityChecker=x(Fe),this._document=x(ve);let C=x(be);if(!W.has(C)){W.add(C);let X=Ce(lt,{environmentInjector:x(oe)});C.onDestroy(()=>{W.delete(C),W.size===0&&X.destroy()})}}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let i=this._renderer.createElement("span"),n="mat-badge-active";return i.setAttribute("id",`mat-badge-content-${this._id}`),i.setAttribute("aria-hidden","true"),i.classList.add(Xe),this._animationMode==="NoopAnimations"&&i.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(i),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{i.classList.add(n)})}):i.classList.add(n),i}_updateRenderedContent(i){let n=`${i??""}`.trim();this._isInitialized&&n&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=n),this._content=n}_updateDescription(i){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!i||this._isHostInteractive())&&this._removeInlineDescription(),this._description=i,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,i):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(i){let n=this._elementRef.nativeElement.classList;n.remove(`mat-badge-${this._color}`),i&&n.add(`mat-badge-${i}`)}_clearExistingBadges(){let i=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Xe}`);for(let n of Array.from(i))n!==this._badgeElement&&n.remove()}};e.\u0275fac=function(n){return new(n||e)(g(ce),g(re),g($e),g(de),g(le,8))},e.\u0275dir=ae({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(n,a){n&2&&z("mat-badge-overlap",a.overlap)("mat-badge-above",a.isAbove())("mat-badge-below",!a.isAbove())("mat-badge-before",!a.isAfter())("mat-badge-after",a.isAfter())("mat-badge-small",a.size==="small")("mat-badge-medium",a.size==="medium")("mat-badge-large",a.size==="large")("mat-badge-hidden",a.hidden||!a.content)("mat-badge-disabled",a.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",V],disabled:[2,"matBadgeDisabled","disabled",V],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",V]},standalone:!0,features:[me]});let t=e;return t})(),tt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[je,Z,Z]});let t=e;return t})();function dt(t,e){if(t&1&&(N(0),l(1,"p",23),p(2),s(),A()),t&2){let o=c(3).$implicit;r(2),w(" ",o.Title," ")}}function ct(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(3).$implicit;r(),y(o.Title)}}function mt(t,e){if(t&1&&(l(0,"a",22),b(1,"i"),h(2,dt,3,1,"ng-container",20)(3,ct,2,1,"ng-template",null,1,R),s()),t&2){let o=L(4),i=c(2).$implicit;d("href",i.Url,se),r(),G(i.Icon),r(),d("ngIf",i.Badge)("ngIfElse",o)}}function pt(t,e){if(t&1&&(N(0),h(1,mt,5,5,"a",21),A()),t&2){let o=c().$implicit;r(),d("ngxPermissionsOnly",o.Roles)}}function gt(t,e){if(t&1&&(l(0,"p",23),p(1),s()),t&2){let o=c(4).$implicit;r(),w(" ",o.Title," ")}}function ht(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(4).$implicit;r(),y(o.Title)}}function ft(t,e){if(t&1&&(N(0),h(1,gt,2,1,"p",23),q(2,"async"),h(3,ht,2,1,"p"),A()),t&2){let o=c(4);r(),ge(Q(2,1,o.notifications$)!=0?1:3)}}function ut(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(3).$implicit;r(),y(o.Title)}}function _t(t,e){if(t&1&&(l(0,"a",25),b(1,"i"),h(2,ft,4,3,"ng-container",20)(3,ut,2,1,"ng-template",null,2,R),s()),t&2){let o=L(4),i=c(2).$implicit,n=c();d("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),r(),G(i.Icon),r(),d("ngIf",i.Badge)("ngIfElse",o)}}function bt(t,e){if(t&1&&h(0,_t,5,6,"a",24),t&2){let o=c().$implicit;d("ngxPermissionsOnly",o.Roles)}}function Ct(t,e){if(t&1&&(l(0,"li",19),h(1,pt,2,1,"ng-container",20)(2,bt,1,1,"ng-template",null,0,R),s()),t&2){let o=e.$implicit,i=L(3);r(),d("ngIf",o.ExternalLink)("ngIfElse",i)}}var it=(()=>{let e=class e{constructor(i,n,a,m){this.toggleSidebarService=i,this.notificationService=n,this.decodeTokenService=a,this.authService=m,this.Menu={},this.isCollapseSidebar=!1,this.token=a.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new j().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(k(i=>i.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(i){if(i){let n,a=i.split(" ");return a.length==1?n=a[0].substring(0,2):n=a.shift().charAt(0)+a.pop().charAt(0),n}}};e.\u0275fac=function(n){return new(n||e)(g(Ve),g(Ue),g(ze),g(Le))},e.\u0275cmp=v({type:e,selectors:[["app-menu"]],decls:23,vars:9,consts:[["DEFAULT_ROUTE",""],["NO_BADGE",""],["WITHOUT_BADGE",""],[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",4,"ngFor","ngForOf"],[1,"main-panel"],["routerLinkActive","active"],[4,"ngIf","ngIfElse"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(n,a){n&1&&(l(0,"div",3),q(1,"async"),l(2,"div",4)(3,"button",5),O("click",function(){return a.onCallapseSidebar()}),b(4,"i",6),s(),l(5,"div",7)(6,"div",8)(7,"a",9),p(8),s(),l(9,"div",10)(10,"div",11),p(11),s(),b(12,"div",12),l(13,"a",13),O("click",function(){return a.onLogout()}),b(14,"i",14),p(15,"\xA0 "),l(16,"span"),p(17," Log Out"),s()()()()(),l(18,"div",15)(19,"ul",16),h(20,Ct,4,2,"li",17),s()()(),l(21,"div",18),b(22,"router-outlet"),s()()),n&2&&(z("nav-open",Q(1,7,a.toggleState$)),r(2),d("ngClass",a.isCollapseSidebar?"collapses":""),r(2),d("ngClass",a.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),r(4),w(" ",a.storeName," "),r(3),w(" ",a.token==null?null:a.token.LID," "),r(9),d("ngForOf",a.Menu))},dependencies:[ye,Me,Se,Te,Oe,we,We,et,Ne,xe],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]});let t=e;return t})();var vt=[{path:"",component:it,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"dashboard",loadChildren:()=>import("./chunk-MEZONX3R.js").then(t=>t.DashboardModule),canActivate:[f],data:{title:"Dashboard"}},{path:"products",loadChildren:()=>import("./chunk-MCYU6XCA.js").then(t=>t.ProductModule),canActivate:[f],data:{title:"Products"}},{path:"inventory",loadChildren:()=>import("./chunk-RCYZRSCU.js").then(t=>t.InventoryRoutingModule),canActivate:[f],data:{title:"Inventory"}},{path:"price",loadChildren:()=>import("./chunk-MRTUGQ56.js").then(t=>t.PriceRoutingModule),canActivate:[f],data:{title:"Price"}},{path:"Order",loadChildren:()=>import("./chunk-VEJSM4DU.js").then(t=>t.OrdersModule),canActivate:[f],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-VHMDV7XB.js").then(t=>t.ReportModule),canActivate:[f],data:{title:"Report"}},{path:"Logistic",loadChildren:()=>import("./chunk-BOFVAVH7.js").then(t=>t.LogisticModule),canActivate:[f],data:{title:"Logistic"}},{path:"channel",loadChildren:()=>import("./chunk-AZZYTM37.js").then(t=>t.ChannelsModule),canActivate:[f],data:{title:"Marketplace"}},{path:"log",loadChildren:()=>import("./chunk-X2UZ26AC.js").then(t=>t.LogsModule),canActivate:[f],data:{title:"Orders"}},{path:"notification",loadChildren:()=>import("./chunk-ZYY6USWK.js").then(t=>t.NotificationModule),canActivate:[f],data:{title:"Push Notification"}}]}],nt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[Y.forChild(vt),Y]});let t=e;return t})();var Mt=["selectId"];function St(t,e){if(t&1&&(l(0,"span",3),p(1),s()),t&2){let o=e.item,i=c();d("title",o[i.bindLabel]),r(),y(o[i.bindLabel])}}var at=(()=>{let e=class e{set items(i){this.ngSelectInfiniteScroll.data=i,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(i){this._selected=i,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new K,this.selectedChange=new P,this.selectedLabel=new P,this.onOpen=new P}onOpenSelect(){this.onOpen.emit()}onSelectChange(i){i?(this.selectedChange.emit(i[this.bindValue]),this.selectedLabel.emit(i[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=v({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(n,a){if(n&1&&fe(Mt,7),n&2){let m;ue(m=_e())&&(a.ngSelectElement=m.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},standalone:!0,features:[B],decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(n,a){if(n&1){let m=he();l(0,"ng-select",1,0),O("clear",function(){return I(m),T(a.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return I(m),T(a.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return I(m),T(a.onOpenSelect())})("change",function(C){return I(m),T(a.onSelectChange(C))}),h(2,St,2,2,"ng-template",2),s()}n&2&&(pe("width",a.width),d("appendTo",a.parent)("disabled",a.disabled)("virtualScroll",!0)("typeahead",a.ngSelectInfiniteScroll.input$)("items",a.ngSelectInfiniteScroll.bufferData)("bindLabel",a.bindLabel)("bindValue",a.bindValue)("placeholder",a.placeholder)("ngModel",a.selected)("clearable",a.clearable))},dependencies:[M,$,Re,Be,U,Ee,De]});let t=e;return t})(),K=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new H,this._destroy$=new H,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(te(200),ie(),k(e=>(e&&(e=e.toLowerCase()),this.filterData(e))),ee(e=>e!==void 0),ne(this._destroy$)).subscribe(e=>{this._dataBuffer=e.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(e){let o=-1,i;return this._data.filter(a=>(i=JSON.stringify(a).toLowerCase(),o=i.indexOf(e),o!==-1||e==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(e){this._data=e||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(e,o){if(Ke.IsNotEmpty(e)){let i=this._data.filter(n=>n[o].toString().toLowerCase().indexOf(e)!==-1);this._dataBuffer=i.slice(0,this._bufferSize)}}set bufferSize(e){this._bufferSize=e}onScrollToEnd(){this.fetchMore()}fetchMore(){let e=this._dataBuffer.length,o=this._data.slice(e,this._bufferSize+e);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(o)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var ot=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[M,U,He,qe,Ze,Qe,Ye,Je,F,J,at,$,ke]});let t=e;return t})();var _n=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({providers:[Ie],imports:[M,nt,Ge,F,ot,tt,Ae.forChild()]});let t=e;return t})();export{_n as MenuModule};
@@ -1 +1 @@
1
- import{a as N}from"./chunk-CCP4DXYC.js";import{a as M}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as ke,c as U}from"./chunk-DLNXH2FE.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Ee,b as Me}from"./chunk-DDHEMRO7.js";import{a as De}from"./chunk-N6IHFFFZ.js";import{a as Ve,b as Te}from"./chunk-PD4CUVAW.js";import"./chunk-GCKSYCMI.js";import{a as be}from"./chunk-P64M4BHW.js";import"./chunk-ADRVUMMW.js";import{a as Fe}from"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{a as fe,b as xe,d as Se,e as Pe}from"./chunk-CCXKODFV.js";import{j as ue}from"./chunk-QK46N4UF.js";import{b as de,e as ge}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{d as Ie,l as we,m as ye,n as ve}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{b as oe,c as re,h as le,m as ce,o as se,y as pe}from"./chunk-BSN7ZAXG.js";import{c as me,e as he,f as Ce}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as u,Bd as E,Cd as ie,Da as _,Ea as m,Eb as h,G as A,Gb as p,Gc as v,Hc as T,Ic as X,Id as ae,Jc as Y,Nb as S,Ob as k,Qb as L,Rb as R,Sb as o,Tb as c,Ub as P,Vb as q,Wb as K,Yb as x,Z as $,bc as r,ea as j,ec as H,gb as D,jb as l,kb as f,mc as J,nc as d,oc as B,pa as z,pc as F,rc as I,sc as w,sd as ee,ta as G,tc as y,uc as Z,vc as Q,vd as te,xc as V,yd as ne}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Ue=i=>({"text-decoration-line-through":i}),Oe=i=>({"bg-gradient-warning":i}),We=i=>({"ms-10":i});function Ae(i,s){if(i&1&&(o(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),p("src",t==null?null:t.Img,D),l(),F(" ",t.Name," ")}}function $e(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){_(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),P(1,"i",17),d(2," Update "),c()}}function je(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,$e,3,0,"button",13),o(3,"button",14),u("click",function(){_(t);let n=r(2);return m(n.openExportDialog())}),P(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),p("ngIf",e.productService.hasSelectionVariant(t))}}function ze(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){_(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function Ge(i,s){if(i&1){let t=x();o(0,"input",51),y("ngModelChange",function(n){_(t);let a=r(4).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){_(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function qe(i,s){if(i&1&&h(0,Ge,1,1,"ng-template",26),i&2){let t=r(6);p("ngxPermissionsOnly",V(1,O,t.rolePriceEdit))}}function Ke(i,s){if(i&1){let t=x();q(0),o(1,"img",52),u("click",function(n){_(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),K()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,D)}}function He(i,s){i&1&&P(0,"img",53)}function Je(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),F("(",t.Category,")")}}function Ze(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,qe,1,3,null,26),o(3,"div",46),h(4,Ke,2,1,"ng-container",47)(5,He,1,0,"ng-template",null,0,Y),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,Je,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;p("rowSpan",e.Variants.length),l(2),S((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),p("ngClass",V(8,We,(e.Variants==null?null:e.Variants.length)<=1)),l(),p("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),p("rowSpan",e.Variants.length),l(2),B(e.Name),l(),S(e.Category?10:-1)}}function Qe(i,s){if(i&1){let t=x();o(0,"input",56),y("ngModelChange",function(n){_(t);let a=r(2).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Xe(i,s){if(i&1&&(o(0,"td",54),h(1,Qe,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),S(t.UnitPrice>=0?1:-1)}}function Ye(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function et(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.UnitPrice)," ")}}function tt(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),p("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),D)}}function nt(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){_(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function it(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,Ze,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Xe,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Ye,2,0,"div",36)(11,et,3,3,"div")(12,tt,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,nt,3,3,"div",39),o(16,"div",37)(17,"a",40),P(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=_(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),P(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),S(e==0?1:-1),l(2),B(t.Model),l(2),p("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",V(12,Ue,t.Discontinued)),l(),F(" ",t.Code," "),l(),p("ngxPermissionsOnly",V(14,O,n.rolePriceEdit)),l(3),S((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),p("ngClass",V(16,Oe,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),S(t.Channel.length>0?15:-1),l(2),p("href",t.Channel[0]==null?null:t.Channel[0].Url,D)}}function at(i,s){if(i&1&&L(0,it,22,18,"tr",33,k),i&2){let t=s.$implicit;R(t.Variants)}}function ot(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(n){_(t);let a=r(2);return w(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){_(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,ze,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){_(t);let n=r(2);return m(n.openModalFilter())}),P(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),L(26,at,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){_(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",V(16,O,e.rolePriceEdit)),l(4),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,D),l(2),F(" ",X(24,11,e.selectedChannel==null?null:e.selectedChannel.Name,20)," "),l(3),R(t),l(2),p("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",T(29,14,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function rt(i,s){if(i&1){let t=x();o(0,"mainpanel",2),y("textChange",function(n){_(t);let a=r();return w(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){_(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Ae,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,je,7,1,"actions",9),v(16,"async"),h(17,ot,30,18,"content",9),v(18,"async"),c()}if(i&2){let t=r();p("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),p("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),p("ngIf",T(16,9,t.data$)),l(2),p("ngIf",T(18,11,t.data$))}}var zt=(()=>{let s=class s{constructor(e,n,a,g,C,b,W,Le,Re,Be){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=b,this.authService=W,this.mainPanelService=Le,this.exportService=Re,this.decimalPipe=Be,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=_e.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Ne,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(b=>me.IsNotEmpty(b))).subscribe(b=>{this.updateItemAfterDialog(b,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions),b=a.Price?this.decimalPipe.transform(a.Price):a.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${b}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Me,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(n){return new(n||s)(f(ge),f(de),f(Ie),f(be),f(Fe),f(N),f(ue),f(we),f(Ee),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Z([U,N,ae("https://res.cloudinary.com/"),E]),Q],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,rt,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",T(1,1,a.loader$))},dependencies:[ie,ee,te,ne,E,ve,ye,Pe,Se,fe,xe,pe,re,se,oe,le,ce,De,ke,Ce,he,Te,Ve],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let i=s;return i})();export{zt as PriceSingleChannelComponent};
1
+ import{a as N}from"./chunk-6IB7KPKP.js";import{a as M}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as ke,c as U}from"./chunk-7XUSMPAA.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Ee,b as Me}from"./chunk-S2Z3ZGU7.js";import{a as De}from"./chunk-N6IHFFFZ.js";import{a as Ve,b as Te}from"./chunk-PD4CUVAW.js";import"./chunk-GCKSYCMI.js";import{a as be}from"./chunk-ZQWAIH5X.js";import"./chunk-ADRVUMMW.js";import{a as Fe}from"./chunk-LUY3WZJE.js";import"./chunk-HCDKYABV.js";import{a as fe,b as xe,d as Se,e as Pe}from"./chunk-CCXKODFV.js";import{j as ue}from"./chunk-YVN2BEFU.js";import{b as de,e as ge}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{d as Ie,l as we,m as ye,n as ve}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{b as oe,c as re,h as le,m as ce,o as se,y as pe}from"./chunk-BSN7ZAXG.js";import{c as me,e as he,f as Ce}from"./chunk-47DMD3UG.js";import"./chunk-OVEJFFL6.js";import{$b as u,Bd as E,Cd as ie,Da as _,Ea as m,Eb as h,G as A,Gb as p,Gc as v,Hc as T,Ic as X,Id as ae,Jc as Y,Nb as S,Ob as k,Qb as L,Rb as R,Sb as o,Tb as c,Ub as P,Vb as q,Wb as K,Yb as x,Z as $,bc as r,ea as j,ec as H,gb as D,jb as l,kb as f,mc as J,nc as d,oc as B,pa as z,pc as F,rc as I,sc as w,sd as ee,ta as G,tc as y,uc as Z,vc as Q,vd as te,xc as V,yd as ne}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Ue=i=>({"text-decoration-line-through":i}),Oe=i=>({"bg-gradient-warning":i}),We=i=>({"ms-10":i});function Ae(i,s){if(i&1&&(o(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),p("src",t==null?null:t.Img,D),l(),F(" ",t.Name," ")}}function $e(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){_(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),P(1,"i",17),d(2," Update "),c()}}function je(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,$e,3,0,"button",13),o(3,"button",14),u("click",function(){_(t);let n=r(2);return m(n.openExportDialog())}),P(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),p("ngIf",e.productService.hasSelectionVariant(t))}}function ze(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){_(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function Ge(i,s){if(i&1){let t=x();o(0,"input",51),y("ngModelChange",function(n){_(t);let a=r(4).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){_(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function qe(i,s){if(i&1&&h(0,Ge,1,1,"ng-template",26),i&2){let t=r(6);p("ngxPermissionsOnly",V(1,O,t.rolePriceEdit))}}function Ke(i,s){if(i&1){let t=x();q(0),o(1,"img",52),u("click",function(n){_(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),K()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,D)}}function He(i,s){i&1&&P(0,"img",53)}function Je(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),F("(",t.Category,")")}}function Ze(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,qe,1,3,null,26),o(3,"div",46),h(4,Ke,2,1,"ng-container",47)(5,He,1,0,"ng-template",null,0,Y),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,Je,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;p("rowSpan",e.Variants.length),l(2),S((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),p("ngClass",V(8,We,(e.Variants==null?null:e.Variants.length)<=1)),l(),p("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),p("rowSpan",e.Variants.length),l(2),B(e.Name),l(),S(e.Category?10:-1)}}function Qe(i,s){if(i&1){let t=x();o(0,"input",56),y("ngModelChange",function(n){_(t);let a=r(2).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Xe(i,s){if(i&1&&(o(0,"td",54),h(1,Qe,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),S(t.UnitPrice>=0?1:-1)}}function Ye(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function et(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.UnitPrice)," ")}}function tt(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),p("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),D)}}function nt(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){_(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function it(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,Ze,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Xe,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Ye,2,0,"div",36)(11,et,3,3,"div")(12,tt,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,nt,3,3,"div",39),o(16,"div",37)(17,"a",40),P(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=_(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),P(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),S(e==0?1:-1),l(2),B(t.Model),l(2),p("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",V(12,Ue,t.Discontinued)),l(),F(" ",t.Code," "),l(),p("ngxPermissionsOnly",V(14,O,n.rolePriceEdit)),l(3),S((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),p("ngClass",V(16,Oe,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),S(t.Channel.length>0?15:-1),l(2),p("href",t.Channel[0]==null?null:t.Channel[0].Url,D)}}function at(i,s){if(i&1&&L(0,it,22,18,"tr",33,k),i&2){let t=s.$implicit;R(t.Variants)}}function ot(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(n){_(t);let a=r(2);return w(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){_(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,ze,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){_(t);let n=r(2);return m(n.openModalFilter())}),P(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),L(26,at,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){_(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",V(16,O,e.rolePriceEdit)),l(4),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,D),l(2),F(" ",X(24,11,e.selectedChannel==null?null:e.selectedChannel.Name,20)," "),l(3),R(t),l(2),p("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",T(29,14,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function rt(i,s){if(i&1){let t=x();o(0,"mainpanel",2),y("textChange",function(n){_(t);let a=r();return w(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){_(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Ae,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,je,7,1,"actions",9),v(16,"async"),h(17,ot,30,18,"content",9),v(18,"async"),c()}if(i&2){let t=r();p("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),p("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),p("ngIf",T(16,9,t.data$)),l(2),p("ngIf",T(18,11,t.data$))}}var zt=(()=>{let s=class s{constructor(e,n,a,g,C,b,W,Le,Re,Be){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=b,this.authService=W,this.mainPanelService=Le,this.exportService=Re,this.decimalPipe=Be,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=_e.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Ne,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(b=>me.IsNotEmpty(b))).subscribe(b=>{this.updateItemAfterDialog(b,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions),b=a.Price?this.decimalPipe.transform(a.Price):a.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${b}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Me,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(n){return new(n||s)(f(ge),f(de),f(Ie),f(be),f(Fe),f(N),f(ue),f(we),f(Ee),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Z([U,N,ae("https://res.cloudinary.com/"),E]),Q],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,rt,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",T(1,1,a.loader$))},dependencies:[ie,ee,te,ne,E,ve,ye,Pe,Se,fe,xe,pe,re,se,oe,le,ce,De,ke,Ce,he,Te,Ve],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let i=s;return i})();export{zt as PriceSingleChannelComponent};
@@ -1 +1 @@
1
- import{a as H}from"./chunk-O4CRP4WO.js";import{a as V,b as G}from"./chunk-IJYSJN63.js";import{Y as q}from"./chunk-OULUJ2IO.js";import{k as j}from"./chunk-BO4PPSB5.js";import{t as W,u as $}from"./chunk-HUUFOAKH.js";import{a as R,h as A,m as D,y as U}from"./chunk-BSN7ZAXG.js";import{b as a,c as r}from"./chunk-64G3XLI6.js";import{$b as y,Cd as I,Eb as f,Gb as u,Gc as O,Hc as z,La as w,Ma as g,Nb as N,Pa as k,Sb as m,Tb as c,Z as S,bc as M,ia as T,jb as p,nc as C,pa as h,pc as v,rc as L,sc as P,ta as _,tc as B,uc as E,v as b,vc as x,xb as d,yd as F}from"./chunk-PQDPS2ID.js";function Q(s,n){if(s&1&&(m(0,"div",4),C(1),c()),s&2){let J=M();p(),v(" ",J.selectedCategoryLabel()," ")}}function X(s,n){s&1&&(m(0,"label",3),C(1,"Channel"),c())}var fe=(()=>{let n=class n{constructor(){this.multiwarehousTreeService=h(H),this.destroyRef=h(w),this.selectedCategoryLabel=d("Select a Channel"),this.disabled=d(!1),this.selectedNode=d(null),this.multiple=g(!1),this.floatingLabel=g(!1),this.onChannelChange=new k,this.channels$=this.multiwarehousTreeService.getChannelTree$().pipe(b(e=>e.map(t=>{t.children=t.children.map(i=>(i.icon="fa-solid fa-warehouse",i));let o=this.getChannelType(t.typeid);return t.icon=`custom-icon-${o}`,t.expandedIcon=null,t.collapsedIcon=null,t.styleClass=`custom-icon-${o}`,t.logo=r.getChannelLogoByTypeId(t.typeId),t})),S(1)),this.htmlBody=document.querySelector("body"),this.onChange=e=>{},this.onTouched=()=>{}}getChannelType(e){switch(e){case a.Tokopedia:return"tokopedia";case a.Shopee:return"shopee";case a.Lazada:return"lazada";case a.Shopify:return"shopify";case a.WooCommerce:return"woocommerce";case a.Tiktok:return"tiktok";case a.Plugo:return"plugo"}}initSelectedNode(e){this.channels$.pipe(j(this.destroyRef)).subscribe(t=>{if(this.multiple()){let o=[];for(let i of e){let l=r.searchByIdWithParentDFS(t,i),K=Object.assign({},l);o.push(K)}this.selectedNode.set(o),this.emitMultipleNodes()}else{let o=r.searchByIdWithParentDFS(t,e),i=Object.assign({},o);this.selectedNode.set(i),this.emitSingleNode(i)}})}onNodeSelect(e){let t=Object.assign({},e.node);this.multiple()?this.emitMultipleNodes():this.emitSingleNode(t)}emitMultipleNodes(){let e=Object.assign([],this.selectedNode()),t=e.map(o=>o.id);this.onChange(t),this.onChannelChange.emit(e),this.generateLabel()}emitSingleNode(e){this.onChange(e.id),this.onChannelChange.emit(e),this.generateLabel()}onNodeUnSelect(e){if(this.multiple()){let t=e.node;this.selectedNode.update(o=>o.filter(i=>i.id!==t.id)),this.emitMultipleNodes(),this.generateLabel()}}generateLabel(){let e="Select a Channel";if(this.multiple()){e="";for(let t of this.selectedNode())e+=r.getLabelPathTree(t)+", ";this.selectedCategoryLabel.set(e)}else{let t=this.selectedNode();t?(e=r.getLabelPathTree(t),this.selectedCategoryLabel.set(e)):this.selectedCategoryLabel.set(e)}}onClear(){this.onChange(null)}onClick(){let e=this.getBodyTop(),t=document.querySelector(".p-overlay.p-component"),o=e+t.getBoundingClientRect().top,i=t.getAttribute("style")||"";t.setAttribute("style",`${i} top: ${o+e}px;`)}getBodyTop(){return this.htmlBody.getBoundingClientRect().top*-1}writeValue(e){r.IsNotEmpty(e)&&this.initSelectedNode(e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled.set(e)}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_({type:n,selectors:[["multiwarehouse-tree-select"]],inputs:{multiple:[1,"multiple"],floatingLabel:[1,"floatingLabel"]},outputs:{onChannelChange:"onChannelChange"},standalone:!0,features:[E([{provide:R,useExisting:T(()=>n),multi:!0}]),x],decls:5,vars:9,consts:[["matTooltipPosition","above",1,"p-float-label",3,"matTooltip"],["appendTo","body","containerStyleClass","w-100","id","selectChannel",1,"multiwarehouse-select",3,"click","onNodeSelect","ngModelChange","onClear","onNodeUnselect","filter","filterInputAutoFocus","options","ngModel","selectionMode"],["pTemplate","value","type","default"],["for","selectChannel"],["matTooltipPosition","above"]],template:function(t,o){t&1&&(m(0,"span",0)(1,"p-treeSelect",1),O(2,"async"),y("click",function(){return o.onClick()})("onNodeSelect",function(l){return o.onNodeSelect(l)}),B("ngModelChange",function(l){return P(o.selectedNode,l)||(o.selectedNode=l),l}),y("onClear",function(){return o.onClear()})("onNodeUnselect",function(l){return o.onNodeUnSelect(l)}),f(3,Q,2,1,"ng-template",2),c(),f(4,X,2,0,"label",3),c()),t&2&&(u("matTooltip",o.selectedCategoryLabel()),p(),u("filter",!0)("filterInputAutoFocus",!0)("options",z(2,7,o.channels$)),L("ngModel",o.selectedNode),u("selectionMode",o.multiple()?"multiple":"single"),p(3),N(o.floatingLabel()?4:-1))},dependencies:[I,F,G,V,q,U,A,D,$,W],styles:["[_nghost-%COMP%] .p-treeselect{width:100%;display:inline-flex;border:1px solid #ced4da;font-size:.875rem!important} .p-element .p-icon-wrapper{width:14px} .p-float-label .multiwarehouse-select.p-treeselect{padding:7px!important;min-height:.6rem!important} .custom-icon-tokopedia.p-tree-node-icon, .custom-icon-shopee.p-tree-node-icon, .custom-icon-woocommerce.p-tree-node-icon, .custom-icon-lazada.p-tree-node-icon, .custom-icon-tiktok.p-tree-node-icon, .custom-icon-shopify.p-tree-node-icon, .custom-icon-plugo.p-tree-node-icon{background-size:contain;background-repeat:no-repeat;width:20px;height:20px;display:inline-block} .custom-icon-tokopedia.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png)} .custom-icon-woocommerce.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp)} .custom-icon-shopee.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png)} .custom-icon-tiktok.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png)} .custom-icon-lazada.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1680681836/icons/marketplace_icons/Lazadanew.png)} .custom-icon-shopify.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1707987435/icons/marketplace_icons/shopify.png)} .custom-icon-plugo.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1739236419/icons/marketplace_icons/plugo.ico)} .custom-icon-shopee .fa-warehouse.p-tree-node-icon, .custom-icon-tiktok .fa-warehouse.p-tree-node-icon, .custom-icon-tokopedia .fa-warehouse.p-tree-node-icon, .custom-icon-lazada .fa-warehouse.p-tree-node-icon, .custom-icon-shopify .fa-warehouse.p-tree-node-icon, .custom-icon-woocommerce .fa-warehouse.p-tree-node-icon, .custom-icon-plugo .fa-warehouse.p-tree-node-icon{background-image:none!important;display:inline-block!important}"]});let s=n;return s})();export{fe as a};
1
+ import{a as H}from"./chunk-O4CRP4WO.js";import{a as V,b as G}from"./chunk-IJYSJN63.js";import{Y as q}from"./chunk-OULUJ2IO.js";import{k as j}from"./chunk-BO4PPSB5.js";import{t as W,u as $}from"./chunk-HUUFOAKH.js";import{a as R,h as A,m as D,y as U}from"./chunk-BSN7ZAXG.js";import{b as a,c as r}from"./chunk-47DMD3UG.js";import{$b as y,Cd as I,Eb as f,Gb as u,Gc as O,Hc as z,La as w,Ma as g,Nb as N,Pa as k,Sb as m,Tb as c,Z as S,bc as M,ia as T,jb as p,nc as C,pa as h,pc as v,rc as L,sc as P,ta as _,tc as B,uc as E,v as b,vc as x,xb as d,yd as F}from"./chunk-PQDPS2ID.js";function Q(s,n){if(s&1&&(m(0,"div",4),C(1),c()),s&2){let J=M();p(),v(" ",J.selectedCategoryLabel()," ")}}function X(s,n){s&1&&(m(0,"label",3),C(1,"Channel"),c())}var fe=(()=>{let n=class n{constructor(){this.multiwarehousTreeService=h(H),this.destroyRef=h(w),this.selectedCategoryLabel=d("Select a Channel"),this.disabled=d(!1),this.selectedNode=d(null),this.multiple=g(!1),this.floatingLabel=g(!1),this.onChannelChange=new k,this.channels$=this.multiwarehousTreeService.getChannelTree$().pipe(b(e=>e.map(t=>{t.children=t.children.map(i=>(i.icon="fa-solid fa-warehouse",i));let o=this.getChannelType(t.typeid);return t.icon=`custom-icon-${o}`,t.expandedIcon=null,t.collapsedIcon=null,t.styleClass=`custom-icon-${o}`,t.logo=r.getChannelLogoByTypeId(t.typeId),t})),S(1)),this.htmlBody=document.querySelector("body"),this.onChange=e=>{},this.onTouched=()=>{}}getChannelType(e){switch(e){case a.Tokopedia:return"tokopedia";case a.Shopee:return"shopee";case a.Lazada:return"lazada";case a.Shopify:return"shopify";case a.WooCommerce:return"woocommerce";case a.Tiktok:return"tiktok";case a.Plugo:return"plugo"}}initSelectedNode(e){this.channels$.pipe(j(this.destroyRef)).subscribe(t=>{if(this.multiple()){let o=[];for(let i of e){let l=r.searchByIdWithParentDFS(t,i),K=Object.assign({},l);o.push(K)}this.selectedNode.set(o),this.emitMultipleNodes()}else{let o=r.searchByIdWithParentDFS(t,e),i=Object.assign({},o);this.selectedNode.set(i),this.emitSingleNode(i)}})}onNodeSelect(e){let t=Object.assign({},e.node);this.multiple()?this.emitMultipleNodes():this.emitSingleNode(t)}emitMultipleNodes(){let e=Object.assign([],this.selectedNode()),t=e.map(o=>o.id);this.onChange(t),this.onChannelChange.emit(e),this.generateLabel()}emitSingleNode(e){this.onChange(e.id),this.onChannelChange.emit(e),this.generateLabel()}onNodeUnSelect(e){if(this.multiple()){let t=e.node;this.selectedNode.update(o=>o.filter(i=>i.id!==t.id)),this.emitMultipleNodes(),this.generateLabel()}}generateLabel(){let e="Select a Channel";if(this.multiple()){e="";for(let t of this.selectedNode())e+=r.getLabelPathTree(t)+", ";this.selectedCategoryLabel.set(e)}else{let t=this.selectedNode();t?(e=r.getLabelPathTree(t),this.selectedCategoryLabel.set(e)):this.selectedCategoryLabel.set(e)}}onClear(){this.onChange(null)}onClick(){let e=this.getBodyTop(),t=document.querySelector(".p-overlay.p-component"),o=e+t.getBoundingClientRect().top,i=t.getAttribute("style")||"";t.setAttribute("style",`${i} top: ${o+e}px;`)}getBodyTop(){return this.htmlBody.getBoundingClientRect().top*-1}writeValue(e){r.IsNotEmpty(e)&&this.initSelectedNode(e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled.set(e)}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_({type:n,selectors:[["multiwarehouse-tree-select"]],inputs:{multiple:[1,"multiple"],floatingLabel:[1,"floatingLabel"]},outputs:{onChannelChange:"onChannelChange"},standalone:!0,features:[E([{provide:R,useExisting:T(()=>n),multi:!0}]),x],decls:5,vars:9,consts:[["matTooltipPosition","above",1,"p-float-label",3,"matTooltip"],["appendTo","body","containerStyleClass","w-100","id","selectChannel",1,"multiwarehouse-select",3,"click","onNodeSelect","ngModelChange","onClear","onNodeUnselect","filter","filterInputAutoFocus","options","ngModel","selectionMode"],["pTemplate","value","type","default"],["for","selectChannel"],["matTooltipPosition","above"]],template:function(t,o){t&1&&(m(0,"span",0)(1,"p-treeSelect",1),O(2,"async"),y("click",function(){return o.onClick()})("onNodeSelect",function(l){return o.onNodeSelect(l)}),B("ngModelChange",function(l){return P(o.selectedNode,l)||(o.selectedNode=l),l}),y("onClear",function(){return o.onClear()})("onNodeUnselect",function(l){return o.onNodeUnSelect(l)}),f(3,Q,2,1,"ng-template",2),c(),f(4,X,2,0,"label",3),c()),t&2&&(u("matTooltip",o.selectedCategoryLabel()),p(),u("filter",!0)("filterInputAutoFocus",!0)("options",z(2,7,o.channels$)),L("ngModel",o.selectedNode),u("selectionMode",o.multiple()?"multiple":"single"),p(3),N(o.floatingLabel()?4:-1))},dependencies:[I,F,G,V,q,U,A,D,$,W],styles:["[_nghost-%COMP%] .p-treeselect{width:100%;display:inline-flex;border:1px solid #ced4da;font-size:.875rem!important} .p-element .p-icon-wrapper{width:14px} .p-float-label .multiwarehouse-select.p-treeselect{padding:7px!important;min-height:.6rem!important} .custom-icon-tokopedia.p-tree-node-icon, .custom-icon-shopee.p-tree-node-icon, .custom-icon-woocommerce.p-tree-node-icon, .custom-icon-lazada.p-tree-node-icon, .custom-icon-tiktok.p-tree-node-icon, .custom-icon-shopify.p-tree-node-icon, .custom-icon-plugo.p-tree-node-icon{background-size:contain;background-repeat:no-repeat;width:20px;height:20px;display:inline-block} .custom-icon-tokopedia.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png)} .custom-icon-woocommerce.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp)} .custom-icon-shopee.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png)} .custom-icon-tiktok.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png)} .custom-icon-lazada.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1680681836/icons/marketplace_icons/Lazadanew.png)} .custom-icon-shopify.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1707987435/icons/marketplace_icons/shopify.png)} .custom-icon-plugo.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1739236419/icons/marketplace_icons/plugo.ico)} .custom-icon-shopee .fa-warehouse.p-tree-node-icon, .custom-icon-tiktok .fa-warehouse.p-tree-node-icon, .custom-icon-tokopedia .fa-warehouse.p-tree-node-icon, .custom-icon-lazada .fa-warehouse.p-tree-node-icon, .custom-icon-shopify .fa-warehouse.p-tree-node-icon, .custom-icon-woocommerce .fa-warehouse.p-tree-node-icon, .custom-icon-plugo .fa-warehouse.p-tree-node-icon{background-image:none!important;display:inline-block!important}"]});let s=n;return s})();export{fe as a};
@@ -0,0 +1 @@
1
+ import{o as ee}from"./chunk-OVEJFFL6.js";import{B as M,Ca as q,F,J as z,O as G,Pa as $,S as H,U as v,Zc as _,_ as C,aa as j,ea as V,g as f,ja as P,ka as Y,ma as T,mb as Q,oa as d,p,pa as S,q as u,ua as Z,v as E,va as J,vb as X,x as y,y as I}from"./chunk-PQDPS2ID.js";import{a as m,b as A}from"./chunk-GNOSNGXM.js";var c=function(s){return s[s.Tokopedia=1]="Tokopedia",s[s.WooCommerce=2]="WooCommerce",s[s.None=3]="None",s[s.KalCare=4]="KalCare",s[s.Shopee=5]="Shopee",s[s.Tiktok=6]="Tiktok",s[s.Lazada=7]="Lazada",s[s.Shopify=8]="Shopify",s[s.Plugo=9]="Plugo",s}(c||{});var h=function(s){return s.SHOOPE="https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",s.WOOCOMMERCE="https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp",s.TOKOPEDIA="https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",s.TIKTOK="https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png",s.LAZADA="https://res.cloudinary.com/pos/image/upload/v1680681836/icons/marketplace_icons/Lazadanew.png",s.KALCARE="https://res.cloudinary.com/pos/image/upload/v1654230268/icons/marketplace_icons/kalcare.png",s.SHOPIFY="https://res.cloudinary.com/pos/image/upload/v1707987435/icons/marketplace_icons/shopify.png",s.PLUGO="https://res.cloudinary.com/pos/image/upload/v1739236419/icons/marketplace_icons/plugo.ico",s.PLUGONEW="https://res.cloudinary.com/pos/image/upload/v1739263497/icons/marketplace_icons/plugonew.ico",s}(h||{});var fe=(()=>{let r=class r{static IsNotEmpty(e){return e!=""&&e!=r.GuidEMpty&&e!=null&&e!=null}static IsEmpty(e){return e==""||e==null||e==null||e==r.GuidEMpty}static getChannelLogoByTypeId(e){let t;switch(e){case c.Tokopedia:t=h.TOKOPEDIA;break;case c.Shopee:t=h.SHOOPE;break;case c.WooCommerce:t=h.WOOCOMMERCE;break;case c.Lazada:t=h.LAZADA;break;case c.Tiktok:t=h.TIKTOK;break;case c.KalCare:t=h.KALCARE;break;case c.Shopify:t=h.SHOPIFY;break;case c.Plugo:t=h.PLUGO;break}return t}static getChannelLogoByName(e=""){e=e.toLowerCase();let t;switch(e){case"tokopedia":t=h.TOKOPEDIA;break;case"shoppe":t=h.SHOOPE;break;case"woocommerce":t=h.WOOCOMMERCE;break;case"tiktok":t=h.TIKTOK;break;case"lazada":t=h.LAZADA;break;case"kalCare":t=h.KALCARE;break;case"plugo":t=h.PLUGO;break}return t}static getChannelName(e){let t;switch(e){case c.Shopee:t="Shopee";break;case c.Tokopedia:t="Tokopedia";break;case c.Lazada:t="Lazada";break;case c.Tiktok:t="Tiktok";break;case c.WooCommerce:t="WooCommerce";break;case c.KalCare:t="KalCare";break;case c.Plugo:t="Plugo";break}return t}static assignChannelLogo(e){return e=e.map(t=>(t.logo=this.getChannelLogoByTypeId(t.TypeID),t)),e}static getCssChannelColor(e){let t;switch(e){case c.Shopee:t="#ee4d2d";break;case c.Tokopedia:t="var(--G500,#03AC0E)";break;case c.Lazada:t="#FF00B2";break;case c.Tiktok:t="black";break;case c.WooCommerce:t="#674399";break;case c.KalCare:t="rgb(128, 188, 0)";break;case c.Plugo:t="#F2A954";break}return t}static getDaysDiff(e,t){var i=t.getTime()-e.getTime(),n=i/(1e3*60*60*24);return n}static addDays(e,t){let i=new Date(Number(e));return i.setDate(e.getDate()-t),i}static isValidDate(e){return e instanceof Date&&!isNaN(e)}static getImageInfo(e){return new Promise((t,i)=>{let n=new Image;n.src=e,n.decode().then(()=>{t({img:e,height:n.height,width:n.width})}).catch(()=>{i(new Error(`Image load error for ${e}`))})})}static formatTitleFromDate(e,t){let i=null,n=new Date(e),o=new Date(t);return n.getDate()!=o.getDate()&&(i="dd"),n.getMonth()!=o.getMonth()&&(i="dd MMM"),n.getFullYear()!=o.getFullYear()&&(i="dd MMM yyyy"),i}static openDownloadFile(e,t){var i=window.URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download=t,n.click()}static compare(e,t,i){return(e<t?-1:1)*(i?1:-1)}static isDateExpired(e){let t=new Date,i=!1;return e.getTime()<t.getTime()&&(i=!0),i}static getLabelPathTree(e){let t=[],i=e;for(;i;)t.unshift(i.label),i=i.parent;return t.join(" / ")}static searchByIdWithParentDFS(e,t){let i=[...e],n;for(typeof t=="number"?n=JSON.stringify(t):n=t;i.length>0;){let o=i.pop();if(o.id===n)return o;if(o.children&&o.children.length>0)for(let a of o.children)a.parent=o,i.push(a)}return null}static getTimeDifference(e){let t=new Date(e),i=new Date,n=Math.abs(t.getTime()-i.getTime()),o=1e3,a=6e4,g=60*a,x=24*g,ne=Math.floor(n/x),oe=Math.floor(n%x/g),ae=Math.floor(n%g/a),ce=Math.floor(n%a/o);return{days:ne,hours:oe,minutes:ae,seconds:ce}}static convertToReadableDate(e){let{days:t,hours:i,minutes:n,seconds:o}=r.getTimeDifference(e),a="";return t>0&&i>0&&n>0&&(a=`${t} days, ${i} hours and ${n} minutes ago`),t>0&&i>0&&n==0&&(a=`${t} days and ${i} hours ago`),t>0&&i==0&&(a=`${t} days ago`),t==0&&i>0&&n>0&&(a=`${i} hours and ${n} minutes ago`),t==0&&i>0&&n==0&&(a=`${i} hours ago`),t==0&&i==0&&n>0&&(a=`${n} minutes ago`),t==0&&i==0&&n==0&&o>0&&(a=`${o} seconds ago`),a}static isValidGUID(e){return/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(e)}};r.GuidEMpty="00000000-0000-0000-0000-000000000000",r.MinDate="0001-01-01T00:00:00";let s=r;return s})();var w={REMOVE:"remove",SHOW:"show"},ie=(()=>{let r=class r{constructor(){this.strategiesSource=new f({}),this.strategies$=this.strategiesSource.asObservable()}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=P({token:r,factory:r.\u0275fac});let s=r;return s})(),W=new T("USE_CONFIGURATION_STORE"),K=(()=>{let r=class r{constructor(e=!1,t){this.isolate=e,this.configurationStore=t,this.strategiesSource=this.isolate?new f({}):this.configurationStore.strategiesSource,this.strategies$=this.strategiesSource.asObservable(),this.onAuthorisedDefaultStrategy=this.isolate?void 0:this.configurationStore.onAuthorisedDefaultStrategy,this.onUnAuthorisedDefaultStrategy=this.isolate?void 0:this.configurationStore.onUnAuthorisedDefaultStrategy}setDefaultOnAuthorizedStrategy(e){this.isolate?this.onAuthorisedDefaultStrategy=this.getDefinedStrategy(e):(this.configurationStore.onAuthorisedDefaultStrategy=this.getDefinedStrategy(e),this.onAuthorisedDefaultStrategy=this.configurationStore.onAuthorisedDefaultStrategy)}setDefaultOnUnauthorizedStrategy(e){this.isolate?this.onUnAuthorisedDefaultStrategy=this.getDefinedStrategy(e):(this.configurationStore.onUnAuthorisedDefaultStrategy=this.getDefinedStrategy(e),this.onUnAuthorisedDefaultStrategy=this.configurationStore.onUnAuthorisedDefaultStrategy)}addPermissionStrategy(e,t){this.strategiesSource.value[e]=t}getStrategy(e){return this.strategiesSource.value[e]}getAllStrategies(){return this.strategiesSource.value}getDefinedStrategy(e){if(this.strategiesSource.value[e]||this.isPredefinedStrategy(e))return e;throw new Error(`No ' ${e} ' strategy is found please define one`)}isPredefinedStrategy(e){return e===w.SHOW||e===w.REMOVE}};r.\u0275fac=function(t){return new(t||r)(d(W),d(ie))},r.\u0275prov=P({token:r,factory:r.\u0275fac});let s=r;return s})();function l(s){return typeof s=="function"}function L(s){if(Object.prototype.toString.call(s)!=="[object Object]")return!1;{let r=Object.getPrototypeOf(s);return r===null||r===Object.prototype}}function se(s){return!!s&&typeof s=="string"}function R(s){return typeof s=="boolean"}function he(s){return Object.prototype.toString.call(s)==="[object Promise]"}function D(s){return Array.isArray(s)?s.length>0:!!s}function k(s){return se(s)?[s]:s}var re=(()=>{let r=class r{constructor(){this.permissionsSource=new f({}),this.permissions$=this.permissionsSource.asObservable()}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=P({token:r,factory:r.\u0275fac});let s=r;return s})(),B=new T("USE_PERMISSIONS_STORE"),O=(()=>{let r=class r{constructor(e=!1,t){this.isolate=e,this.permissionsStore=t,this.permissionsSource=this.isolate?new f({}):this.permissionsStore.permissionsSource,this.permissions$=this.permissionsSource.asObservable()}flushPermissions(){this.permissionsSource.next({})}hasPermission(e){return!e||Array.isArray(e)&&e.length===0?Promise.resolve(!0):(e=k(e),this.hasArrayPermission(e))}loadPermissions(e,t){let i=e.reduce((n,o)=>this.reducePermission(n,o,t),{});this.permissionsSource.next(i)}addPermission(e,t){if(Array.isArray(e)){let i=e.reduce((n,o)=>this.reducePermission(n,o,t),this.permissionsSource.value);this.permissionsSource.next(i)}else{let i=this.reducePermission(this.permissionsSource.value,e,t);this.permissionsSource.next(i)}}removePermission(e){let t=m({},this.permissionsSource.value);delete t[e],this.permissionsSource.next(t)}getPermission(e){return this.permissionsSource.value[e]}getPermissions(){return this.permissionsSource.value}reducePermission(e,t,i){return i&&l(i)?A(m({},e),{[t]:{name:t,validationFunction:i}}):A(m({},e),{[t]:{name:t}})}hasArrayPermission(e){let t=e.map(i=>{if(this.hasPermissionValidationFunction(i)){let n=this.permissionsSource.value[i].validationFunction,o=m({},this.permissionsSource.value);return u(null).pipe(E(()=>n(i,o)),j(a=>R(a)?u(a):a),z(()=>u(!1)))}return u(!!this.permissionsSource.value[i])});return p(t).pipe(I(),v(i=>i!==!1,!1),E(i=>i!==!1)).toPromise().then(i=>i)}hasPermissionValidationFunction(e){return!!this.permissionsSource.value[e]&&!!this.permissionsSource.value[e].validationFunction&&l(this.permissionsSource.value[e].validationFunction)}};r.\u0275fac=function(t){return new(t||r)(d(B),d(re))},r.\u0275prov=P({token:r,factory:r.\u0275fac});let s=r;return s})(),b=class{constructor(){this.rolesSource=new f({}),this.roles$=this.rolesSource.asObservable()}},N=new T("USE_ROLES_STORE"),U=(()=>{let r=class r{constructor(e=!1,t,i){this.isolate=e,this.rolesStore=t,this.permissionsService=i,this.rolesSource=this.isolate?new f({}):this.rolesStore.rolesSource,this.roles$=this.rolesSource.asObservable()}addRole(e,t){let i=A(m({},this.rolesSource.value),{[e]:{name:e,validationFunction:t}});this.rolesSource.next(i)}addRoleWithPermissions(e,t){this.permissionsService.addPermission(t),this.addRole(e,t)}addRoles(e){Object.keys(e).forEach((t,i)=>{this.addRole(t,e[t])})}addRolesWithPermissions(e){Object.keys(e).forEach((t,i)=>{this.addRoleWithPermissions(t,e[t])})}flushRoles(){this.rolesSource.next({})}flushRolesAndPermissions(){this.flushRoles(),this.permissionsService.flushPermissions()}removeRole(e){let t=m({},this.rolesSource.value);delete t[e],this.rolesSource.next(t)}getRoles(){return this.rolesSource.value}getRole(e){return this.rolesSource.value[e]}hasOnlyRoles(e){return!e||Array.isArray(e)&&e.length===0?Promise.resolve(!0):(e=k(e),Promise.all([this.hasRoleKey(e),this.hasRolePermission(this.rolesSource.value,e)]).then(([i,n])=>i||n))}hasRoleKey(e){let t=e.map(i=>{if(!!this.rolesSource.value[i]&&!!this.rolesSource.value[i].validationFunction&&l(this.rolesSource.value[i].validationFunction)&&!he(this.rolesSource.value[i].validationFunction)){let o=this.rolesSource.value[i].validationFunction,a=m({},this.rolesSource.value);return u(null).pipe(E(()=>o(i,a)),j(g=>R(g)?u(g):g),z(()=>u(!1)))}return u(!1)});return p(t).pipe(I(),v(i=>i!==!1,!1),E(i=>i!==!1)).toPromise().then(i=>i)}hasRolePermission(e,t){return p(t).pipe(y(i=>e[i]&&Array.isArray(e[i].validationFunction)?p(e[i].validationFunction).pipe(y(n=>this.permissionsService.hasPermission(n)),H(n=>n===!0)):u(!1)),v(i=>i===!0,!1)).toPromise()}};r.\u0275fac=function(t){return new(t||r)(d(N),d(b),d(O))},r.\u0275prov=P({token:r,factory:r.\u0275fac});let s=r;return s})(),Re=(()=>{let r=class r{constructor(){this.permissionsAuthorized=new $,this.permissionsUnauthorized=new $,this.firstMergeUnusedRun=1,this.permissionsService=S(O),this.configurationService=S(K),this.rolesService=S(U),this.viewContainer=S(X),this.changeDetector=S(_),this.templateRef=S(Q)}ngOnInit(){this.viewContainer.clear(),this.initPermissionSubscription=this.validateExceptOnlyPermissions()}ngOnChanges(e){let t=e.ngxPermissionsOnly,i=e.ngxPermissionsExcept;if(t||i){if(t&&t.firstChange||i&&i.firstChange)return;F(this.permissionsService.permissions$,this.rolesService.roles$).pipe(C(this.firstMergeUnusedRun),G(1)).subscribe(()=>{if(D(this.ngxPermissionsExcept)){this.validateExceptAndOnlyPermissions();return}if(D(this.ngxPermissionsOnly)){this.validateOnlyPermissions();return}this.handleAuthorisedPermission(this.getAuthorisedTemplates())})}}ngOnDestroy(){this.initPermissionSubscription&&this.initPermissionSubscription.unsubscribe()}validateExceptOnlyPermissions(){return F(this.permissionsService.permissions$,this.rolesService.roles$).pipe(C(this.firstMergeUnusedRun)).subscribe(()=>{if(D(this.ngxPermissionsExcept)){this.validateExceptAndOnlyPermissions();return}if(D(this.ngxPermissionsOnly)){this.validateOnlyPermissions();return}this.handleAuthorisedPermission(this.getAuthorisedTemplates())})}validateExceptAndOnlyPermissions(){Promise.all([this.permissionsService.hasPermission(this.ngxPermissionsExcept),this.rolesService.hasOnlyRoles(this.ngxPermissionsExcept)]).then(([e,t])=>{if(e||t){this.handleUnauthorisedPermission(this.ngxPermissionsExceptElse||this.ngxPermissionsElse);return}if(this.ngxPermissionsOnly)throw!1;this.handleAuthorisedPermission(this.ngxPermissionsExceptThen||this.ngxPermissionsThen||this.templateRef)}).catch(()=>{this.ngxPermissionsOnly?this.validateOnlyPermissions():this.handleAuthorisedPermission(this.ngxPermissionsExceptThen||this.ngxPermissionsThen||this.templateRef)})}validateOnlyPermissions(){Promise.all([this.permissionsService.hasPermission(this.ngxPermissionsOnly),this.rolesService.hasOnlyRoles(this.ngxPermissionsOnly)]).then(([e,t])=>{e||t?this.handleAuthorisedPermission(this.ngxPermissionsOnlyThen||this.ngxPermissionsThen||this.templateRef):this.handleUnauthorisedPermission(this.ngxPermissionsOnlyElse||this.ngxPermissionsElse)}).catch(()=>{this.handleUnauthorisedPermission(this.ngxPermissionsOnlyElse||this.ngxPermissionsElse)})}handleUnauthorisedPermission(e){if(!(R(this.currentAuthorizedState)&&!this.currentAuthorizedState)){if(this.currentAuthorizedState=!1,this.permissionsUnauthorized.emit(),this.getUnAuthorizedStrategyInput()){this.applyStrategyAccordingToStrategyType(this.getUnAuthorizedStrategyInput());return}this.configurationService.onUnAuthorisedDefaultStrategy&&!this.elseBlockDefined()?this.applyStrategy(this.configurationService.onUnAuthorisedDefaultStrategy):this.showTemplateBlockInView(e)}}handleAuthorisedPermission(e){if(!(R(this.currentAuthorizedState)&&this.currentAuthorizedState)){if(this.currentAuthorizedState=!0,this.permissionsAuthorized.emit(),this.getAuthorizedStrategyInput()){this.applyStrategyAccordingToStrategyType(this.getAuthorizedStrategyInput());return}this.configurationService.onAuthorisedDefaultStrategy&&!this.thenBlockDefined()?this.applyStrategy(this.configurationService.onAuthorisedDefaultStrategy):this.showTemplateBlockInView(e)}}applyStrategyAccordingToStrategyType(e){if(se(e)){this.applyStrategy(e);return}if(l(e)){this.showTemplateBlockInView(this.templateRef),e(this.templateRef);return}}showTemplateBlockInView(e){this.viewContainer.clear(),e&&(this.viewContainer.createEmbeddedView(e),this.changeDetector.markForCheck())}getAuthorisedTemplates(){return this.ngxPermissionsOnlyThen||this.ngxPermissionsExceptThen||this.ngxPermissionsThen||this.templateRef}elseBlockDefined(){return!!this.ngxPermissionsExceptElse||!!this.ngxPermissionsElse}thenBlockDefined(){return!!this.ngxPermissionsExceptThen||!!this.ngxPermissionsThen}getAuthorizedStrategyInput(){return this.ngxPermissionsOnlyAuthorisedStrategy||this.ngxPermissionsExceptAuthorisedStrategy||this.ngxPermissionsAuthorisedStrategy}getUnAuthorizedStrategyInput(){return this.ngxPermissionsOnlyUnauthorisedStrategy||this.ngxPermissionsExceptUnauthorisedStrategy||this.ngxPermissionsUnauthorisedStrategy}applyStrategy(e){if(e===w.SHOW){this.showTemplateBlockInView(this.templateRef);return}if(e===w.REMOVE){this.viewContainer.clear();return}let t=this.configurationService.getStrategy(e);this.showTemplateBlockInView(this.templateRef),t(this.templateRef)}};r.\u0275fac=function(t){return new(t||r)},r.\u0275dir=J({type:r,selectors:[["","ngxPermissionsOnly",""],["","ngxPermissionsExcept",""]],inputs:{ngxPermissionsOnly:"ngxPermissionsOnly",ngxPermissionsOnlyThen:"ngxPermissionsOnlyThen",ngxPermissionsOnlyElse:"ngxPermissionsOnlyElse",ngxPermissionsExcept:"ngxPermissionsExcept",ngxPermissionsExceptElse:"ngxPermissionsExceptElse",ngxPermissionsExceptThen:"ngxPermissionsExceptThen",ngxPermissionsThen:"ngxPermissionsThen",ngxPermissionsElse:"ngxPermissionsElse",ngxPermissionsOnlyAuthorisedStrategy:"ngxPermissionsOnlyAuthorisedStrategy",ngxPermissionsOnlyUnauthorisedStrategy:"ngxPermissionsOnlyUnauthorisedStrategy",ngxPermissionsExceptUnauthorisedStrategy:"ngxPermissionsExceptUnauthorisedStrategy",ngxPermissionsExceptAuthorisedStrategy:"ngxPermissionsExceptAuthorisedStrategy",ngxPermissionsUnauthorisedStrategy:"ngxPermissionsUnauthorisedStrategy",ngxPermissionsAuthorisedStrategy:"ngxPermissionsAuthorisedStrategy"},outputs:{permissionsAuthorized:"permissionsAuthorized",permissionsUnauthorized:"permissionsUnauthorized"},features:[q]});let s=r;return s})(),ue="default";var te=(()=>{let r=class r{constructor(e,t,i){this.permissionsService=e,this.rolesService=t,this.router=i}canActivate(e,t){return this.hasPermissions(e,t)}canActivateChild(e,t){return this.hasPermissions(e,t)}canLoad(e){return this.hasPermissions(e)}canMatch(e){return this.hasPermissions(e)}hasPermissions(e,t){let i=e&&e.data?e.data.permissions:{},n=this.transformPermission(i,e,t);return this.isParameterAvailable(n.except)?this.passingExceptPermissionsValidation(n,e,t):this.isParameterAvailable(n.only)?this.passingOnlyPermissionsValidation(n,e,t):!0}transformPermission(e,t,i){let n=l(e.only)?e.only(t,i):k(e.only),o=l(e.except)?e.except(t,i):k(e.except),a=e.redirectTo;return{only:n,except:o,redirectTo:a}}isParameterAvailable(e){return!!e&&e.length>0}passingExceptPermissionsValidation(e,t,i){if(e.redirectTo&&(l(e.redirectTo)||L(e.redirectTo)&&!this.isRedirectionWithParameters(e.redirectTo))){let n="";return p(e.except).pipe(y(o=>M([this.permissionsService.hasPermission(o),this.rolesService.hasOnlyRoles(o)]).pipe(V(a=>{a.every(x=>x===!1)||(n=o)}))),v(o=>o.some(a=>a===!0),!1),y(o=>n?(this.handleRedirectOfFailedPermission(e,n,t,i),u(!1)):!o&&e.only?this.onlyRedirectCheck(e,t,i):u(!o))).toPromise()}return Promise.all([this.permissionsService.hasPermission(e.except),this.rolesService.hasOnlyRoles(e.except)]).then(([n,o])=>n||o?(e.redirectTo&&this.redirectToAnotherRoute(e.redirectTo,t,i),!1):e.only?this.checkOnlyPermissions(e,t,i):!0)}redirectToAnotherRoute(e,t,i,n){let o=l(e)?e(n,t,i):e;if(this.isRedirectionWithParameters(o)){o.navigationCommands=this.transformNavigationCommands(o.navigationCommands,t,i),o.navigationExtras=this.transformNavigationExtras(o.navigationExtras,t,i),this.router.navigate(o.navigationCommands,o.navigationExtras);return}Array.isArray(o)?this.router.navigate(o):this.router.navigate([o])}isRedirectionWithParameters(e){return L(e)&&(!!e.navigationCommands||!!e.navigationExtras)}transformNavigationCommands(e,t,i){return l(e)?e(t,i):e}transformNavigationExtras(e,t,i){return l(e)?e(t,i):e}onlyRedirectCheck(e,t,i){let n="";return p(e.only).pipe(y(o=>M([this.permissionsService.hasPermission(o),this.rolesService.hasOnlyRoles(o)]).pipe(V(a=>{a.every(x=>x===!1)&&(n=o)}))),v(o=>l(e.redirectTo)?o.some(a=>a===!0):o.every(a=>a===!1),!1),y(o=>l(e.redirectTo)?o?u(!0):(this.handleRedirectOfFailedPermission(e,n,t,i),u(!1)):(n&&this.handleRedirectOfFailedPermission(e,n,t,i),u(!o)))).toPromise()}handleRedirectOfFailedPermission(e,t,i,n){this.isFailedPermissionPropertyOfRedirectTo(e,t)?this.redirectToAnotherRoute(e.redirectTo[t],i,n,t):l(e.redirectTo)?this.redirectToAnotherRoute(e.redirectTo,i,n,t):this.redirectToAnotherRoute(e.redirectTo[ue],i,n,t)}isFailedPermissionPropertyOfRedirectTo(e,t){return!!e.redirectTo&&e.redirectTo[t]}checkOnlyPermissions(e,t,i){let n=m({},e);return Promise.all([this.permissionsService.hasPermission(n.only),this.rolesService.hasOnlyRoles(n.only)]).then(([o,a])=>o||a?!0:(n.redirectTo&&this.redirectToAnotherRoute(n.redirectTo,t,i),!1))}passingOnlyPermissionsValidation(e,t,i){return l(e.redirectTo)||L(e.redirectTo)&&!this.isRedirectionWithParameters(e.redirectTo)?this.onlyRedirectCheck(e,t,i):this.checkOnlyPermissions(e,t,i)}};r.\u0275fac=function(t){return new(t||r)(d(O),d(U),d(ee))},r.\u0275prov=P({token:r,factory:r.\u0275fac});let s=r;return s})();var ke=(()=>{let r=class r{static forRoot(e={}){return{ngModule:r,providers:[re,b,ie,O,te,U,K,{provide:B,useValue:e.permissionsIsolate},{provide:N,useValue:e.rolesIsolate},{provide:W,useValue:e.configurationIsolate}]}}static forChild(e={}){return{ngModule:r,providers:[{provide:B,useValue:e.permissionsIsolate},{provide:N,useValue:e.rolesIsolate},{provide:W,useValue:e.configurationIsolate},K,O,U,te]}}};r.\u0275fac=function(t){return new(t||r)},r.\u0275mod=Z({type:r}),r.\u0275inj=Y({});let s=r;return s})();export{h as a,c as b,fe as c,O as d,Re as e,ke as f};
@@ -1 +1 @@
1
- import{a as j}from"./chunk-XFTUE2ST.js";import{t as R,u as Z}from"./chunk-HUUFOAKH.js";import{y as z}from"./chunk-BSN7ZAXG.js";import{c as N}from"./chunk-64G3XLI6.js";import{$b as C,Cd as F,Da as u,Ea as g,Eb as p,Gb as d,Jc as I,Nb as w,Pa as f,Sb as c,Tb as a,Ub as m,Vb as v,Wb as b,Yb as h,bc as l,ec as B,gb as x,jb as o,kb as D,mc as S,nc as _,oc as E,pc as k,sd as U,ta as y,ud as O,vc as V,vd as M,xc as T}from"./chunk-PQDPS2ID.js";var L=t=>({"me-3":t}),$=t=>({"border-bottom pb-2":t});function A(t,i){if(t&1){let e=h();v(0),c(1,"img",17),C("click",function(n){u(e);let s=l();return g(s.openBiggerPicture(n))}),a(),b()}if(t&2){let e=l();o(),d("src",e.image,x)}}function H(t,i){t&1&&m(0,"img",18)}function W(t,i){if(t&1&&(v(0),c(1,"span",22)(2,"a",23),m(3,"i",24),a()(),b()),t&2){let e=l(2);o(2),d("href",e.redirectUrl,x)}}function q(t,i){if(t&1&&(c(0,"div",19),m(1,"i",20),c(2,"span"),_(3),a(),p(4,W,4,1,"ng-container",21),a()),t&2){let e=l();o(3),E(e.code),o(),d("ngIf",e.code!=="SKU not assigned"&&e.showRedirectIcon)}}function J(t,i){if(t&1){let e=h();c(0,"div",25),C("click",function(){u(e);let n=l();return g(n.onEventDesc())}),m(1,"i",26),c(2,"span"),_(3),a()()}if(t&2){let e=l();o(3),E(e.description)}}function K(t,i){if(t&1){let e=h();c(0,"div",27)(1,"input",28),C("change",function(n){u(e);let s=l();return g(s.onCheck(n.target.checked))}),a()()}}function G(t,i){if(t&1){let e=h();c(0,"button",31),C("click",function(){u(e);let n=l(2);return g(n.onDownload())}),m(1,"i",32),_(2,"Download "),a()}}function Q(t,i){if(t&1){let e=h();c(0,"li")(1,"a",40),C("click",function(){u(e);let n=l(3);return g(n.onDetach())}),m(2,"i",41),_(3,"Detach "),a()()}}function X(t,i){if(t&1){let e=h();c(0,"div",30)(1,"button",33),C("click",function(){u(e);let n=l(2);return g(n.onUpload())}),m(2,"i",34),_(3,"Upload "),a(),c(4,"div",35),m(5,"button",36),c(6,"ul",37)(7,"li")(8,"a",38),C("click",function(){u(e);let n=l(2);return g(n.onScan())}),m(9,"i",39),_(10,"Scan "),a()(),p(11,Q,4,0,"li"),a()()()}if(t&2){let e=l(2);o(11),w(e.detachButton?11:-1)}}function Y(t,i){if(t&1){let e=h();c(0,"button",31),C("click",function(){u(e);let n=l(3);return g(n.onScan())}),m(1,"i",44),_(2," Scan "),a()}}function tt(t,i){if(t&1){let e=h();c(0,"button",45),C("click",function(){u(e);let n=l(3);return g(n.onDetach())}),m(1,"i",41),_(2,"Detach "),a()}}function et(t,i){if(t&1&&p(0,Y,3,0,"button",42)(1,tt,3,0,"button",43),t&2){let e=l(2);w(e.scanButton?0:-1),o(),w(e.detachButton?1:-1)}}function nt(t,i){if(t&1&&(v(0),c(1,"a",47),m(2,"img",48),a(),b()),t&2){let e=i.$implicit,r=i.index,n=l(4);o(),B("href",e.Url,x),o(),d("ngClass",T(4,L,r!=n.channels.length-1))("src",n.getChannelLogo(e),x)("matTooltip",e.Title?e.Title:e.Name)}}function it(t,i){if(t&1&&(v(0),p(1,nt,3,6,"ng-container",46),b()),t&2){let e=l(3);o(),d("ngForOf",e.channels)}}function ot(t,i){if(t&1&&(c(0,"li")(1,"div",52)(2,"div",53)(3,"a",47),m(4,"img",54),c(5,"span",55),_(6),a()()()()()),t&2){let e=i.$implicit,r=i.index,n=l(4);o(2),d("ngClass",T(4,$,r!=n.channels.length-1)),o(),d("href",e.Url,x),o(),d("src",n.getChannelLogo(e),x),o(2),E(e.Title)}}function rt(t,i){if(t&1&&(c(0,"div",49)(1,"button",50),_(2),a(),c(3,"ul",51),p(4,ot,7,6,"li",46),a()()),t&2){let e=l(3);o(2),k(" ",e.channels.length," CHANNELS "),o(2),d("ngForOf",e.channels)}}function at(t,i){if(t&1&&(c(0,"div"),p(1,it,2,1,"ng-container",8)(2,rt,5,2,"ng-template",null,1,I),a()),t&2){let e=S(3),r=l(2);o(),d("ngIf",r.channels.length<4)("ngIfElse",e)}}function ct(t,i){if(t&1&&(c(0,"div",16)(1,"div"),p(2,G,3,0,"button",29)(3,X,12,1,"div",30)(4,et,2,2),a(),p(5,at,4,2,"div"),a()),t&2){let e=l();o(2),d("ngIf",e.downloadButton),o(),w(e.uploadButton?3:4),o(2),w(e.channels&&(e.channels==null?null:e.channels.length)>0?5:-1)}}var vt=(()=>{let i=class i{constructor(r){this.biggerPictureService=r,this.uploadButton=!1,this.scanButton=!1,this.showCheckBox=!1,this.downloadButton=!1,this.showFooter=!0,this.detachButton=!1,this.hasZoom=!0,this.showRedirectIcon=!0,this.onUploadEvent=new f,this.onScanEvent=new f,this.checkBoxChange=new f,this.onDescEvent=new f,this.onDownloadEvent=new f,this.onDetachEvent=new f}ngAfterContentInit(){this.initRedirectUrl()}initRedirectUrl(){let r=localStorage.getItem("Authorization"),n=JSON.parse(r)?.Host;this.redirectUrl=`https://${n}/menu/Products/Catalog/Products/Info?ID=${this.productId}`}onUpload(){this.onUploadEvent.emit()}onScan(){this.onScanEvent.emit()}onCheck(r){this.checkBoxChange.emit(r)}onEventDesc(){this.onDescEvent.emit()}onDownload(){this.onDownloadEvent.emit()}onDetach(){this.onDetachEvent.emit()}getChannelLogo(r){return N.getChannelLogoByTypeId(r.TypeID)}openBiggerPicture(r){this.biggerPictureService.openBiggerPicture(r,this.imageForZoom)}};i.\u0275fac=function(n){return new(n||i)(D(j))},i.\u0275cmp=y({type:i,selectors:[["app-product-card"]],inputs:{productId:"productId",uploadButton:"uploadButton",scanButton:"scanButton",showCheckBox:"showCheckBox",downloadButton:"downloadButton",showFooter:"showFooter",detachButton:"detachButton",image:"image",title:"title",code:"code",description:"description",channels:"channels",check:"check",imageForZoom:"imageForZoom",hasZoom:"hasZoom",showRedirectIcon:"showRedirectIcon"},outputs:{onUploadEvent:"onUpload",onScanEvent:"onScan",checkBoxChange:"onCheckBoxChange",onDescEvent:"onDescEvent",onDownloadEvent:"onDownload",onDetachEvent:"onDetach"},standalone:!0,features:[V],decls:18,vars:8,consts:[["elsePic",""],["DROPDOWN",""],[1,"card",2,"margin-bottom","0px"],[1,"card-body","py-6"],[1,"row"],[1,"col-4"],[1,"productUpload_defaultSize","me-2","image-upload"],[1,"imgContainer"],[4,"ngIf","ngIfElse"],[1,"col-7","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle","cursor-pointer",3,"click","matTooltip"],["class","description cursor-pointer",4,"ngIf"],["class","description cursor-pointer",3,"click",4,"ngIf"],[1,"col-1","gx-0","d-flex","justify-content-center"],[1,"text-end"],["class","text-end gx-0",4,"ngIf"],[1,"card-footer","d-flex","justify-content-between","py-5","bg-footer","align-items-center",2,"border-top","0.1px solid rgb(220 220 220)"],[1,"rounded","imgUpload","float-left",3,"click","src"],["src","https://res.cloudinary.com/pos/image/upload/w_110/POS/Images/Icon/products_thumb.png",1,"rounded","float-left","imgUpload"],[1,"description","cursor-pointer"],[1,"fa","fa-barcode","me-2"],[4,"ngIf"],[1,"ms-2"],["target","_blank",2,"color","#0976b4",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"description","cursor-pointer",3,"click"],[1,"fa","fa-tag","me-2"],[1,"text-end","gx-0"],["type","checkbox",3,"change"],["class","fs-6 btn btn-light btn-sm me-3",3,"click",4,"ngIf"],["role","group","aria-label","Scan button with other button",1,"btn-group","btn-sm"],[1,"fs-6","btn","btn-light","btn-sm","me-3",3,"click"],["aria-hidden","true",1,"fa","fa-download","me-1"],["type","button",1,"fs-6","btn","btn-light","btn-sm","pe-1",3,"click"],["aria-hidden","true",1,"fa","fa-upload","me-1"],["role","group",1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"fs-6","btn","btn-light","btn-sm","dropdown-toggle","ps-3"],[1,"dropdown-menu",2,"min-width","100px !important"],[1,"dropdown-item","cursor-pointer",3,"click"],[1,"fa","fa-spinner","me-2"],["matTooltip","Detaching a product with it's associated channel will stop inventory synchronization",1,"dropdown-item","cursor-pointer",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],[1,"fs-6","btn","btn-light","btn-sm","me-3"],[1,"fs-6","btn","btn-light","btn-sm"],[1,"fa","fa-spinner","me-1"],[1,"fs-6","btn","btn-light","btn-sm",3,"click"],[4,"ngFor","ngForOf"],["target","_blank",3,"href"],["alt","",1,"img-logo",3,"ngClass","src","matTooltip"],[1,"dropdown"],["type","button","id","dropdownMenuButton1","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","fs-6","btn-sm","btn-light","dropdown-toggle"],[1,"dropdown-menu"],[1,"dropdown-item","py-2",2,"cursor","pointer"],[3,"ngClass"],[1,"img-logo",3,"src"],[1,"ms-4"]],template:function(n,s){if(n&1){let P=h();c(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"div",7),p(6,A,2,1,"ng-container",8)(7,H,1,0,"ng-template",null,0,I),a()()(),c(9,"div",9)(10,"h4",10),C("click",function(){return u(P),g(s.onEventDesc())}),_(11),a(),p(12,q,5,2,"div",11)(13,J,4,1,"div",12),a(),c(14,"div",13)(15,"div",14),p(16,K,2,0,"div",15),a()()()(),p(17,ct,6,3,"div",16),a()}if(n&2){let P=S(8);o(6),d("ngIf",s.image)("ngIfElse",P),o(4),d("matTooltip",(s.title==null?null:s.title.length)>25?s.title:""),o(),k(" ",s.title," "),o(),d("ngIf",s.code),o(),d("ngIf",s.description),o(3),d("ngIf",s.showCheckBox),o(),w(s.showFooter?17:-1)}},dependencies:[F,U,O,M,z,Z,R],styles:[".img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:100%}.bg-footer[_ngcontent-%COMP%]{background-color:#ededed69}.description[_ngcontent-%COMP%]{font-weight:300;margin-left:2px}.productUpload_defaultSize[_ngcontent-%COMP%]{max-width:100px!important;max-height:100px!important;width:auto!important;height:auto!important}.image-upload[_ngcontent-%COMP%]{position:relative}.imgContainer[_ngcontent-%COMP%]{width:100%;height:100px}.imgUpload[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:scale-down;cursor:pointer}.dropdown[_ngcontent-%COMP%] .dropdown-menu.show[_ngcontent-%COMP%]{top:unset!important}"]});let t=i;return t})();export{vt as a};
1
+ import{a as j}from"./chunk-LUY3WZJE.js";import{t as R,u as Z}from"./chunk-HUUFOAKH.js";import{y as z}from"./chunk-BSN7ZAXG.js";import{c as N}from"./chunk-47DMD3UG.js";import{$b as C,Cd as F,Da as u,Ea as g,Eb as p,Gb as d,Jc as I,Nb as w,Pa as f,Sb as c,Tb as a,Ub as m,Vb as v,Wb as b,Yb as h,bc as l,ec as B,gb as x,jb as o,kb as D,mc as S,nc as _,oc as E,pc as k,sd as U,ta as y,ud as O,vc as V,vd as M,xc as T}from"./chunk-PQDPS2ID.js";var L=t=>({"me-3":t}),$=t=>({"border-bottom pb-2":t});function A(t,i){if(t&1){let e=h();v(0),c(1,"img",17),C("click",function(n){u(e);let s=l();return g(s.openBiggerPicture(n))}),a(),b()}if(t&2){let e=l();o(),d("src",e.image,x)}}function H(t,i){t&1&&m(0,"img",18)}function W(t,i){if(t&1&&(v(0),c(1,"span",22)(2,"a",23),m(3,"i",24),a()(),b()),t&2){let e=l(2);o(2),d("href",e.redirectUrl,x)}}function q(t,i){if(t&1&&(c(0,"div",19),m(1,"i",20),c(2,"span"),_(3),a(),p(4,W,4,1,"ng-container",21),a()),t&2){let e=l();o(3),E(e.code),o(),d("ngIf",e.code!=="SKU not assigned"&&e.showRedirectIcon)}}function J(t,i){if(t&1){let e=h();c(0,"div",25),C("click",function(){u(e);let n=l();return g(n.onEventDesc())}),m(1,"i",26),c(2,"span"),_(3),a()()}if(t&2){let e=l();o(3),E(e.description)}}function K(t,i){if(t&1){let e=h();c(0,"div",27)(1,"input",28),C("change",function(n){u(e);let s=l();return g(s.onCheck(n.target.checked))}),a()()}}function G(t,i){if(t&1){let e=h();c(0,"button",31),C("click",function(){u(e);let n=l(2);return g(n.onDownload())}),m(1,"i",32),_(2,"Download "),a()}}function Q(t,i){if(t&1){let e=h();c(0,"li")(1,"a",40),C("click",function(){u(e);let n=l(3);return g(n.onDetach())}),m(2,"i",41),_(3,"Detach "),a()()}}function X(t,i){if(t&1){let e=h();c(0,"div",30)(1,"button",33),C("click",function(){u(e);let n=l(2);return g(n.onUpload())}),m(2,"i",34),_(3,"Upload "),a(),c(4,"div",35),m(5,"button",36),c(6,"ul",37)(7,"li")(8,"a",38),C("click",function(){u(e);let n=l(2);return g(n.onScan())}),m(9,"i",39),_(10,"Scan "),a()(),p(11,Q,4,0,"li"),a()()()}if(t&2){let e=l(2);o(11),w(e.detachButton?11:-1)}}function Y(t,i){if(t&1){let e=h();c(0,"button",31),C("click",function(){u(e);let n=l(3);return g(n.onScan())}),m(1,"i",44),_(2," Scan "),a()}}function tt(t,i){if(t&1){let e=h();c(0,"button",45),C("click",function(){u(e);let n=l(3);return g(n.onDetach())}),m(1,"i",41),_(2,"Detach "),a()}}function et(t,i){if(t&1&&p(0,Y,3,0,"button",42)(1,tt,3,0,"button",43),t&2){let e=l(2);w(e.scanButton?0:-1),o(),w(e.detachButton?1:-1)}}function nt(t,i){if(t&1&&(v(0),c(1,"a",47),m(2,"img",48),a(),b()),t&2){let e=i.$implicit,r=i.index,n=l(4);o(),B("href",e.Url,x),o(),d("ngClass",T(4,L,r!=n.channels.length-1))("src",n.getChannelLogo(e),x)("matTooltip",e.Title?e.Title:e.Name)}}function it(t,i){if(t&1&&(v(0),p(1,nt,3,6,"ng-container",46),b()),t&2){let e=l(3);o(),d("ngForOf",e.channels)}}function ot(t,i){if(t&1&&(c(0,"li")(1,"div",52)(2,"div",53)(3,"a",47),m(4,"img",54),c(5,"span",55),_(6),a()()()()()),t&2){let e=i.$implicit,r=i.index,n=l(4);o(2),d("ngClass",T(4,$,r!=n.channels.length-1)),o(),d("href",e.Url,x),o(),d("src",n.getChannelLogo(e),x),o(2),E(e.Title)}}function rt(t,i){if(t&1&&(c(0,"div",49)(1,"button",50),_(2),a(),c(3,"ul",51),p(4,ot,7,6,"li",46),a()()),t&2){let e=l(3);o(2),k(" ",e.channels.length," CHANNELS "),o(2),d("ngForOf",e.channels)}}function at(t,i){if(t&1&&(c(0,"div"),p(1,it,2,1,"ng-container",8)(2,rt,5,2,"ng-template",null,1,I),a()),t&2){let e=S(3),r=l(2);o(),d("ngIf",r.channels.length<4)("ngIfElse",e)}}function ct(t,i){if(t&1&&(c(0,"div",16)(1,"div"),p(2,G,3,0,"button",29)(3,X,12,1,"div",30)(4,et,2,2),a(),p(5,at,4,2,"div"),a()),t&2){let e=l();o(2),d("ngIf",e.downloadButton),o(),w(e.uploadButton?3:4),o(2),w(e.channels&&(e.channels==null?null:e.channels.length)>0?5:-1)}}var vt=(()=>{let i=class i{constructor(r){this.biggerPictureService=r,this.uploadButton=!1,this.scanButton=!1,this.showCheckBox=!1,this.downloadButton=!1,this.showFooter=!0,this.detachButton=!1,this.hasZoom=!0,this.showRedirectIcon=!0,this.onUploadEvent=new f,this.onScanEvent=new f,this.checkBoxChange=new f,this.onDescEvent=new f,this.onDownloadEvent=new f,this.onDetachEvent=new f}ngAfterContentInit(){this.initRedirectUrl()}initRedirectUrl(){let r=localStorage.getItem("Authorization"),n=JSON.parse(r)?.Host;this.redirectUrl=`https://${n}/menu/Products/Catalog/Products/Info?ID=${this.productId}`}onUpload(){this.onUploadEvent.emit()}onScan(){this.onScanEvent.emit()}onCheck(r){this.checkBoxChange.emit(r)}onEventDesc(){this.onDescEvent.emit()}onDownload(){this.onDownloadEvent.emit()}onDetach(){this.onDetachEvent.emit()}getChannelLogo(r){return N.getChannelLogoByTypeId(r.TypeID)}openBiggerPicture(r){this.biggerPictureService.openBiggerPicture(r,this.imageForZoom)}};i.\u0275fac=function(n){return new(n||i)(D(j))},i.\u0275cmp=y({type:i,selectors:[["app-product-card"]],inputs:{productId:"productId",uploadButton:"uploadButton",scanButton:"scanButton",showCheckBox:"showCheckBox",downloadButton:"downloadButton",showFooter:"showFooter",detachButton:"detachButton",image:"image",title:"title",code:"code",description:"description",channels:"channels",check:"check",imageForZoom:"imageForZoom",hasZoom:"hasZoom",showRedirectIcon:"showRedirectIcon"},outputs:{onUploadEvent:"onUpload",onScanEvent:"onScan",checkBoxChange:"onCheckBoxChange",onDescEvent:"onDescEvent",onDownloadEvent:"onDownload",onDetachEvent:"onDetach"},standalone:!0,features:[V],decls:18,vars:8,consts:[["elsePic",""],["DROPDOWN",""],[1,"card",2,"margin-bottom","0px"],[1,"card-body","py-6"],[1,"row"],[1,"col-4"],[1,"productUpload_defaultSize","me-2","image-upload"],[1,"imgContainer"],[4,"ngIf","ngIfElse"],[1,"col-7","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle","cursor-pointer",3,"click","matTooltip"],["class","description cursor-pointer",4,"ngIf"],["class","description cursor-pointer",3,"click",4,"ngIf"],[1,"col-1","gx-0","d-flex","justify-content-center"],[1,"text-end"],["class","text-end gx-0",4,"ngIf"],[1,"card-footer","d-flex","justify-content-between","py-5","bg-footer","align-items-center",2,"border-top","0.1px solid rgb(220 220 220)"],[1,"rounded","imgUpload","float-left",3,"click","src"],["src","https://res.cloudinary.com/pos/image/upload/w_110/POS/Images/Icon/products_thumb.png",1,"rounded","float-left","imgUpload"],[1,"description","cursor-pointer"],[1,"fa","fa-barcode","me-2"],[4,"ngIf"],[1,"ms-2"],["target","_blank",2,"color","#0976b4",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"description","cursor-pointer",3,"click"],[1,"fa","fa-tag","me-2"],[1,"text-end","gx-0"],["type","checkbox",3,"change"],["class","fs-6 btn btn-light btn-sm me-3",3,"click",4,"ngIf"],["role","group","aria-label","Scan button with other button",1,"btn-group","btn-sm"],[1,"fs-6","btn","btn-light","btn-sm","me-3",3,"click"],["aria-hidden","true",1,"fa","fa-download","me-1"],["type","button",1,"fs-6","btn","btn-light","btn-sm","pe-1",3,"click"],["aria-hidden","true",1,"fa","fa-upload","me-1"],["role","group",1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"fs-6","btn","btn-light","btn-sm","dropdown-toggle","ps-3"],[1,"dropdown-menu",2,"min-width","100px !important"],[1,"dropdown-item","cursor-pointer",3,"click"],[1,"fa","fa-spinner","me-2"],["matTooltip","Detaching a product with it's associated channel will stop inventory synchronization",1,"dropdown-item","cursor-pointer",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],[1,"fs-6","btn","btn-light","btn-sm","me-3"],[1,"fs-6","btn","btn-light","btn-sm"],[1,"fa","fa-spinner","me-1"],[1,"fs-6","btn","btn-light","btn-sm",3,"click"],[4,"ngFor","ngForOf"],["target","_blank",3,"href"],["alt","",1,"img-logo",3,"ngClass","src","matTooltip"],[1,"dropdown"],["type","button","id","dropdownMenuButton1","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","fs-6","btn-sm","btn-light","dropdown-toggle"],[1,"dropdown-menu"],[1,"dropdown-item","py-2",2,"cursor","pointer"],[3,"ngClass"],[1,"img-logo",3,"src"],[1,"ms-4"]],template:function(n,s){if(n&1){let P=h();c(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"div",7),p(6,A,2,1,"ng-container",8)(7,H,1,0,"ng-template",null,0,I),a()()(),c(9,"div",9)(10,"h4",10),C("click",function(){return u(P),g(s.onEventDesc())}),_(11),a(),p(12,q,5,2,"div",11)(13,J,4,1,"div",12),a(),c(14,"div",13)(15,"div",14),p(16,K,2,0,"div",15),a()()()(),p(17,ct,6,3,"div",16),a()}if(n&2){let P=S(8);o(6),d("ngIf",s.image)("ngIfElse",P),o(4),d("matTooltip",(s.title==null?null:s.title.length)>25?s.title:""),o(),k(" ",s.title," "),o(),d("ngIf",s.code),o(),d("ngIf",s.description),o(3),d("ngIf",s.showCheckBox),o(),w(s.showFooter?17:-1)}},dependencies:[F,U,O,M,z,Z,R],styles:[".img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:100%}.bg-footer[_ngcontent-%COMP%]{background-color:#ededed69}.description[_ngcontent-%COMP%]{font-weight:300;margin-left:2px}.productUpload_defaultSize[_ngcontent-%COMP%]{max-width:100px!important;max-height:100px!important;width:auto!important;height:auto!important}.image-upload[_ngcontent-%COMP%]{position:relative}.imgContainer[_ngcontent-%COMP%]{width:100%;height:100px}.imgUpload[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:scale-down;cursor:pointer}.dropdown[_ngcontent-%COMP%] .dropdown-menu.show[_ngcontent-%COMP%]{top:unset!important}"]});let t=i;return t})();export{vt as a};
@@ -1 +1 @@
1
- import{a as Z}from"./chunk-5SZSDHJB.js";import{a as Y}from"./chunk-7LZ5ZSXM.js";import{b as ee,c as V}from"./chunk-DLNXH2FE.js";import"./chunk-BVIRHZTZ.js";import{b as X}from"./chunk-DDHEMRO7.js";import"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-JXTGH22T.js";import"./chunk-GCKSYCMI.js";import{a as Q}from"./chunk-P64M4BHW.js";import"./chunk-ADRVUMMW.js";import"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{j as q}from"./chunk-QK46N4UF.js";import{b as $,e as H}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{d as z,m as J,n as K}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as U,h as j,m as k,o as G,y as W}from"./chunk-BSN7ZAXG.js";import"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as g,Bd as I,Cd as O,Da as s,Ea as l,Eb as w,G as F,Gb as P,Gc as C,Hc as x,Sb as a,Tb as m,Ub as b,Yb as S,Z as T,bc as o,ea as M,jb as u,kb as h,nc as f,pa as N,rc as v,sc as y,ta as E,tc as D,uc as R,vc as L,vd as A,yd as B}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";function te(r,c){if(r&1){let i=S();a(0,"button",15),g("click",function(){s(i);let e=o().ngIf,n=o(2);return l(n.onUpdateItems(e))}),b(1,"i",16),f(2," Update "),m()}}function ie(r,c){if(r&1&&(a(0,"div"),w(1,te,3,0,"button",14),m()),r&2){let i=c.ngIf,t=o(2);u(),P("ngIf",t.productService.hasSelectionVariant(i))}}function ne(r,c){if(r&1){let i=S();a(0,"mainpanel",1),g("onSubmit",function(e){s(i);let n=o();return l(n.onSearch(e))}),a(1,"actions")(2,"div",2),w(3,ie,2,1,"div",3),C(4,"async"),a(5,"button",4),g("click",function(){s(i);let e=o();return l(e.openExportDialog())}),b(6,"i",5),a(7,"span"),f(8,"Export"),m()()()(),a(9,"filters")(10,"div")(11,"label",6),f(12,"Page Number"),m(),a(13,"input",7),D("ngModelChange",function(e){s(i);let n=o();return y(n.searchFilter.PageNumber,e)||(n.searchFilter.PageNumber=e),l(e)}),m()(),a(14,"div",8)(15,"label",6),f(16,"Page Size"),m(),a(17,"input",7),D("ngModelChange",function(e){s(i);let n=o();return y(n.searchFilter.RowCount,e)||(n.searchFilter.RowCount=e),l(e)}),m()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),C(23,"async"),g("onToggle",function(e){s(i);let n=o();return l(n.onShowDifferencePrice(e))})("onSubmit",function(e){s(i);let n=o();return l(n.updatePriceByVariant(e))}),m(),a(24,"infinite-paginator",13),C(25,"async"),g("onNextPage",function(){s(i);let e=o();return l(e.infinitePagination.onNextPage(e.searchFilter))})("onLastPage",function(){s(i);let e=o();return l(e.infinitePagination.onLastPage(e.searchFilter))})("onGetRowCount",function(){s(i);let e=o();return l(e.infinitePagination.getRowCount(e.searchFilter))}),m()()()()()()}if(r&2){let i=o();P("textButton","Search"),u(3),P("ngIf",x(4,14,i.data$)),u(10),v("ngModel",i.searchFilter.PageNumber),u(4),v("ngModel",i.searchFilter.RowCount),u(5),P("showProductToggle",!0)("data",x(23,16,i.data$))("channel",i.channelOptions)("hiddenIPOSInventory",!1),u(2),P("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",x(25,18,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var ve=(()=>{let c=class c{constructor(t,e,n,_,d,p){this.http=t,this.toastr=e,this.dialog=n,this.productService=_,this.authService=d,this.decimalPipe=p,this.infinitePagination=N(V),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(M(t=>{t.Filter={PageNumber:t.Filter.PageNumber,RowCount:t.Filter.RowCount,filterModel:1},this.searchFilter=t.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(t){this.searchFilter.filterModel=1,t&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(t){this.searchFilter.text=t,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(t){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let _=e.map(p=>({ID:p.ID,Code:p.Code,Price:p.UnitPrice}));var n=this.channelOptions.filter(p=>p.selected).map(p=>p.ID);let d={ListChannelID:n,ListPrice:_};this.http.post("/api/Price/UpdateChannel",d).subscribe(p=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+d.ListPrice.length+" items in "+d.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(t){let e={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:t.Price-0,VariantID:t.ID};this.http.post("/api/Price/UpdatePriceByID",e).subscribe(n=>{let _=this.productService.findChannelById(e.ID,this.channelOptions),d=e.Price?this.decimalPipe.transform(e.Price):e.Price;this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") price in "+_.Name+" to "+d,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(t){let e=this.productService.selectedVariantProduct(t);this.dialog.open(Y,{data:{title:"Updating Price",selectedItems:e,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(F(n=>n!==void 0)).subscribe(n=>{this.channelOptions=n,this.updatePrice(t)})}openExportDialog(){this.dialog.open(X,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}};c.\u0275fac=function(e){return new(e||c)(h(H),h($),h(z),h(Q),h(q),h(I))},c.\u0275cmp=E({type:c,selectors:[["app-price-pos-channel"]],standalone:!0,features:[R([V,I]),L],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(e,n){e&1&&(w(0,ne,26,20,"mainpanel",0),C(1,"async")),e&2&&P("ngIf",x(1,1,n.loader$))},dependencies:[O,A,B,W,U,G,j,k,ee,K,J,Z],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let r=c;return r})();export{ve as PricePosChannelComponent};
1
+ import{a as Z}from"./chunk-H4I5VT2Y.js";import{a as Y}from"./chunk-7LZ5ZSXM.js";import{b as ee,c as V}from"./chunk-7XUSMPAA.js";import"./chunk-BVIRHZTZ.js";import{b as X}from"./chunk-S2Z3ZGU7.js";import"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-JXTGH22T.js";import"./chunk-GCKSYCMI.js";import{a as Q}from"./chunk-ZQWAIH5X.js";import"./chunk-ADRVUMMW.js";import"./chunk-LUY3WZJE.js";import"./chunk-HCDKYABV.js";import{j as q}from"./chunk-YVN2BEFU.js";import{b as $,e as H}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{d as z,m as J,n as K}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as U,h as j,m as k,o as G,y as W}from"./chunk-BSN7ZAXG.js";import"./chunk-47DMD3UG.js";import"./chunk-OVEJFFL6.js";import{$b as g,Bd as I,Cd as O,Da as s,Ea as l,Eb as w,G as F,Gb as P,Gc as C,Hc as x,Sb as a,Tb as m,Ub as b,Yb as S,Z as T,bc as o,ea as M,jb as u,kb as h,nc as f,pa as N,rc as v,sc as y,ta as E,tc as D,uc as R,vc as L,vd as A,yd as B}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";function te(r,c){if(r&1){let i=S();a(0,"button",15),g("click",function(){s(i);let e=o().ngIf,n=o(2);return l(n.onUpdateItems(e))}),b(1,"i",16),f(2," Update "),m()}}function ie(r,c){if(r&1&&(a(0,"div"),w(1,te,3,0,"button",14),m()),r&2){let i=c.ngIf,t=o(2);u(),P("ngIf",t.productService.hasSelectionVariant(i))}}function ne(r,c){if(r&1){let i=S();a(0,"mainpanel",1),g("onSubmit",function(e){s(i);let n=o();return l(n.onSearch(e))}),a(1,"actions")(2,"div",2),w(3,ie,2,1,"div",3),C(4,"async"),a(5,"button",4),g("click",function(){s(i);let e=o();return l(e.openExportDialog())}),b(6,"i",5),a(7,"span"),f(8,"Export"),m()()()(),a(9,"filters")(10,"div")(11,"label",6),f(12,"Page Number"),m(),a(13,"input",7),D("ngModelChange",function(e){s(i);let n=o();return y(n.searchFilter.PageNumber,e)||(n.searchFilter.PageNumber=e),l(e)}),m()(),a(14,"div",8)(15,"label",6),f(16,"Page Size"),m(),a(17,"input",7),D("ngModelChange",function(e){s(i);let n=o();return y(n.searchFilter.RowCount,e)||(n.searchFilter.RowCount=e),l(e)}),m()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),C(23,"async"),g("onToggle",function(e){s(i);let n=o();return l(n.onShowDifferencePrice(e))})("onSubmit",function(e){s(i);let n=o();return l(n.updatePriceByVariant(e))}),m(),a(24,"infinite-paginator",13),C(25,"async"),g("onNextPage",function(){s(i);let e=o();return l(e.infinitePagination.onNextPage(e.searchFilter))})("onLastPage",function(){s(i);let e=o();return l(e.infinitePagination.onLastPage(e.searchFilter))})("onGetRowCount",function(){s(i);let e=o();return l(e.infinitePagination.getRowCount(e.searchFilter))}),m()()()()()()}if(r&2){let i=o();P("textButton","Search"),u(3),P("ngIf",x(4,14,i.data$)),u(10),v("ngModel",i.searchFilter.PageNumber),u(4),v("ngModel",i.searchFilter.RowCount),u(5),P("showProductToggle",!0)("data",x(23,16,i.data$))("channel",i.channelOptions)("hiddenIPOSInventory",!1),u(2),P("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",x(25,18,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var ve=(()=>{let c=class c{constructor(t,e,n,_,d,p){this.http=t,this.toastr=e,this.dialog=n,this.productService=_,this.authService=d,this.decimalPipe=p,this.infinitePagination=N(V),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(M(t=>{t.Filter={PageNumber:t.Filter.PageNumber,RowCount:t.Filter.RowCount,filterModel:1},this.searchFilter=t.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(t){this.searchFilter.filterModel=1,t&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(t){this.searchFilter.text=t,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(t){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let _=e.map(p=>({ID:p.ID,Code:p.Code,Price:p.UnitPrice}));var n=this.channelOptions.filter(p=>p.selected).map(p=>p.ID);let d={ListChannelID:n,ListPrice:_};this.http.post("/api/Price/UpdateChannel",d).subscribe(p=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+d.ListPrice.length+" items in "+d.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(t){let e={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:t.Price-0,VariantID:t.ID};this.http.post("/api/Price/UpdatePriceByID",e).subscribe(n=>{let _=this.productService.findChannelById(e.ID,this.channelOptions),d=e.Price?this.decimalPipe.transform(e.Price):e.Price;this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") price in "+_.Name+" to "+d,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(t){let e=this.productService.selectedVariantProduct(t);this.dialog.open(Y,{data:{title:"Updating Price",selectedItems:e,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(F(n=>n!==void 0)).subscribe(n=>{this.channelOptions=n,this.updatePrice(t)})}openExportDialog(){this.dialog.open(X,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}};c.\u0275fac=function(e){return new(e||c)(h(H),h($),h(z),h(Q),h(q),h(I))},c.\u0275cmp=E({type:c,selectors:[["app-price-pos-channel"]],standalone:!0,features:[R([V,I]),L],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(e,n){e&1&&(w(0,ne,26,20,"mainpanel",0),C(1,"async")),e&2&&P("ngIf",x(1,1,n.loader$))},dependencies:[O,A,B,W,U,G,j,k,ee,K,J,Z],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let r=c;return r})();export{ve as PricePosChannelComponent};
@@ -1,2 +1,2 @@
1
- import{a as me}from"./chunk-MY4B7K3R.js";import{a as le,b as ce,c as V,d as pe,e as se,j as h}from"./chunk-FGPSBTFS.js";import{b as de,c as O}from"./chunk-ADRVUMMW.js";import{b as oe,c as E}from"./chunk-FMV4LYKN.js";import{a as ae,b as ne,f as re,g as S}from"./chunk-HCDKYABV.js";import{M as te,N as T,O as ie,P as x}from"./chunk-E5GGIVK7.js";import{a as Z}from"./chunk-BSN7ZAXG.js";import{c as ee}from"./chunk-64G3XLI6.js";import{$b as u,Ca as N,Cd as I,Da as p,Ea as s,Eb as _,Fb as R,Gb as r,Gc as K,Hb as A,Hc as Q,Pa as P,Sb as c,Tb as f,Ub as C,Vb as z,Wb as $,Yb as y,Zc as W,bc as b,ca as j,ec as U,f as B,g as Y,ja as L,jb as o,ka as M,kb as m,mc as F,nc as G,oc as q,ta as v,ua as D,uc as J,vd as w,yd as X}from"./chunk-PQDPS2ID.js";var H=(()=>{let e=class e{constructor(){this._calendarHeaderConfig=new Y({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(t){this._calendarHeaderConfig.next(t)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=L({token:e,factory:e.\u0275fac,providedIn:"root"});let a=e;return a})();var ye=["class","component ts"];function be(a,e){if(a&1){let d=y();c(0,"button",3),u("click",function(){p(d);let i=b(2);return s(i.todayClicked())}),C(1,"i",4),f()}}function ke(a,e){if(a&1){let d=y();c(0,"button",5),u("click",function(){p(d);let i=b(2);return s(i.clearClicked())}),C(1,"i",6),f()}}function Me(a,e){if(a&1&&(z(0),_(1,be,2,0,"button",1)(2,ke,2,0,"button",2),$()),a&2){let d=e.ngIf;o(),r("ngIf",!d.hideBtnToday),o(),r("ngIf",!d.hideBtnClear)}}var he=(()=>{let e=class e{constructor(t,i,n,l,g){this._datePicker=t,this._calendar=i,this._dateAdapter=n,this.calendarService=l,this._destroyed=new B,i.stateChanges.pipe(j(this._destroyed)).subscribe(k=>g.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(t){this._calendar.ngOnChanges(t)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}};e.\u0275fac=function(i){return new(i||e)(m(V),m(ce),m(T),m(H),m(W))},e.\u0275cmp=v({type:e,selectors:[["POS-DatepickerHeader",8,"component","ts"]],features:[N],attrs:ye,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(i,n){i&1&&(c(0,"mat-calendar-header"),_(1,Me,3,2,"ng-container",0),K(2,"async"),f()),i&2&&(o(),r("ngIf",Q(2,1,n.calendarConfig$)))},dependencies:[w,oe,le,X],encapsulation:2});let a=e;return a})(),ge=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=D({type:e}),e.\u0275inj=M({providers:[h],imports:[I,E,x,h,S,O]});let a=e;return a})();function ve(a,e){if(a&1&&(c(0,"mat-label",6)(1,"span"),G(2),f()()),a&2){let d=b();r("show",d.placeholder),o(2),q(d.placeholder)}}var De={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},it=(()=>{let e=class e{set hidelClearBtn(t){this.calendarService.setHeaderConfig({hideBtnClear:t,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(t){let i=null;t&&(i=t.toDate(),i.setHours(0,0,0,0)),this.onChange(i),this.dateChange.emit(i)}constructor(t){this.calendarService=t,this.headerComponent=he,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new P,this.minDate=ee.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(t){this.date=t}registerOnChange(t){this.onChange=t}registerOnTouched(t){}setDisabledState(t){this.disabled=t}onOpenDatepicker(){let t=document.getElementById("dropdown-filter");if(t){var i=new bootstrap.Dropdown(t);i&&(i._config.autoClose="inside")}}onCloseDatepicker(){let t=document.getElementById("dropdown-filter");if(t){var i=new bootstrap.Dropdown(t);i&&(i._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}};e.\u0275fac=function(i){return new(i||e)(m(H))},e.\u0275cmp=v({type:e,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},features:[J([{provide:T,useClass:me,deps:[te]},{provide:ie,useValue:De},{provide:Z,multi:!0,useExisting:e}])],decls:6,vars:17,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","",3,"for"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(i,n){if(i&1){let l=y();c(0,"mat-form-field",1),_(1,ve,3,2,"mat-label",2),c(2,"input",3),u("dateChange",function(k){return p(l),s(n.change(k.value))})("click",function(){p(l);let k=F(5);return s(k.open())}),f(),C(3,"mat-datepicker-toggle",4),c(4,"mat-datepicker",5,0),u("opened",function(){return p(l),s(n.onOpenDatepicker())})("closed",function(){return p(l),s(n.onCloseDatepicker())}),f()()}if(i&2){let l=F(5);A("width",n.width||100,"%"),r("disabled",n.disabled)("appearance",n.appearance),o(),r("ngIf",n.isFloatingLabel&&n.placeholder),o(),U("placeholder",n.placeholder||""),r("matDatepicker",l)("min",n.minDateValidation)("max",n.maxDateValidation)("value",n.date==n.minDate?null:n.date)("disabled",n.disabled)("readonly",n.readOnly),R("data-cy",n.data_cy),o(),A("display",n.displayToggle?"unset":"none"),r("for",l),o(),r("calendarHeaderComponent",n.headerComponent)}},dependencies:[w,V,pe,se,re,ae,ne,de],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
1
+ import{a as me}from"./chunk-MY4B7K3R.js";import{a as le,b as ce,c as V,d as pe,e as se,j as h}from"./chunk-FGPSBTFS.js";import{b as de,c as O}from"./chunk-ADRVUMMW.js";import{b as oe,c as E}from"./chunk-FMV4LYKN.js";import{a as ae,b as ne,f as re,g as S}from"./chunk-HCDKYABV.js";import{M as te,N as T,O as ie,P as x}from"./chunk-E5GGIVK7.js";import{a as Z}from"./chunk-BSN7ZAXG.js";import{c as ee}from"./chunk-47DMD3UG.js";import{$b as u,Ca as N,Cd as I,Da as p,Ea as s,Eb as _,Fb as R,Gb as r,Gc as K,Hb as A,Hc as Q,Pa as P,Sb as c,Tb as f,Ub as C,Vb as z,Wb as $,Yb as y,Zc as W,bc as b,ca as j,ec as U,f as B,g as Y,ja as L,jb as o,ka as M,kb as m,mc as F,nc as G,oc as q,ta as v,ua as D,uc as J,vd as w,yd as X}from"./chunk-PQDPS2ID.js";var H=(()=>{let e=class e{constructor(){this._calendarHeaderConfig=new Y({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(t){this._calendarHeaderConfig.next(t)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=L({token:e,factory:e.\u0275fac,providedIn:"root"});let a=e;return a})();var ye=["class","component ts"];function be(a,e){if(a&1){let d=y();c(0,"button",3),u("click",function(){p(d);let i=b(2);return s(i.todayClicked())}),C(1,"i",4),f()}}function ke(a,e){if(a&1){let d=y();c(0,"button",5),u("click",function(){p(d);let i=b(2);return s(i.clearClicked())}),C(1,"i",6),f()}}function Me(a,e){if(a&1&&(z(0),_(1,be,2,0,"button",1)(2,ke,2,0,"button",2),$()),a&2){let d=e.ngIf;o(),r("ngIf",!d.hideBtnToday),o(),r("ngIf",!d.hideBtnClear)}}var he=(()=>{let e=class e{constructor(t,i,n,l,g){this._datePicker=t,this._calendar=i,this._dateAdapter=n,this.calendarService=l,this._destroyed=new B,i.stateChanges.pipe(j(this._destroyed)).subscribe(k=>g.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(t){this._calendar.ngOnChanges(t)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}};e.\u0275fac=function(i){return new(i||e)(m(V),m(ce),m(T),m(H),m(W))},e.\u0275cmp=v({type:e,selectors:[["POS-DatepickerHeader",8,"component","ts"]],features:[N],attrs:ye,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(i,n){i&1&&(c(0,"mat-calendar-header"),_(1,Me,3,2,"ng-container",0),K(2,"async"),f()),i&2&&(o(),r("ngIf",Q(2,1,n.calendarConfig$)))},dependencies:[w,oe,le,X],encapsulation:2});let a=e;return a})(),ge=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=D({type:e}),e.\u0275inj=M({providers:[h],imports:[I,E,x,h,S,O]});let a=e;return a})();function ve(a,e){if(a&1&&(c(0,"mat-label",6)(1,"span"),G(2),f()()),a&2){let d=b();r("show",d.placeholder),o(2),q(d.placeholder)}}var De={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},it=(()=>{let e=class e{set hidelClearBtn(t){this.calendarService.setHeaderConfig({hideBtnClear:t,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(t){let i=null;t&&(i=t.toDate(),i.setHours(0,0,0,0)),this.onChange(i),this.dateChange.emit(i)}constructor(t){this.calendarService=t,this.headerComponent=he,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new P,this.minDate=ee.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(t){this.date=t}registerOnChange(t){this.onChange=t}registerOnTouched(t){}setDisabledState(t){this.disabled=t}onOpenDatepicker(){let t=document.getElementById("dropdown-filter");if(t){var i=new bootstrap.Dropdown(t);i&&(i._config.autoClose="inside")}}onCloseDatepicker(){let t=document.getElementById("dropdown-filter");if(t){var i=new bootstrap.Dropdown(t);i&&(i._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}};e.\u0275fac=function(i){return new(i||e)(m(H))},e.\u0275cmp=v({type:e,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},features:[J([{provide:T,useClass:me,deps:[te]},{provide:ie,useValue:De},{provide:Z,multi:!0,useExisting:e}])],decls:6,vars:17,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","",3,"for"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(i,n){if(i&1){let l=y();c(0,"mat-form-field",1),_(1,ve,3,2,"mat-label",2),c(2,"input",3),u("dateChange",function(k){return p(l),s(n.change(k.value))})("click",function(){p(l);let k=F(5);return s(k.open())}),f(),C(3,"mat-datepicker-toggle",4),c(4,"mat-datepicker",5,0),u("opened",function(){return p(l),s(n.onOpenDatepicker())})("closed",function(){return p(l),s(n.onCloseDatepicker())}),f()()}if(i&2){let l=F(5);A("width",n.width||100,"%"),r("disabled",n.disabled)("appearance",n.appearance),o(),r("ngIf",n.isFloatingLabel&&n.placeholder),o(),U("placeholder",n.placeholder||""),r("matDatepicker",l)("min",n.minDateValidation)("max",n.maxDateValidation)("value",n.date==n.minDate?null:n.date)("disabled",n.disabled)("readonly",n.readOnly),R("data-cy",n.data_cy),o(),A("display",n.displayToggle?"unset":"none"),r("for",l),o(),r("calendarHeaderComponent",n.headerComponent)}},dependencies:[w,V,pe,se,re,ae,ne,de],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
2
2
  `],encapsulation:2});let a=e;return a})(),at=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=D({type:e}),e.\u0275inj=M({providers:[h],imports:[I,E,x,h,S,O,ge]});let a=e;return a})();export{it as a,at as b};
@@ -1,4 +1,4 @@
1
- import{h as u}from"./chunk-QK46N4UF.js";import{b as h,e as g}from"./chunk-E3NPUJ23.js";import{ja as l,oa as c}from"./chunk-PQDPS2ID.js";var v=(()=>{let a=class a{constructor(r,t){this.toastrService=r,this.http=t}refreshInventory(r){let t=r.map(e=>e.Channel.map(n=>(n.VariantID=e.ID,n))).reduce((e,s)=>(e=e.concat(s),e),[]).map(e=>({ChannelItemID:e.ChannelItemID,ChannelID:e.ChannelID,VariantID:e.VariantID,ChannelVariationID:e.ChannelVariationID}));return this.http.post(u.RefreshInventory,t)}showToastrUpdateInventory(r,t,e){let s=t.length>0,n=e.length>0;if(!n&&s&&this.toastrService.success(`${this.generateSuccessMessage(t.length)}`,"Success",{enableHtml:!0}),n&&s){let o=`<li>${this.generateSuccessMessage(t.length)}</li>`,m=this.generateErrorMessage(r,e),p=`<ol>${o} ${m}</ol>`;this.toastrService.warning(p,"Warning",{enableHtml:!0})}if(n&&!s){let o=`<ol>${this.generateErrorMessage(r,e)}</ol>`;this.toastrService.error(o,"Error",{enableHtml:!0})}}generateSuccessMessage(r){return`
1
+ import{h as u}from"./chunk-YVN2BEFU.js";import{b as h,e as g}from"./chunk-E3NPUJ23.js";import{ja as l,oa as c}from"./chunk-PQDPS2ID.js";var v=(()=>{let a=class a{constructor(r,t){this.toastrService=r,this.http=t}refreshInventory(r){let t=r.map(e=>e.Channel.map(n=>(n.VariantID=e.ID,n))).reduce((e,s)=>(e=e.concat(s),e),[]).map(e=>({ChannelItemID:e.ChannelItemID,ChannelID:e.ChannelID,VariantID:e.VariantID,ChannelVariationID:e.ChannelVariationID}));return this.http.post(u.RefreshInventory,t)}showToastrUpdateInventory(r,t,e){let s=t.length>0,n=e.length>0;if(!n&&s&&this.toastrService.success(`${this.generateSuccessMessage(t.length)}`,"Success",{enableHtml:!0}),n&&s){let o=`<li>${this.generateSuccessMessage(t.length)}</li>`,m=this.generateErrorMessage(r,e),p=`<ol>${o} ${m}</ol>`;this.toastrService.warning(p,"Warning",{enableHtml:!0})}if(n&&!s){let o=`<ol>${this.generateErrorMessage(r,e)}</ol>`;this.toastrService.error(o,"Error",{enableHtml:!0})}}generateSuccessMessage(r){return`
2
2
  <div>
3
3
  <span class="fw-bold">Successfully</span> updated ${r} variants in 1 channels
4
4
  </div>