marketplacepos 3.6.0 → 3.6.1

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 (76) hide show
  1. package/Marketplace/{chunk-YBAPXY6T.js → chunk-2RLPLX7Y.js} +1 -1
  2. package/Marketplace/{chunk-I7PLLVEH.js → chunk-3BUKJ3GE.js} +1 -1
  3. package/Marketplace/{chunk-BUG6II55.js → chunk-3HICANYR.js} +1 -1
  4. package/Marketplace/{chunk-V752HOUZ.js → chunk-3IPEE6XU.js} +1 -1
  5. package/Marketplace/{chunk-MGVAWFYU.js → chunk-3TYJJ4PH.js} +1 -1
  6. package/Marketplace/{chunk-KDJNHDU2.js → chunk-57VLIKXW.js} +1 -1
  7. package/Marketplace/{chunk-2GUSUJKR.js → chunk-5UQ6DL4O.js} +1 -1
  8. package/Marketplace/{chunk-W7OIIPRU.js → chunk-5YXFGJWF.js} +1 -1
  9. package/Marketplace/{chunk-UTSC6PL6.js → chunk-62X5EPZO.js} +1 -1
  10. package/Marketplace/{chunk-R2U2NYVL.js → chunk-65GLFXG6.js} +1 -1
  11. package/Marketplace/{chunk-3KJSV75O.js → chunk-6HV56KCT.js} +1 -1
  12. package/Marketplace/{chunk-2FZAKLVH.js → chunk-7ECA4R7M.js} +1 -1
  13. package/Marketplace/{chunk-53K2CWAN.js → chunk-BM333QLQ.js} +1 -1
  14. package/Marketplace/{chunk-KTPCOMZ2.js → chunk-CB4N4KBQ.js} +1 -1
  15. package/Marketplace/{chunk-JGYSNRH6.js → chunk-CN572N3D.js} +1 -1
  16. package/Marketplace/{chunk-DKPFXQNF.js → chunk-DIKDR4YZ.js} +1 -1
  17. package/Marketplace/{chunk-M3XCT7JY.js → chunk-DIZIHPEZ.js} +1 -1
  18. package/Marketplace/{chunk-SFDY7NUA.js → chunk-DM4BNQ56.js} +1 -1
  19. package/Marketplace/{chunk-3G5KO3TI.js → chunk-DOLAZVBK.js} +1 -1
  20. package/Marketplace/{chunk-CIGF5YG5.js → chunk-E2YL3IRQ.js} +1 -1
  21. package/Marketplace/chunk-EBCG45QS.js +1 -0
  22. package/Marketplace/{chunk-JWESCPR3.js → chunk-EM7B4QFY.js} +1 -1
  23. package/Marketplace/{chunk-IM6ZDC7I.js → chunk-ESASEBJL.js} +1 -1
  24. package/Marketplace/{chunk-IOUI2FZD.js → chunk-F6CH4W4K.js} +1 -1
  25. package/Marketplace/{chunk-WNUGQVRM.js → chunk-FBFTM65H.js} +1 -1
  26. package/Marketplace/{chunk-FTYEJYHR.js → chunk-FTADFHBJ.js} +1 -1
  27. package/Marketplace/{chunk-7ARC4G4F.js → chunk-ID64YY33.js} +1 -1
  28. package/Marketplace/{chunk-MIAEM23L.js → chunk-IFNRKVC7.js} +1 -1
  29. package/Marketplace/{chunk-QC4HQRFC.js → chunk-IQE4BJBW.js} +1 -1
  30. package/Marketplace/{chunk-NEAQH3FX.js → chunk-IWJP53WS.js} +1 -1
  31. package/Marketplace/{chunk-YK6VKTWV.js → chunk-IZUH3SMQ.js} +1 -1
  32. package/Marketplace/{chunk-JUIDNG6B.js → chunk-JHMIIA36.js} +1 -1
  33. package/Marketplace/{chunk-IPSBLHOU.js → chunk-JVBBWG5A.js} +1 -1
  34. package/Marketplace/{chunk-FBU5QXHN.js → chunk-JWHHOF7N.js} +1 -1
  35. package/Marketplace/{chunk-YS2YJHB3.js → chunk-K3FE6RKY.js} +1 -1
  36. package/Marketplace/chunk-KH5TJAAO.js +1 -0
  37. package/Marketplace/{chunk-233MWU5I.js → chunk-MH5CTSJJ.js} +2 -2
  38. package/Marketplace/{chunk-Q2ZCP6BL.js → chunk-MQ5HS343.js} +1 -1
  39. package/Marketplace/{chunk-ZVELVZIL.js → chunk-NR7MA7GM.js} +1 -1
  40. package/Marketplace/{chunk-MLMGMDJA.js → chunk-OJCFIUAX.js} +1 -1
  41. package/Marketplace/{chunk-VX5ROJLM.js → chunk-OPU2YPBG.js} +1 -1
  42. package/Marketplace/{chunk-ISJRZPJX.js → chunk-PB2YK3UZ.js} +1 -1
  43. package/Marketplace/{chunk-3ZNOGHL3.js → chunk-PBKWYSXQ.js} +1 -1
  44. package/Marketplace/{chunk-MBHOZDLB.js → chunk-PSCYH4CH.js} +1 -1
  45. package/Marketplace/{chunk-6YFZBURX.js → chunk-PX3OVSRI.js} +1 -1
  46. package/Marketplace/{chunk-SY5WIR62.js → chunk-Q3NI4SVW.js} +3 -3
  47. package/Marketplace/{chunk-35GLPUIA.js → chunk-RNJKRELB.js} +1 -1
  48. package/Marketplace/{chunk-V3NJFGV3.js → chunk-S3Y5M733.js} +1 -1
  49. package/Marketplace/{chunk-NAXDUEX4.js → chunk-SLBDXT7U.js} +1 -1
  50. package/Marketplace/{chunk-ZXU3FVPS.js → chunk-SS2IUYMS.js} +1 -1
  51. package/Marketplace/{chunk-37HLVAAU.js → chunk-TVWXXVHW.js} +1 -1
  52. package/Marketplace/{chunk-PUSB4EIC.js → chunk-TWJIQ2V4.js} +1 -1
  53. package/Marketplace/{chunk-K5FAZTRK.js → chunk-TZXECYID.js} +1 -1
  54. package/Marketplace/{chunk-AO2MXRCQ.js → chunk-UI3GOMJ2.js} +1 -1
  55. package/Marketplace/{chunk-Q6Y22NLN.js → chunk-UX7T6RMC.js} +1 -1
  56. package/Marketplace/{chunk-HEYRRICW.js → chunk-V3FRKQJE.js} +1 -1
  57. package/Marketplace/{chunk-4TY6WDXS.js → chunk-VQDYKADM.js} +1 -1
  58. package/Marketplace/{chunk-G4PZ5CPL.js → chunk-VZVPXWTV.js} +1 -1
  59. package/Marketplace/{chunk-PP4T4PLJ.js → chunk-WQRVB6GT.js} +1 -1
  60. package/Marketplace/{chunk-UTRK7TTD.js → chunk-X5D5XIEG.js} +1 -1
  61. package/Marketplace/{chunk-5LICD27P.js → chunk-XC47PR7D.js} +1 -1
  62. package/Marketplace/{chunk-SUY2H7ZI.js → chunk-YXUQSGJI.js} +1 -1
  63. package/Marketplace/{chunk-HVNMMTYL.js → chunk-ZBHZ3ASR.js} +1 -1
  64. package/Marketplace/{chunk-2Y66HZFD.js → chunk-ZJLKBG2A.js} +1 -1
  65. package/Marketplace/index.html +2 -2
  66. package/Marketplace/{main-ICOUGZTS.js → main-I4YQBPAL.js} +1 -1
  67. package/Marketplace/{styles-XDRE2JJC.css → styles-WYF4ASPA.css} +1 -1
  68. package/package.json +1 -1
  69. package/Marketplace/chunk-E64JNFG7.js +0 -1
  70. package/Marketplace/chunk-UWU5GEHX.js +0 -1
  71. /package/Marketplace/{chunk-6HLIRI7N.js → chunk-4CWATSUN.js} +0 -0
  72. /package/Marketplace/{chunk-ZLME6FEU.js → chunk-FRY56U37.js} +0 -0
  73. /package/Marketplace/{chunk-6RUGKYFT.js → chunk-GLK7UGZJ.js} +0 -0
  74. /package/Marketplace/{chunk-V6VYUZWG.js → chunk-KIP3CH3J.js} +0 -0
  75. /package/Marketplace/{chunk-KPTAVWMG.js → chunk-NFCTGNSM.js} +0 -0
  76. /package/Marketplace/{polyfills-L2ZK4WXQ.js → polyfills-FX2Y3WMH.js} +0 -0
@@ -1 +1 @@
1
- import{a as R}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MBHOZDLB.js";import{t as N,u as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-IM6ZDC7I.js";import{u as F}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6YFZBURX.js";import{c as V}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-KPTAVWMG.js";import{$a as m,Fa as i,Ga as T,Ja as w,Lb as I,Na as Z,Oa as c,Ua as s,Xb as O,Za as a,Zb as U,_a as l,_b as B,ab as x,bb as v,db as C,ea as k,fc as D,hb as f,ic as $,ja as _,jb as p,ka as h,mb as j,ob as P,pb as g,qb as b,rb as S,sb as L,ub as M,wb as y,za as u}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MGVAWFYU.js";function q(e,o){if(e&1){let t=C();x(0),a(1,"img",19),f("click",function(n){_(t);let d=p();return h(d.openBiggerPicture(n))}),l(),v()}if(e&2){let t=p();i(1),c("src",t.image,u)}}function G(e,o){e&1&&m(0,"img",20)}function Q(e,o){if(e&1&&(x(0),a(1,"span",24)(2,"a",25),m(3,"i",26),l()(),v()),e&2){let t=p(2);i(2),c("href",t.redirectUrl,u)}}function X(e,o){if(e&1&&(a(0,"div",21),m(1,"i",22),a(2,"span"),g(3),l(),s(4,Q,4,1,"ng-container",23),l()),e&2){let t=p();i(3),b(t.code),i(1),c("ngIf",t.code!=="SKU not assigned"&&t.showRedirectIcon)}}function Y(e,o){if(e&1){let t=C();a(0,"div",27),f("click",function(){_(t);let n=p();return h(n.onEventDesc())}),m(1,"i",28),a(2,"span"),g(3),l()()}if(e&2){let t=p();i(3),b(t.description)}}function ee(e,o){if(e&1){let t=C();a(0,"div",29)(1,"input",30),f("change",function(n){_(t);let d=p();return h(d.onCheck(n.target.checked))}),l()()}}function te(e,o){if(e&1){let t=C();a(0,"button",31),f("click",function(){_(t);let n=p();return h(n.onDownload())}),m(1,"i",32),g(2," Download "),l()}}function ne(e,o){if(e&1){let t=C();a(0,"button",31),f("click",function(){_(t);let n=p();return h(n.onUpload())}),m(1,"i",33),g(2," Upload "),l()}}function ie(e,o){if(e&1){let t=C();a(0,"button",34),f("click",function(){_(t);let n=p();return h(n.onScan())}),m(1,"i",35),g(2," Scan "),l()}}var oe=e=>({"me-3":e});function re(e,o){if(e&1&&(x(0),a(1,"a",37),m(2,"img",38),l(),v()),e&2){let t=o.$implicit,r=o.index,n=p(2);i(1),j("href",t.Url,u),i(1),c("ngClass",y(4,oe,r!=n.channels.length-1))("src",n.getChannelLogo(t),u)("matTooltip",t.Title?t.Title:t.Name)}}function ae(e,o){if(e&1&&(x(0),s(1,re,3,6,"ng-container",36),v()),e&2){let t=p();i(1),c("ngForOf",t.channels)}}var ce=e=>({"border-bottom pb-2":e});function le(e,o){if(e&1&&(a(0,"li")(1,"div",42)(2,"div",43)(3,"a",37),m(4,"img",44),a(5,"span",45),g(6),l()()()()()),e&2){let t=o.$implicit,r=o.index,n=p(2);i(2),c("ngClass",y(4,ce,r!=n.channels.length-1)),i(1),c("href",t.Url,u),i(1),c("src",n.getChannelLogo(t),u),i(2),b(t.Title)}}function de(e,o){if(e&1&&(a(0,"div",39)(1,"button",40),g(2),l(),a(3,"ul",41),s(4,le,7,6,"li",36),l()()),e&2){let t=p();i(2),S(" ",t.channels.length," CHANNELS "),i(2),c("ngForOf",t.channels)}}var Se=(()=>{let o=class o{constructor(r){this.biggerPictureService=r,this.uploadButton=!1,this.scanButton=!1,this.showCheckBox=!1,this.downloadButton=!1,this.hasZoom=!0,this.showRedirectIcon=!0,this.onUploadEvent=new w,this.onScanEvent=new w,this.checkBoxChange=new w,this.onDescEvent=new w,this.onDownloadEvent=new w}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()}getChannelLogo(r){return V.getChannelLogoByTypeId(r.TypeID)}openBiggerPicture(r){this.biggerPictureService.openBiggerPicture(r,this.imageForZoom)}};o.\u0275fac=function(n){return new(n||o)(T(R))},o.\u0275cmp=k({type:o,selectors:[["app-product-card"]],inputs:{productId:"productId",uploadButton:"uploadButton",scanButton:"scanButton",showCheckBox:"showCheckBox",downloadButton:"downloadButton",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"},standalone:!0,features:[M],decls:26,vars:11,consts:[[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"],["elsePic",""],[1,"col-7","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle","cursor-pointer",3,"click"],["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)"],["class","fs-6 btn btn-light btn-sm me-3",3,"click",4,"ngIf"],["class","fs-6 btn btn-light btn-sm",3,"click",4,"ngIf"],["DROPDOWN",""],[1,"rounded","imgUpload","float-left",3,"src","click"],["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,"fas","fa-external-link-alt"],[1,"description","cursor-pointer",3,"click"],[1,"fa","fa-tag","me-2"],[1,"text-end","gx-0"],["type","checkbox",3,"change"],[1,"fs-6","btn","btn-light","btn-sm","me-3",3,"click"],["aria-hidden","true",1,"fa","fa-download"],["aria-hidden","true",1,"fa","fa-upload"],[1,"fs-6","btn","btn-light","btn-sm",3,"click"],[1,"fa","fa-spinner"],[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,d){if(n&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),s(6,q,2,1,"ng-container",6)(7,G,1,0,"ng-template",null,7,I),l()()(),a(9,"div",8)(10,"h4",9),f("click",function(){return d.onEventDesc()}),g(11),l(),s(12,X,5,2,"div",10)(13,Y,4,1,"div",11),l(),a(14,"div",12)(15,"div",13),s(16,ee,2,0,"div",14),l()()()(),a(17,"div",15)(18,"div"),s(19,te,3,0,"button",16)(20,ne,3,0,"button",16)(21,ie,3,0,"button",17),l(),a(22,"div"),s(23,ae,2,1,"ng-container",6)(24,de,5,2,"ng-template",null,18,I),l()()()),n&2){let E=P(8),A=P(25);i(6),c("ngIf",d.image)("ngIfElse",E),i(5),S(" ",d.title," "),i(1),c("ngIf",d.code),i(1),c("ngIf",d.description),i(3),c("ngIf",d.showCheckBox),i(3),c("ngIf",d.downloadButton),i(1),c("ngIf",d.uploadButton),i(1),c("ngIf",d.scanButton),i(2),c("ngIf",d.channels.length<4)("ngIfElse",A)}},dependencies:[D,O,U,B,F,z,N],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 e=o;return e})();function pe(e,o){if(e&1){let t=C();x(0),a(1,"img",14),f("click",function(n){_(t);let d=p();return h(d.onZoomImage(n))}),l(),v()}if(e&2){let t=p();i(1),c("ngSrc",t.image)("fill",!0)}}function me(e,o){e&1&&m(0,"img",15),e&2&&c("fill",!0)}function se(e,o){if(e&1&&(a(0,"div",16),m(1,"i",17),a(2,"span"),g(3),l()()),e&2){let t=p();i(3),b(t.code)}}var ge=e=>({"border-bottom":e});function ue(e,o){if(e&1&&(x(0),a(1,"div",27)(2,"div",28),g(3),l(),a(4,"div")(5,"a",29),m(6,"i",30),l()()(),v()),e&2){let t=o.$implicit,r=o.index,n=p().$implicit;i(1),c("ngClass",y(4,ge,r!==(n==null?null:n.Variants.length)-1)),i(2),L(" ",t.ProductName," - ",t.Name," "),i(2),c("href",t.URL,u)}}var fe=e=>({"border-bottom-0":e});function _e(e,o){if(e&1&&(a(0,"div",18)(1,"h2",19)(2,"button",20)(3,"div",21),m(4,"img",22),a(5,"span",23),g(6),l()()()(),a(7,"div",24)(8,"div",25),s(9,ue,7,6,"ng-container",26),l()()()),e&2){let t=o.$implicit,r=o.index,n=p();c("ngClass",y(10,fe,n.channels.length-1==r)),i(1),c("id","heading"+r+n.code+n.id),i(1),Z("data-bs-target","#collapse"+r+n.code+n.id)("aria-controls","#collapse"+r+n.code+n.id),i(2),c("src",n.getChannelLogo(t.TypeID),u),i(1),c("matTooltip",(t==null||t.ChannelName==null?null:t.ChannelName.length)>30?t.ChannelName:""),i(1),b(t.ChannelName),i(1),c("id","collapse"+r+n.code+n.id),Z("aria-labelledby","heading"+r+n.code+n.id),i(2),c("ngForOf",t.Variants)}}var Oe=(()=>{let o=class o{constructor(r){this.biggerPictureService=r}getChannelLogo(r){return V.getChannelLogoByTypeId(r)}onZoomImage(r){this.biggerPictureService.openBiggerPicture(r,this.imageForZoom)}};o.\u0275fac=function(n){return new(n||o)(T(R))},o.\u0275cmp=k({type:o,selectors:[["app-duplicate-product-card"]],inputs:{image:"image",imageForZoom:"imageForZoom",title:"title",code:"code",channels:"channels",id:"id"},standalone:!0,features:[M],decls:16,vars:5,consts:[[1,"card"],[1,"card-body","py-6"],[1,"row"],[1,"col-4"],[1,"productUpload_defaultSize","me-2","image-upload"],[1,"imgContainer"],[4,"ngIf","ngIfElse"],["elsePic",""],[1,"col-8","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle"],["class","description",4,"ngIf"],[1,"card-footer",2,"padding-left","0px","padding-right","0px"],["id","accordionParent",1,"accordion","accordion-flush"],["class","accordion-item border-start-0 border-end-0",3,"ngClass",4,"ngFor","ngForOf"],[1,"rounded","imgUpload","float-left","cursor-pointer",3,"ngSrc","fill","click"],["ngSrc","//res.cloudinary.com/pos/image/upload/w_110/POS/Images/Icon/products_thumb.png",1,"rounded","float-left","imgUpload",3,"fill"],[1,"description"],[1,"fa","fa-barcode","me-2"],[1,"accordion-item","border-start-0","border-end-0",3,"ngClass"],[1,"accordion-header",3,"id"],["type","button","data-bs-toggle","collapse","aria-expanded","true",1,"accordion-button","collapsed",2,"height","40px"],[1,"d-flex","align-items-center","justify-content-start","w-100"],["alt","",1,"channel-logo",3,"src"],[1,"fs-4","ps-4","text-ellipsis",2,"max-width","13vw",3,"matTooltip"],["data-bs-parent","#accordionParent",1,"accordion-collapse","collapse",3,"id"],[1,"accordion-body",2,"padding-top","0px","padding-bottom","0px"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","align-items-center","py-4",3,"ngClass"],[1,"text-ellipsis"],["target","_blank",1,"text-secondary",3,"href"],[1,"fa","fa-external-link-alt"]],template:function(n,d){if(n&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),s(6,pe,2,2,"ng-container",6)(7,me,1,1,"ng-template",null,7,I),l()()(),a(9,"div",8)(10,"h4",9),g(11),l(),s(12,se,4,1,"div",10),l()()(),a(13,"div",11)(14,"div",12),s(15,_e,10,12,"div",13),l()()()),n&2){let E=P(8);i(6),c("ngIf",d.image)("ngIfElse",E),i(5),S(" ",d.title," "),i(1),c("ngIf",d.code),i(3),c("ngForOf",d.channels)}},dependencies:[D,O,U,B,F,z,N,$],styles:[`.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}.channel-logo[_ngcontent-%COMP%]{width:18px;height:18px}.accordion-button[_ngcontent-%COMP%]{background-color:#ededed69!important}.accordion-button[_ngcontent-%COMP%]:not(.collapsed){background-color:#ededed69!important;color:#333}.accordion-button[_ngcontent-%COMP%]:after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333333'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e")}.accordion-button[_ngcontent-%COMP%]:focus{box-shadow:none!important}.card[_ngcontent-%COMP%]{margin-bottom:0!important}`]});let e=o;return e})();export{Se as a,Oe as b};
1
+ import{a as R}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-PSCYH4CH.js";import{t as N,u as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-ESASEBJL.js";import{u as F}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-PX3OVSRI.js";import{c as V}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-NFCTGNSM.js";import{$a as m,Fa as i,Ga as T,Ja as w,Lb as I,Na as Z,Oa as c,Ua as s,Xb as O,Za as a,Zb as U,_a as l,_b as B,ab as x,bb as v,db as C,ea as k,fc as D,hb as f,ic as $,ja as _,jb as p,ka as h,mb as j,ob as P,pb as g,qb as b,rb as S,sb as L,ub as M,wb as y,za as u}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-3TYJJ4PH.js";function q(e,o){if(e&1){let t=C();x(0),a(1,"img",19),f("click",function(n){_(t);let d=p();return h(d.openBiggerPicture(n))}),l(),v()}if(e&2){let t=p();i(1),c("src",t.image,u)}}function G(e,o){e&1&&m(0,"img",20)}function Q(e,o){if(e&1&&(x(0),a(1,"span",24)(2,"a",25),m(3,"i",26),l()(),v()),e&2){let t=p(2);i(2),c("href",t.redirectUrl,u)}}function X(e,o){if(e&1&&(a(0,"div",21),m(1,"i",22),a(2,"span"),g(3),l(),s(4,Q,4,1,"ng-container",23),l()),e&2){let t=p();i(3),b(t.code),i(1),c("ngIf",t.code!=="SKU not assigned"&&t.showRedirectIcon)}}function Y(e,o){if(e&1){let t=C();a(0,"div",27),f("click",function(){_(t);let n=p();return h(n.onEventDesc())}),m(1,"i",28),a(2,"span"),g(3),l()()}if(e&2){let t=p();i(3),b(t.description)}}function ee(e,o){if(e&1){let t=C();a(0,"div",29)(1,"input",30),f("change",function(n){_(t);let d=p();return h(d.onCheck(n.target.checked))}),l()()}}function te(e,o){if(e&1){let t=C();a(0,"button",31),f("click",function(){_(t);let n=p();return h(n.onDownload())}),m(1,"i",32),g(2," Download "),l()}}function ne(e,o){if(e&1){let t=C();a(0,"button",31),f("click",function(){_(t);let n=p();return h(n.onUpload())}),m(1,"i",33),g(2," Upload "),l()}}function ie(e,o){if(e&1){let t=C();a(0,"button",34),f("click",function(){_(t);let n=p();return h(n.onScan())}),m(1,"i",35),g(2," Scan "),l()}}var oe=e=>({"me-3":e});function re(e,o){if(e&1&&(x(0),a(1,"a",37),m(2,"img",38),l(),v()),e&2){let t=o.$implicit,r=o.index,n=p(2);i(1),j("href",t.Url,u),i(1),c("ngClass",y(4,oe,r!=n.channels.length-1))("src",n.getChannelLogo(t),u)("matTooltip",t.Title?t.Title:t.Name)}}function ae(e,o){if(e&1&&(x(0),s(1,re,3,6,"ng-container",36),v()),e&2){let t=p();i(1),c("ngForOf",t.channels)}}var ce=e=>({"border-bottom pb-2":e});function le(e,o){if(e&1&&(a(0,"li")(1,"div",42)(2,"div",43)(3,"a",37),m(4,"img",44),a(5,"span",45),g(6),l()()()()()),e&2){let t=o.$implicit,r=o.index,n=p(2);i(2),c("ngClass",y(4,ce,r!=n.channels.length-1)),i(1),c("href",t.Url,u),i(1),c("src",n.getChannelLogo(t),u),i(2),b(t.Title)}}function de(e,o){if(e&1&&(a(0,"div",39)(1,"button",40),g(2),l(),a(3,"ul",41),s(4,le,7,6,"li",36),l()()),e&2){let t=p();i(2),S(" ",t.channels.length," CHANNELS "),i(2),c("ngForOf",t.channels)}}var Se=(()=>{let o=class o{constructor(r){this.biggerPictureService=r,this.uploadButton=!1,this.scanButton=!1,this.showCheckBox=!1,this.downloadButton=!1,this.hasZoom=!0,this.showRedirectIcon=!0,this.onUploadEvent=new w,this.onScanEvent=new w,this.checkBoxChange=new w,this.onDescEvent=new w,this.onDownloadEvent=new w}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()}getChannelLogo(r){return V.getChannelLogoByTypeId(r.TypeID)}openBiggerPicture(r){this.biggerPictureService.openBiggerPicture(r,this.imageForZoom)}};o.\u0275fac=function(n){return new(n||o)(T(R))},o.\u0275cmp=k({type:o,selectors:[["app-product-card"]],inputs:{productId:"productId",uploadButton:"uploadButton",scanButton:"scanButton",showCheckBox:"showCheckBox",downloadButton:"downloadButton",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"},standalone:!0,features:[M],decls:26,vars:11,consts:[[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"],["elsePic",""],[1,"col-7","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle","cursor-pointer",3,"click"],["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)"],["class","fs-6 btn btn-light btn-sm me-3",3,"click",4,"ngIf"],["class","fs-6 btn btn-light btn-sm",3,"click",4,"ngIf"],["DROPDOWN",""],[1,"rounded","imgUpload","float-left",3,"src","click"],["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,"fas","fa-external-link-alt"],[1,"description","cursor-pointer",3,"click"],[1,"fa","fa-tag","me-2"],[1,"text-end","gx-0"],["type","checkbox",3,"change"],[1,"fs-6","btn","btn-light","btn-sm","me-3",3,"click"],["aria-hidden","true",1,"fa","fa-download"],["aria-hidden","true",1,"fa","fa-upload"],[1,"fs-6","btn","btn-light","btn-sm",3,"click"],[1,"fa","fa-spinner"],[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,d){if(n&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),s(6,q,2,1,"ng-container",6)(7,G,1,0,"ng-template",null,7,I),l()()(),a(9,"div",8)(10,"h4",9),f("click",function(){return d.onEventDesc()}),g(11),l(),s(12,X,5,2,"div",10)(13,Y,4,1,"div",11),l(),a(14,"div",12)(15,"div",13),s(16,ee,2,0,"div",14),l()()()(),a(17,"div",15)(18,"div"),s(19,te,3,0,"button",16)(20,ne,3,0,"button",16)(21,ie,3,0,"button",17),l(),a(22,"div"),s(23,ae,2,1,"ng-container",6)(24,de,5,2,"ng-template",null,18,I),l()()()),n&2){let E=P(8),A=P(25);i(6),c("ngIf",d.image)("ngIfElse",E),i(5),S(" ",d.title," "),i(1),c("ngIf",d.code),i(1),c("ngIf",d.description),i(3),c("ngIf",d.showCheckBox),i(3),c("ngIf",d.downloadButton),i(1),c("ngIf",d.uploadButton),i(1),c("ngIf",d.scanButton),i(2),c("ngIf",d.channels.length<4)("ngIfElse",A)}},dependencies:[D,O,U,B,F,z,N],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 e=o;return e})();function pe(e,o){if(e&1){let t=C();x(0),a(1,"img",14),f("click",function(n){_(t);let d=p();return h(d.onZoomImage(n))}),l(),v()}if(e&2){let t=p();i(1),c("ngSrc",t.image)("fill",!0)}}function me(e,o){e&1&&m(0,"img",15),e&2&&c("fill",!0)}function se(e,o){if(e&1&&(a(0,"div",16),m(1,"i",17),a(2,"span"),g(3),l()()),e&2){let t=p();i(3),b(t.code)}}var ge=e=>({"border-bottom":e});function ue(e,o){if(e&1&&(x(0),a(1,"div",27)(2,"div",28),g(3),l(),a(4,"div")(5,"a",29),m(6,"i",30),l()()(),v()),e&2){let t=o.$implicit,r=o.index,n=p().$implicit;i(1),c("ngClass",y(4,ge,r!==(n==null?null:n.Variants.length)-1)),i(2),L(" ",t.ProductName," - ",t.Name," "),i(2),c("href",t.URL,u)}}var fe=e=>({"border-bottom-0":e});function _e(e,o){if(e&1&&(a(0,"div",18)(1,"h2",19)(2,"button",20)(3,"div",21),m(4,"img",22),a(5,"span",23),g(6),l()()()(),a(7,"div",24)(8,"div",25),s(9,ue,7,6,"ng-container",26),l()()()),e&2){let t=o.$implicit,r=o.index,n=p();c("ngClass",y(10,fe,n.channels.length-1==r)),i(1),c("id","heading"+r+n.code+n.id),i(1),Z("data-bs-target","#collapse"+r+n.code+n.id)("aria-controls","#collapse"+r+n.code+n.id),i(2),c("src",n.getChannelLogo(t.TypeID),u),i(1),c("matTooltip",(t==null||t.ChannelName==null?null:t.ChannelName.length)>30?t.ChannelName:""),i(1),b(t.ChannelName),i(1),c("id","collapse"+r+n.code+n.id),Z("aria-labelledby","heading"+r+n.code+n.id),i(2),c("ngForOf",t.Variants)}}var Oe=(()=>{let o=class o{constructor(r){this.biggerPictureService=r}getChannelLogo(r){return V.getChannelLogoByTypeId(r)}onZoomImage(r){this.biggerPictureService.openBiggerPicture(r,this.imageForZoom)}};o.\u0275fac=function(n){return new(n||o)(T(R))},o.\u0275cmp=k({type:o,selectors:[["app-duplicate-product-card"]],inputs:{image:"image",imageForZoom:"imageForZoom",title:"title",code:"code",channels:"channels",id:"id"},standalone:!0,features:[M],decls:16,vars:5,consts:[[1,"card"],[1,"card-body","py-6"],[1,"row"],[1,"col-4"],[1,"productUpload_defaultSize","me-2","image-upload"],[1,"imgContainer"],[4,"ngIf","ngIfElse"],["elsePic",""],[1,"col-8","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle"],["class","description",4,"ngIf"],[1,"card-footer",2,"padding-left","0px","padding-right","0px"],["id","accordionParent",1,"accordion","accordion-flush"],["class","accordion-item border-start-0 border-end-0",3,"ngClass",4,"ngFor","ngForOf"],[1,"rounded","imgUpload","float-left","cursor-pointer",3,"ngSrc","fill","click"],["ngSrc","//res.cloudinary.com/pos/image/upload/w_110/POS/Images/Icon/products_thumb.png",1,"rounded","float-left","imgUpload",3,"fill"],[1,"description"],[1,"fa","fa-barcode","me-2"],[1,"accordion-item","border-start-0","border-end-0",3,"ngClass"],[1,"accordion-header",3,"id"],["type","button","data-bs-toggle","collapse","aria-expanded","true",1,"accordion-button","collapsed",2,"height","40px"],[1,"d-flex","align-items-center","justify-content-start","w-100"],["alt","",1,"channel-logo",3,"src"],[1,"fs-4","ps-4","text-ellipsis",2,"max-width","13vw",3,"matTooltip"],["data-bs-parent","#accordionParent",1,"accordion-collapse","collapse",3,"id"],[1,"accordion-body",2,"padding-top","0px","padding-bottom","0px"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","align-items-center","py-4",3,"ngClass"],[1,"text-ellipsis"],["target","_blank",1,"text-secondary",3,"href"],[1,"fa","fa-external-link-alt"]],template:function(n,d){if(n&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),s(6,pe,2,2,"ng-container",6)(7,me,1,1,"ng-template",null,7,I),l()()(),a(9,"div",8)(10,"h4",9),g(11),l(),s(12,se,4,1,"div",10),l()()(),a(13,"div",11)(14,"div",12),s(15,_e,10,12,"div",13),l()()()),n&2){let E=P(8);i(6),c("ngIf",d.image)("ngIfElse",E),i(5),S(" ",d.title," "),i(1),c("ngIf",d.code),i(3),c("ngForOf",d.channels)}},dependencies:[D,O,U,B,F,z,N,$],styles:[`.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}.channel-logo[_ngcontent-%COMP%]{width:18px;height:18px}.accordion-button[_ngcontent-%COMP%]{background-color:#ededed69!important}.accordion-button[_ngcontent-%COMP%]:not(.collapsed){background-color:#ededed69!important;color:#333}.accordion-button[_ngcontent-%COMP%]:after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333333'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e")}.accordion-button[_ngcontent-%COMP%]:focus{box-shadow:none!important}.card[_ngcontent-%COMP%]{margin-bottom:0!important}`]});let e=o;return e})();export{Se as a,Oe as b};
@@ -1 +1 @@
1
- import{a as A}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-W7OIIPRU.js";import{a as R}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-ZLME6FEU.js";import{b as v,c as y}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-IOUI2FZD.js";import{a as M,b as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-K5FAZTRK.js";import{b,c as x}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-2FZAKLVH.js";import{h as _,k as u}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6YFZBURX.js";import{c as N}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-KPTAVWMG.js";import{$a as k,Fa as r,Ga as d,Oa as a,Ua as C,Za as s,Zb as g,_a as c,db as D,ea as h,hb as p,ja as I,ka as T,pb as f,qb as w,rb as F,za as S}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MGVAWFYU.js";function $(i,n){if(i&1){let m=D();s(0,"li")(1,"mat-checkbox",4),p("ngModelChange",function(e){let l=I(m).$implicit;return T(l.selected=e)}),s(2,"div",5)(3,"h5",6),f(4),c()()()()}if(i&2){let m=n.$implicit;r(1),a("ngModel",m.selected),r(3),w(m.Name)}}var q=(()=>{let n=class n{constructor(o,e){this.data=o,this.dialogRef=e,this.selectedItems=this.data.selectedItems,this.channels=this.data.channels}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new v,this.modalConfig.title="Updating Inventory"}onOk(){this.dialogRef.close(this.channels)}onClose(){this.dialogRef.close()}getSelectedChannel(){return this.channels.filter(o=>o.selected)}};n.\u0275fac=function(e){return new(e||n)(d(O),d(M))},n.\u0275cmp=h({type:n,selectors:[["app-modal-update-channels"]],decls:5,vars:3,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"no-bullet"],[4,"ngFor","ngForOf"],[3,"ngModel","ngModelChange"],[1,"d-flex"],[1,"fw-light","me-2","my-auto"]],template:function(e,t){if(e&1&&(s(0,"modal-material",0),p("onOk",function(){return t.onOk()})("onClose",function(){return t.onClose()})("onCancel",function(){return t.onClose()}),s(1,"div",1)(2,"div")(3,"ul",2),C(4,$,5,2,"li",3),c()()()()),e&2){let l;a("dynamicValidated",((l=t.getSelectedChannel())==null?null:l.length)>0)("config",t.modalConfig),r(4),a("ngForOf",t.channels)}},dependencies:[g,_,u,A,y],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]});let i=n;return i})();function G(i,n){if(i&1&&(s(0,"ng-option",4),k(1,"img",5),f(2),c()),i&2){let m=n.$implicit;a("value",m.ID),r(1),a("src",m.Img,S),r(1),F("",m.Name," ")}}var Z=(()=>{let n=class n{constructor(o,e){this.data=o,this.dialogRef=e,this.channelOptions=o.channelOptions,this.channel=o.selectedChannel?o.selectedChannel:new R}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new v,this.modalConfig.title="Choose Channel",this.modalConfig.customWidth="350px",this.modalConfig.okText="SAVE"}onSelectChannel(o){let e=this.channelOptions.find(t=>t.ID==o);this.channel=e,this.channel&&(this.channel.logo=N.getChannelLogoByTypeId(e.TypeID))}onClose(){this.dialogRef.close()}onOk(){this.dialogRef.close(this.channel)}};n.\u0275fac=function(e){return new(e||n)(d(O),d(M))},n.\u0275cmp=h({type:n,selectors:[["app-modal-choose-channel"]],decls:4,vars:4,consts:[[3,"config","onClose","onCancel","onOk"],["content",""],["appendTo","body",3,"clearable","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(e,t){e&1&&(s(0,"modal-material",0),p("onClose",function(){return t.onClose()})("onCancel",function(){return t.onClose()})("onOk",function(){return t.onOk()}),s(1,"div",1)(2,"ng-select",2),p("ngModelChange",function(U){return t.onSelectChannel(U)}),C(3,G,3,3,"ng-option",3),c()()()),e&2&&(a("config",t.modalConfig),r(2),a("clearable",!1)("ngModel",t.channel.ID),r(1),a("ngForOf",t.channelOptions))},dependencies:[g,_,u,y,x,b]});let i=n;return i})();export{q as a,Z as b};
1
+ import{a as A}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-5YXFGJWF.js";import{a as R}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-FRY56U37.js";import{b as v,c as y}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-F6CH4W4K.js";import{a as M,b as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-TZXECYID.js";import{b,c as x}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-7ECA4R7M.js";import{h as _,k as u}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-PX3OVSRI.js";import{c as N}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-NFCTGNSM.js";import{$a as k,Fa as r,Ga as d,Oa as a,Ua as C,Za as s,Zb as g,_a as c,db as D,ea as h,hb as p,ja as I,ka as T,pb as f,qb as w,rb as F,za as S}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-3TYJJ4PH.js";function $(i,n){if(i&1){let m=D();s(0,"li")(1,"mat-checkbox",4),p("ngModelChange",function(e){let l=I(m).$implicit;return T(l.selected=e)}),s(2,"div",5)(3,"h5",6),f(4),c()()()()}if(i&2){let m=n.$implicit;r(1),a("ngModel",m.selected),r(3),w(m.Name)}}var q=(()=>{let n=class n{constructor(o,e){this.data=o,this.dialogRef=e,this.selectedItems=this.data.selectedItems,this.channels=this.data.channels}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new v,this.modalConfig.title="Updating Inventory"}onOk(){this.dialogRef.close(this.channels)}onClose(){this.dialogRef.close()}getSelectedChannel(){return this.channels.filter(o=>o.selected)}};n.\u0275fac=function(e){return new(e||n)(d(O),d(M))},n.\u0275cmp=h({type:n,selectors:[["app-modal-update-channels"]],decls:5,vars:3,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"no-bullet"],[4,"ngFor","ngForOf"],[3,"ngModel","ngModelChange"],[1,"d-flex"],[1,"fw-light","me-2","my-auto"]],template:function(e,t){if(e&1&&(s(0,"modal-material",0),p("onOk",function(){return t.onOk()})("onClose",function(){return t.onClose()})("onCancel",function(){return t.onClose()}),s(1,"div",1)(2,"div")(3,"ul",2),C(4,$,5,2,"li",3),c()()()()),e&2){let l;a("dynamicValidated",((l=t.getSelectedChannel())==null?null:l.length)>0)("config",t.modalConfig),r(4),a("ngForOf",t.channels)}},dependencies:[g,_,u,A,y],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]});let i=n;return i})();function G(i,n){if(i&1&&(s(0,"ng-option",4),k(1,"img",5),f(2),c()),i&2){let m=n.$implicit;a("value",m.ID),r(1),a("src",m.Img,S),r(1),F("",m.Name," ")}}var Z=(()=>{let n=class n{constructor(o,e){this.data=o,this.dialogRef=e,this.channelOptions=o.channelOptions,this.channel=o.selectedChannel?o.selectedChannel:new R}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new v,this.modalConfig.title="Choose Channel",this.modalConfig.customWidth="350px",this.modalConfig.okText="SAVE"}onSelectChannel(o){let e=this.channelOptions.find(t=>t.ID==o);this.channel=e,this.channel&&(this.channel.logo=N.getChannelLogoByTypeId(e.TypeID))}onClose(){this.dialogRef.close()}onOk(){this.dialogRef.close(this.channel)}};n.\u0275fac=function(e){return new(e||n)(d(O),d(M))},n.\u0275cmp=h({type:n,selectors:[["app-modal-choose-channel"]],decls:4,vars:4,consts:[[3,"config","onClose","onCancel","onOk"],["content",""],["appendTo","body",3,"clearable","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(e,t){e&1&&(s(0,"modal-material",0),p("onClose",function(){return t.onClose()})("onCancel",function(){return t.onClose()})("onOk",function(){return t.onOk()}),s(1,"div",1)(2,"ng-select",2),p("ngModelChange",function(U){return t.onSelectChannel(U)}),C(3,G,3,3,"ng-option",3),c()()()),e&2&&(a("config",t.modalConfig),r(2),a("clearable",!1)("ngModel",t.channel.ID),r(1),a("ngForOf",t.channelOptions))},dependencies:[g,_,u,y,x,b]});let i=n;return i})();export{q as a,Z as b};
@@ -1 +1 @@
1
- import{d as Z,e as $,h as C}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-DKPFXQNF.js";import{J as M,O as q,U,a as _,e as b,h as p,i as w,j as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-JWESCPR3.js";import{e as P,g as O,j as B,n as V}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6YFZBURX.js";import{$ as A,Ba as x,Ga as r,Ka as f,La as N,Na as L,Qa as D,aa as u,ba as T,c as d,ca as y,eb as j,fa as m,ga as E,hb as I,ia as S,j as F,tb as k}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MGVAWFYU.js";var K=z({passive:!0}),G=(()=>{let i=class i{constructor(e,t){this._platform=e,this._ngZone=t,this._monitoredElements=new Map}monitor(e){if(!this._platform.isBrowser)return F;let t=b(e),s=this._monitoredElements.get(t);if(s)return s.subject;let o=new d,a="cdk-text-field-autofilled",c=l=>{l.animationName==="cdk-text-field-autofill-start"&&!t.classList.contains(a)?(t.classList.add(a),this._ngZone.run(()=>o.next({target:l.target,isAutofilled:!0}))):l.animationName==="cdk-text-field-autofill-end"&&t.classList.contains(a)&&(t.classList.remove(a),this._ngZone.run(()=>o.next({target:l.target,isAutofilled:!1})))};return this._ngZone.runOutsideAngular(()=>{t.addEventListener("animationstart",c,K),t.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(t,{subject:o,unlisten:()=>{t.removeEventListener("animationstart",c,K)}}),o}stopMonitoring(e){let t=b(e),s=this._monitoredElements.get(t);s&&(s.unlisten(),s.subject.complete(),t.classList.remove("cdk-text-field-autofill-monitored"),t.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(t))}ngOnDestroy(){this._monitoredElements.forEach((e,t)=>this.stopMonitoring(t))}};i.\u0275fac=function(t){return new(t||i)(y(p),y(f))},i.\u0275prov=A({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();var W=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=m({type:i}),i.\u0275inj=u({});let n=i;return n})();var ie=new T("MAT_INPUT_VALUE_ACCESSOR"),se=["button","checkbox","file","hidden","image","radio","range","reset","submit"],ne=0,re=q(class{constructor(n,i,Y,e){this._defaultErrorStateMatcher=n,this._parentForm=i,this._parentFormGroup=Y,this.ngControl=e,this.stateChanges=new d}}),He=(()=>{let i=class i extends re{get disabled(){return this._disabled}set disabled(e){this._disabled=_(e),this.focused&&(this.focused=!1,this.stateChanges.next())}get id(){return this._id}set id(e){this._id=e||this._uid}get required(){return this._required??this.ngControl?.control?.hasValidator(P.required)??!1}set required(e){this._required=_(e)}get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea&&w().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}get value(){return this._inputValueAccessor.value}set value(e){e!==this.value&&(this._inputValueAccessor.value=e,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(e){this._readonly=_(e)}constructor(e,t,s,o,a,c,l,X,J,R){super(c,o,a,s),this._elementRef=e,this._platform=t,this._autofillMonitor=X,this._formField=R,this._uid=`mat-input-${ne++}`,this.focused=!1,this.stateChanges=new d,this.controlType="mat-input",this.autofilled=!1,this._disabled=!1,this._type="text",this._readonly=!1,this._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(v=>w().has(v)),this._iOSKeyupListener=v=>{let h=v.target;!h.value&&h.selectionStart===0&&h.selectionEnd===0&&(h.setSelectionRange(1,1),h.setSelectionRange(0,0))};let g=this._elementRef.nativeElement,H=g.nodeName.toLowerCase();this._inputValueAccessor=l||g,this._previousNativeValue=this.value,this.id=this.id,t.IOS&&J.runOutsideAngular(()=>{e.nativeElement.addEventListener("keyup",this._iOSKeyupListener)}),this._isServer=!this._platform.isBrowser,this._isNativeSelect=H==="select",this._isTextarea=H==="textarea",this._isInFormField=!!R,this._isNativeSelect&&(this.controlType=g.multiple?"mat-native-select-multiple":"mat-native-select")}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(e=>{this.autofilled=e.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement),this._platform.IOS&&this._elementRef.nativeElement.removeEventListener("keyup",this._iOSKeyupListener)}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==null&&this.ngControl.disabled!==this.disabled&&(this.disabled=this.ngControl.disabled,this.stateChanges.next())),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(e){this._elementRef.nativeElement.focus(e)}_focusChanged(e){e!==this.focused&&(this.focused=e,this.stateChanges.next())}_onInput(){}_dirtyCheckNativeValue(){let e=this._elementRef.nativeElement.value;this._previousNativeValue!==e&&(this._previousNativeValue=e,this.stateChanges.next())}_dirtyCheckPlaceholder(){let e=this._getPlaceholder();if(e!==this._previousPlaceholder){let t=this._elementRef.nativeElement;this._previousPlaceholder=e,e?t.setAttribute("placeholder",e):t.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){se.indexOf(this._type)>-1}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let e=this._elementRef.nativeElement.validity;return e&&e.badInput}get empty(){return!this._isNeverEmpty()&&!this._elementRef.nativeElement.value&&!this._isBadInput()&&!this.autofilled}get shouldLabelFloat(){if(this._isNativeSelect){let e=this._elementRef.nativeElement,t=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&t&&t.label)}else return this.focused||!this.empty}setDescribedByIds(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}_isInlineSelect(){let e=this._elementRef.nativeElement;return this._isNativeSelect&&(e.multiple||e.size>1)}};i.\u0275fac=function(t){return new(t||i)(r(x),r(p),r(O,10),r(B,8),r(V,8),r(U),r(ie,10),r(G),r(f),r($,8))},i.\u0275dir=E({type:i,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:18,hostBindings:function(t,s){t&1&&I("focus",function(){return s._focusChanged(!0)})("blur",function(){return s._focusChanged(!1)})("input",function(){return s._onInput()}),t&2&&(j("id",s.id)("disabled",s.disabled)("required",s.required),L("name",s.name||null)("readonly",s.readonly&&!s._isNativeSelect||null)("aria-invalid",s.empty&&s.required?null:s.errorState)("aria-required",s.required)("id",s.id),D("mat-input-server",s._isServer)("mat-mdc-form-field-textarea-control",s._isInFormField&&s._isTextarea)("mat-mdc-form-field-input-control",s._isInFormField)("mdc-text-field__input",s._isInFormField)("mat-mdc-native-select-inline",s._isInlineSelect()))},inputs:{disabled:"disabled",id:"id",placeholder:"placeholder",name:"name",required:"required",type:"type",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:["aria-describedby","userAriaDescribedBy"],value:"value",readonly:"readonly"},exportAs:["matInput"],features:[k([{provide:Z,useExisting:i}]),N,S]});let n=i;return n})(),Fe=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=m({type:i}),i.\u0275inj=u({imports:[M,C,C,W,M]});let n=i;return n})();export{ie as a,He as b,Fe as c};
1
+ import{d as Z,e as $,h as C}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-DIKDR4YZ.js";import{J as M,O as q,U,a as _,e as b,h as p,i as w,j as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-EM7B4QFY.js";import{e as P,g as O,j as B,n as V}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-PX3OVSRI.js";import{$ as A,Ba as x,Ga as r,Ka as f,La as N,Na as L,Qa as D,aa as u,ba as T,c as d,ca as y,eb as j,fa as m,ga as E,hb as I,ia as S,j as F,tb as k}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-3TYJJ4PH.js";var K=z({passive:!0}),G=(()=>{let i=class i{constructor(e,t){this._platform=e,this._ngZone=t,this._monitoredElements=new Map}monitor(e){if(!this._platform.isBrowser)return F;let t=b(e),s=this._monitoredElements.get(t);if(s)return s.subject;let o=new d,a="cdk-text-field-autofilled",c=l=>{l.animationName==="cdk-text-field-autofill-start"&&!t.classList.contains(a)?(t.classList.add(a),this._ngZone.run(()=>o.next({target:l.target,isAutofilled:!0}))):l.animationName==="cdk-text-field-autofill-end"&&t.classList.contains(a)&&(t.classList.remove(a),this._ngZone.run(()=>o.next({target:l.target,isAutofilled:!1})))};return this._ngZone.runOutsideAngular(()=>{t.addEventListener("animationstart",c,K),t.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(t,{subject:o,unlisten:()=>{t.removeEventListener("animationstart",c,K)}}),o}stopMonitoring(e){let t=b(e),s=this._monitoredElements.get(t);s&&(s.unlisten(),s.subject.complete(),t.classList.remove("cdk-text-field-autofill-monitored"),t.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(t))}ngOnDestroy(){this._monitoredElements.forEach((e,t)=>this.stopMonitoring(t))}};i.\u0275fac=function(t){return new(t||i)(y(p),y(f))},i.\u0275prov=A({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();var W=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=m({type:i}),i.\u0275inj=u({});let n=i;return n})();var ie=new T("MAT_INPUT_VALUE_ACCESSOR"),se=["button","checkbox","file","hidden","image","radio","range","reset","submit"],ne=0,re=q(class{constructor(n,i,Y,e){this._defaultErrorStateMatcher=n,this._parentForm=i,this._parentFormGroup=Y,this.ngControl=e,this.stateChanges=new d}}),He=(()=>{let i=class i extends re{get disabled(){return this._disabled}set disabled(e){this._disabled=_(e),this.focused&&(this.focused=!1,this.stateChanges.next())}get id(){return this._id}set id(e){this._id=e||this._uid}get required(){return this._required??this.ngControl?.control?.hasValidator(P.required)??!1}set required(e){this._required=_(e)}get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea&&w().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}get value(){return this._inputValueAccessor.value}set value(e){e!==this.value&&(this._inputValueAccessor.value=e,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(e){this._readonly=_(e)}constructor(e,t,s,o,a,c,l,X,J,R){super(c,o,a,s),this._elementRef=e,this._platform=t,this._autofillMonitor=X,this._formField=R,this._uid=`mat-input-${ne++}`,this.focused=!1,this.stateChanges=new d,this.controlType="mat-input",this.autofilled=!1,this._disabled=!1,this._type="text",this._readonly=!1,this._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(v=>w().has(v)),this._iOSKeyupListener=v=>{let h=v.target;!h.value&&h.selectionStart===0&&h.selectionEnd===0&&(h.setSelectionRange(1,1),h.setSelectionRange(0,0))};let g=this._elementRef.nativeElement,H=g.nodeName.toLowerCase();this._inputValueAccessor=l||g,this._previousNativeValue=this.value,this.id=this.id,t.IOS&&J.runOutsideAngular(()=>{e.nativeElement.addEventListener("keyup",this._iOSKeyupListener)}),this._isServer=!this._platform.isBrowser,this._isNativeSelect=H==="select",this._isTextarea=H==="textarea",this._isInFormField=!!R,this._isNativeSelect&&(this.controlType=g.multiple?"mat-native-select-multiple":"mat-native-select")}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(e=>{this.autofilled=e.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement),this._platform.IOS&&this._elementRef.nativeElement.removeEventListener("keyup",this._iOSKeyupListener)}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==null&&this.ngControl.disabled!==this.disabled&&(this.disabled=this.ngControl.disabled,this.stateChanges.next())),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(e){this._elementRef.nativeElement.focus(e)}_focusChanged(e){e!==this.focused&&(this.focused=e,this.stateChanges.next())}_onInput(){}_dirtyCheckNativeValue(){let e=this._elementRef.nativeElement.value;this._previousNativeValue!==e&&(this._previousNativeValue=e,this.stateChanges.next())}_dirtyCheckPlaceholder(){let e=this._getPlaceholder();if(e!==this._previousPlaceholder){let t=this._elementRef.nativeElement;this._previousPlaceholder=e,e?t.setAttribute("placeholder",e):t.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){se.indexOf(this._type)>-1}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let e=this._elementRef.nativeElement.validity;return e&&e.badInput}get empty(){return!this._isNeverEmpty()&&!this._elementRef.nativeElement.value&&!this._isBadInput()&&!this.autofilled}get shouldLabelFloat(){if(this._isNativeSelect){let e=this._elementRef.nativeElement,t=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&t&&t.label)}else return this.focused||!this.empty}setDescribedByIds(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}_isInlineSelect(){let e=this._elementRef.nativeElement;return this._isNativeSelect&&(e.multiple||e.size>1)}};i.\u0275fac=function(t){return new(t||i)(r(x),r(p),r(O,10),r(B,8),r(V,8),r(U),r(ie,10),r(G),r(f),r($,8))},i.\u0275dir=E({type:i,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:18,hostBindings:function(t,s){t&1&&I("focus",function(){return s._focusChanged(!0)})("blur",function(){return s._focusChanged(!1)})("input",function(){return s._onInput()}),t&2&&(j("id",s.id)("disabled",s.disabled)("required",s.required),L("name",s.name||null)("readonly",s.readonly&&!s._isNativeSelect||null)("aria-invalid",s.empty&&s.required?null:s.errorState)("aria-required",s.required)("id",s.id),D("mat-input-server",s._isServer)("mat-mdc-form-field-textarea-control",s._isInFormField&&s._isTextarea)("mat-mdc-form-field-input-control",s._isInFormField)("mdc-text-field__input",s._isInFormField)("mat-mdc-native-select-inline",s._isInlineSelect()))},inputs:{disabled:"disabled",id:"id",placeholder:"placeholder",name:"name",required:"required",type:"type",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:["aria-describedby","userAriaDescribedBy"],value:"value",readonly:"readonly"},exportAs:["matInput"],features:[k([{provide:Z,useExisting:i}]),N,S]});let n=i;return n})(),Fe=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=m({type:i}),i.\u0275inj=u({imports:[M,C,C,W,M]});let n=i;return n})();export{ie as a,He as b,Fe as c};
@@ -1 +1 @@
1
- import{$ as f,A as b,E as F,Gb as X,I as L,Ia as q,Ic as Z,Ja as V,L as G,N as y,R as M,T as j,Ta as Q,X as C,aa as K,ba as E,ca as c,d,da as p,fa as N,ga as J,ia as Y,m as g,n as h,q as S,s as m,t as I,w as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MGVAWFYU.js";import{a as l,b as v}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6RUGKYFT.js";var A={REMOVE:"remove",SHOW:"show"},ee=(()=>{let t=class t{constructor(){this.strategiesSource=new d({}),this.strategies$=this.strategiesSource.asObservable()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})(),B=new E("USE_CONFIGURATION_STORE"),$=(()=>{let t=class t{constructor(e=!1,i){this.isolate=e,this.configurationStore=i,this.strategiesSource=this.isolate?new d({}):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,i){this.strategiesSource.value[e]=i}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===A.SHOW||e===A.REMOVE}};t.\u0275fac=function(i){return new(i||t)(c(B),c(ee))},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})();function u(r){return typeof r=="function"}function k(r){if(Object.prototype.toString.call(r)!=="[object Object]")return!1;{let t=Object.getPrototypeOf(r);return t===null||t===Object.prototype}}function ie(r){return!!r&&typeof r=="string"}function T(r){return typeof r=="boolean"}function te(r){return Object.prototype.toString.call(r)==="[object Promise]"}function O(r){return Array.isArray(r)?r.length>0:!!r}function R(r){return ie(r)?[r]:r}var se=(()=>{let t=class t{constructor(){this.permissionsSource=new d({}),this.permissions$=this.permissionsSource.asObservable()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})(),W=new E("USE_PERMISSIONS_STORE"),x=(()=>{let t=class t{constructor(e=!1,i){this.isolate=e,this.permissionsStore=i,this.permissionsSource=this.isolate?new d({}):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=R(e),this.hasArrayPermission(e))}loadPermissions(e,i){let s=e.reduce((o,n)=>this.reducePermission(o,n,i),{});this.permissionsSource.next(s)}addPermission(e,i){if(Array.isArray(e)){let s=e.reduce((o,n)=>this.reducePermission(o,n,i),this.permissionsSource.value);this.permissionsSource.next(s)}else{let s=this.reducePermission(this.permissionsSource.value,e,i);this.permissionsSource.next(s)}}removePermission(e){let i=l({},this.permissionsSource.value);delete i[e],this.permissionsSource.next(i)}getPermission(e){return this.permissionsSource.value[e]}getPermissions(){return this.permissionsSource.value}reducePermission(e,i,s){return s&&u(s)?v(l({},e),{[i]:{name:i,validationFunction:s}}):v(l({},e),{[i]:{name:i}})}hasArrayPermission(e){let i=e.map(s=>{if(this.hasPermissionValidationFunction(s)){let o=this.permissionsSource.value[s].validationFunction,n=l({},this.permissionsSource.value);return h(null).pipe(S(()=>o(s,n)),j(a=>T(a)?h(a):a),F(()=>h(!1)))}return h(!!this.permissionsSource.value[s])});return g(i).pipe(I(),y(s=>s!==!1,!1),S(s=>s!==!1)).toPromise().then(s=>s)}hasPermissionValidationFunction(e){return!!this.permissionsSource.value[e]&&!!this.permissionsSource.value[e].validationFunction&&u(this.permissionsSource.value[e].validationFunction)}};t.\u0275fac=function(i){return new(i||t)(c(W),c(se))},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})(),U=class{constructor(){this.rolesSource=new d({}),this.roles$=this.rolesSource.asObservable()}},H=new E("USE_ROLES_STORE"),D=(()=>{let t=class t{constructor(e=!1,i,s){this.isolate=e,this.rolesStore=i,this.permissionsService=s,this.rolesSource=this.isolate?new d({}):this.rolesStore.rolesSource,this.roles$=this.rolesSource.asObservable()}addRole(e,i){let s=v(l({},this.rolesSource.value),{[e]:{name:e,validationFunction:i}});this.rolesSource.next(s)}addRoleWithPermissions(e,i){this.permissionsService.addPermission(i),this.addRole(e,i)}addRoles(e){Object.keys(e).forEach((i,s)=>{this.addRole(i,e[i])})}addRolesWithPermissions(e){Object.keys(e).forEach((i,s)=>{this.addRoleWithPermissions(i,e[i])})}flushRoles(){this.rolesSource.next({})}flushRolesAndPermissions(){this.flushRoles(),this.permissionsService.flushPermissions()}removeRole(e){let i=l({},this.rolesSource.value);delete i[e],this.rolesSource.next(i)}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=R(e),Promise.all([this.hasRoleKey(e),this.hasRolePermission(this.rolesSource.value,e)]).then(([s,o])=>s||o))}hasRoleKey(e){let i=e.map(s=>{if(!!this.rolesSource.value[s]&&!!this.rolesSource.value[s].validationFunction&&u(this.rolesSource.value[s].validationFunction)&&!te(this.rolesSource.value[s].validationFunction)){let n=this.rolesSource.value[s].validationFunction,a=l({},this.rolesSource.value);return h(null).pipe(S(()=>n(s,a)),j(P=>T(P)?h(P):P),F(()=>h(!1)))}return h(!1)});return g(i).pipe(I(),y(s=>s!==!1,!1),S(s=>s!==!1)).toPromise().then(s=>s)}hasRolePermission(e,i){return g(i).pipe(m(s=>e[s]&&Array.isArray(e[s].validationFunction)?g(e[s].validationFunction).pipe(m(o=>this.permissionsService.hasPermission(o)),G(o=>o===!0)):h(!1)),y(s=>s===!0,!1)).toPromise()}};t.\u0275fac=function(i){return new(i||t)(c(H),c(U),c(x))},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})(),pe=(()=>{let t=class t{constructor(){this.permissionsAuthorized=new V,this.permissionsUnauthorized=new V,this.firstMergeUnusedRun=1,this.permissionsService=p(x),this.configurationService=p($),this.rolesService=p(D),this.viewContainer=p(Q),this.changeDetector=p(q),this.templateRef=p(X)}ngOnInit(){this.viewContainer.clear(),this.initPermissionSubscription=this.validateExceptOnlyPermissions()}ngOnChanges(e){let i=e.ngxPermissionsOnly,s=e.ngxPermissionsExcept;if(i||s){if(i&&i.firstChange||s&&s.firstChange)return;b(this.permissionsService.permissions$,this.rolesService.roles$).pipe(M(this.firstMergeUnusedRun),L(1)).subscribe(()=>{if(O(this.ngxPermissionsExcept)){this.validateExceptAndOnlyPermissions();return}if(O(this.ngxPermissionsOnly)){this.validateOnlyPermissions();return}this.handleAuthorisedPermission(this.getAuthorisedTemplates())})}}ngOnDestroy(){this.initPermissionSubscription&&this.initPermissionSubscription.unsubscribe()}validateExceptOnlyPermissions(){return b(this.permissionsService.permissions$,this.rolesService.roles$).pipe(M(this.firstMergeUnusedRun)).subscribe(()=>{if(O(this.ngxPermissionsExcept)){this.validateExceptAndOnlyPermissions();return}if(O(this.ngxPermissionsOnly)){this.validateOnlyPermissions();return}this.handleAuthorisedPermission(this.getAuthorisedTemplates())})}validateExceptAndOnlyPermissions(){Promise.all([this.permissionsService.hasPermission(this.ngxPermissionsExcept),this.rolesService.hasOnlyRoles(this.ngxPermissionsExcept)]).then(([e,i])=>{if(e||i){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,i])=>{e||i?this.handleAuthorisedPermission(this.ngxPermissionsOnlyThen||this.ngxPermissionsThen||this.templateRef):this.handleUnauthorisedPermission(this.ngxPermissionsOnlyElse||this.ngxPermissionsElse)}).catch(()=>{this.handleUnauthorisedPermission(this.ngxPermissionsOnlyElse||this.ngxPermissionsElse)})}handleUnauthorisedPermission(e){if(!(T(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(!(T(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(ie(e)){this.applyStrategy(e);return}if(u(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===A.SHOW){this.showTemplateBlockInView(this.templateRef);return}if(e===A.REMOVE){this.viewContainer.clear();return}let i=this.configurationService.getStrategy(e);this.showTemplateBlockInView(this.templateRef),i(this.templateRef)}};t.\u0275fac=function(i){return new(i||t)},t.\u0275dir=J({type:t,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:[Y]});let r=t;return r})(),re="default";var _=(()=>{let t=class t{constructor(e,i,s){this.permissionsService=e,this.rolesService=i,this.router=s}canActivate(e,i){return this.hasPermissions(e,i)}canActivateChild(e,i){return this.hasPermissions(e,i)}canLoad(e){return this.hasPermissions(e)}canMatch(e){return this.hasPermissions(e)}hasPermissions(e,i){let s=e&&e.data?e.data.permissions:{},o=this.transformPermission(s,e,i);return this.isParameterAvailable(o.except)?this.passingExceptPermissionsValidation(o,e,i):this.isParameterAvailable(o.only)?this.passingOnlyPermissionsValidation(o,e,i):!0}transformPermission(e,i,s){let o=u(e.only)?e.only(i,s):R(e.only),n=u(e.except)?e.except(i,s):R(e.except),a=e.redirectTo;return{only:o,except:n,redirectTo:a}}isParameterAvailable(e){return!!e&&e.length>0}passingExceptPermissionsValidation(e,i,s){if(e.redirectTo&&(u(e.redirectTo)||k(e.redirectTo)&&!this.isRedirectionWithParameters(e.redirectTo))){let o="";return g(e.except).pipe(m(n=>z([this.permissionsService.hasPermission(n),this.rolesService.hasOnlyRoles(n)]).pipe(C(a=>{a.every(w=>w===!1)||(o=n)}))),y(n=>n.some(a=>a===!0),!1),m(n=>o?(this.handleRedirectOfFailedPermission(e,o,i,s),h(!1)):!n&&e.only?this.onlyRedirectCheck(e,i,s):h(!n))).toPromise()}return Promise.all([this.permissionsService.hasPermission(e.except),this.rolesService.hasOnlyRoles(e.except)]).then(([o,n])=>o||n?(e.redirectTo&&this.redirectToAnotherRoute(e.redirectTo,i,s),!1):e.only?this.checkOnlyPermissions(e,i,s):!0)}redirectToAnotherRoute(e,i,s,o){let n=u(e)?e(o,i,s):e;if(this.isRedirectionWithParameters(n)){n.navigationCommands=this.transformNavigationCommands(n.navigationCommands,i,s),n.navigationExtras=this.transformNavigationExtras(n.navigationExtras,i,s),this.router.navigate(n.navigationCommands,n.navigationExtras);return}Array.isArray(n)?this.router.navigate(n):this.router.navigate([n])}isRedirectionWithParameters(e){return k(e)&&(!!e.navigationCommands||!!e.navigationExtras)}transformNavigationCommands(e,i,s){return u(e)?e(i,s):e}transformNavigationExtras(e,i,s){return u(e)?e(i,s):e}onlyRedirectCheck(e,i,s){let o="";return g(e.only).pipe(m(n=>z([this.permissionsService.hasPermission(n),this.rolesService.hasOnlyRoles(n)]).pipe(C(a=>{a.every(w=>w===!1)&&(o=n)}))),y(n=>u(e.redirectTo)?n.some(a=>a===!0):n.every(a=>a===!1),!1),m(n=>u(e.redirectTo)?n?h(!0):(this.handleRedirectOfFailedPermission(e,o,i,s),h(!1)):(o&&this.handleRedirectOfFailedPermission(e,o,i,s),h(!n)))).toPromise()}handleRedirectOfFailedPermission(e,i,s,o){this.isFailedPermissionPropertyOfRedirectTo(e,i)?this.redirectToAnotherRoute(e.redirectTo[i],s,o,i):u(e.redirectTo)?this.redirectToAnotherRoute(e.redirectTo,s,o,i):this.redirectToAnotherRoute(e.redirectTo[re],s,o,i)}isFailedPermissionPropertyOfRedirectTo(e,i){return!!e.redirectTo&&e.redirectTo[i]}checkOnlyPermissions(e,i,s){let o=l({},e);return Promise.all([this.permissionsService.hasPermission(o.only),this.rolesService.hasOnlyRoles(o.only)]).then(([n,a])=>n||a?!0:(o.redirectTo&&this.redirectToAnotherRoute(o.redirectTo,i,s),!1))}passingOnlyPermissionsValidation(e,i,s){return u(e.redirectTo)||k(e.redirectTo)&&!this.isRedirectionWithParameters(e.redirectTo)?this.onlyRedirectCheck(e,i,s):this.checkOnlyPermissions(e,i,s)}};t.\u0275fac=function(i){return new(i||t)(c(x),c(D),c(Z))},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})();var ye=(()=>{let t=class t{static forRoot(e={}){return{ngModule:t,providers:[se,U,ee,x,_,D,$,{provide:W,useValue:e.permissionsIsolate},{provide:H,useValue:e.rolesIsolate},{provide:B,useValue:e.configurationIsolate}]}}static forChild(e={}){return{ngModule:t,providers:[{provide:W,useValue:e.permissionsIsolate},{provide:H,useValue:e.rolesIsolate},{provide:B,useValue:e.configurationIsolate},$,x,D,_]}}};t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=N({type:t}),t.\u0275inj=K({});let r=t;return r})();export{x as a,pe as b,ye as c};
1
+ import{$ as f,A as b,E as F,Gb as X,I as L,Ia as q,Ic as Z,Ja as V,L as G,N as y,R as M,T as j,Ta as Q,X as C,aa as K,ba as E,ca as c,d,da as p,fa as N,ga as J,ia as Y,m as g,n as h,q as S,s as m,t as I,w as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-3TYJJ4PH.js";import{a as l,b as v}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-GLK7UGZJ.js";var A={REMOVE:"remove",SHOW:"show"},ee=(()=>{let t=class t{constructor(){this.strategiesSource=new d({}),this.strategies$=this.strategiesSource.asObservable()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})(),B=new E("USE_CONFIGURATION_STORE"),$=(()=>{let t=class t{constructor(e=!1,i){this.isolate=e,this.configurationStore=i,this.strategiesSource=this.isolate?new d({}):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,i){this.strategiesSource.value[e]=i}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===A.SHOW||e===A.REMOVE}};t.\u0275fac=function(i){return new(i||t)(c(B),c(ee))},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})();function u(r){return typeof r=="function"}function k(r){if(Object.prototype.toString.call(r)!=="[object Object]")return!1;{let t=Object.getPrototypeOf(r);return t===null||t===Object.prototype}}function ie(r){return!!r&&typeof r=="string"}function T(r){return typeof r=="boolean"}function te(r){return Object.prototype.toString.call(r)==="[object Promise]"}function O(r){return Array.isArray(r)?r.length>0:!!r}function R(r){return ie(r)?[r]:r}var se=(()=>{let t=class t{constructor(){this.permissionsSource=new d({}),this.permissions$=this.permissionsSource.asObservable()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})(),W=new E("USE_PERMISSIONS_STORE"),x=(()=>{let t=class t{constructor(e=!1,i){this.isolate=e,this.permissionsStore=i,this.permissionsSource=this.isolate?new d({}):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=R(e),this.hasArrayPermission(e))}loadPermissions(e,i){let s=e.reduce((o,n)=>this.reducePermission(o,n,i),{});this.permissionsSource.next(s)}addPermission(e,i){if(Array.isArray(e)){let s=e.reduce((o,n)=>this.reducePermission(o,n,i),this.permissionsSource.value);this.permissionsSource.next(s)}else{let s=this.reducePermission(this.permissionsSource.value,e,i);this.permissionsSource.next(s)}}removePermission(e){let i=l({},this.permissionsSource.value);delete i[e],this.permissionsSource.next(i)}getPermission(e){return this.permissionsSource.value[e]}getPermissions(){return this.permissionsSource.value}reducePermission(e,i,s){return s&&u(s)?v(l({},e),{[i]:{name:i,validationFunction:s}}):v(l({},e),{[i]:{name:i}})}hasArrayPermission(e){let i=e.map(s=>{if(this.hasPermissionValidationFunction(s)){let o=this.permissionsSource.value[s].validationFunction,n=l({},this.permissionsSource.value);return h(null).pipe(S(()=>o(s,n)),j(a=>T(a)?h(a):a),F(()=>h(!1)))}return h(!!this.permissionsSource.value[s])});return g(i).pipe(I(),y(s=>s!==!1,!1),S(s=>s!==!1)).toPromise().then(s=>s)}hasPermissionValidationFunction(e){return!!this.permissionsSource.value[e]&&!!this.permissionsSource.value[e].validationFunction&&u(this.permissionsSource.value[e].validationFunction)}};t.\u0275fac=function(i){return new(i||t)(c(W),c(se))},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})(),U=class{constructor(){this.rolesSource=new d({}),this.roles$=this.rolesSource.asObservable()}},H=new E("USE_ROLES_STORE"),D=(()=>{let t=class t{constructor(e=!1,i,s){this.isolate=e,this.rolesStore=i,this.permissionsService=s,this.rolesSource=this.isolate?new d({}):this.rolesStore.rolesSource,this.roles$=this.rolesSource.asObservable()}addRole(e,i){let s=v(l({},this.rolesSource.value),{[e]:{name:e,validationFunction:i}});this.rolesSource.next(s)}addRoleWithPermissions(e,i){this.permissionsService.addPermission(i),this.addRole(e,i)}addRoles(e){Object.keys(e).forEach((i,s)=>{this.addRole(i,e[i])})}addRolesWithPermissions(e){Object.keys(e).forEach((i,s)=>{this.addRoleWithPermissions(i,e[i])})}flushRoles(){this.rolesSource.next({})}flushRolesAndPermissions(){this.flushRoles(),this.permissionsService.flushPermissions()}removeRole(e){let i=l({},this.rolesSource.value);delete i[e],this.rolesSource.next(i)}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=R(e),Promise.all([this.hasRoleKey(e),this.hasRolePermission(this.rolesSource.value,e)]).then(([s,o])=>s||o))}hasRoleKey(e){let i=e.map(s=>{if(!!this.rolesSource.value[s]&&!!this.rolesSource.value[s].validationFunction&&u(this.rolesSource.value[s].validationFunction)&&!te(this.rolesSource.value[s].validationFunction)){let n=this.rolesSource.value[s].validationFunction,a=l({},this.rolesSource.value);return h(null).pipe(S(()=>n(s,a)),j(P=>T(P)?h(P):P),F(()=>h(!1)))}return h(!1)});return g(i).pipe(I(),y(s=>s!==!1,!1),S(s=>s!==!1)).toPromise().then(s=>s)}hasRolePermission(e,i){return g(i).pipe(m(s=>e[s]&&Array.isArray(e[s].validationFunction)?g(e[s].validationFunction).pipe(m(o=>this.permissionsService.hasPermission(o)),G(o=>o===!0)):h(!1)),y(s=>s===!0,!1)).toPromise()}};t.\u0275fac=function(i){return new(i||t)(c(H),c(U),c(x))},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})(),pe=(()=>{let t=class t{constructor(){this.permissionsAuthorized=new V,this.permissionsUnauthorized=new V,this.firstMergeUnusedRun=1,this.permissionsService=p(x),this.configurationService=p($),this.rolesService=p(D),this.viewContainer=p(Q),this.changeDetector=p(q),this.templateRef=p(X)}ngOnInit(){this.viewContainer.clear(),this.initPermissionSubscription=this.validateExceptOnlyPermissions()}ngOnChanges(e){let i=e.ngxPermissionsOnly,s=e.ngxPermissionsExcept;if(i||s){if(i&&i.firstChange||s&&s.firstChange)return;b(this.permissionsService.permissions$,this.rolesService.roles$).pipe(M(this.firstMergeUnusedRun),L(1)).subscribe(()=>{if(O(this.ngxPermissionsExcept)){this.validateExceptAndOnlyPermissions();return}if(O(this.ngxPermissionsOnly)){this.validateOnlyPermissions();return}this.handleAuthorisedPermission(this.getAuthorisedTemplates())})}}ngOnDestroy(){this.initPermissionSubscription&&this.initPermissionSubscription.unsubscribe()}validateExceptOnlyPermissions(){return b(this.permissionsService.permissions$,this.rolesService.roles$).pipe(M(this.firstMergeUnusedRun)).subscribe(()=>{if(O(this.ngxPermissionsExcept)){this.validateExceptAndOnlyPermissions();return}if(O(this.ngxPermissionsOnly)){this.validateOnlyPermissions();return}this.handleAuthorisedPermission(this.getAuthorisedTemplates())})}validateExceptAndOnlyPermissions(){Promise.all([this.permissionsService.hasPermission(this.ngxPermissionsExcept),this.rolesService.hasOnlyRoles(this.ngxPermissionsExcept)]).then(([e,i])=>{if(e||i){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,i])=>{e||i?this.handleAuthorisedPermission(this.ngxPermissionsOnlyThen||this.ngxPermissionsThen||this.templateRef):this.handleUnauthorisedPermission(this.ngxPermissionsOnlyElse||this.ngxPermissionsElse)}).catch(()=>{this.handleUnauthorisedPermission(this.ngxPermissionsOnlyElse||this.ngxPermissionsElse)})}handleUnauthorisedPermission(e){if(!(T(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(!(T(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(ie(e)){this.applyStrategy(e);return}if(u(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===A.SHOW){this.showTemplateBlockInView(this.templateRef);return}if(e===A.REMOVE){this.viewContainer.clear();return}let i=this.configurationService.getStrategy(e);this.showTemplateBlockInView(this.templateRef),i(this.templateRef)}};t.\u0275fac=function(i){return new(i||t)},t.\u0275dir=J({type:t,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:[Y]});let r=t;return r})(),re="default";var _=(()=>{let t=class t{constructor(e,i,s){this.permissionsService=e,this.rolesService=i,this.router=s}canActivate(e,i){return this.hasPermissions(e,i)}canActivateChild(e,i){return this.hasPermissions(e,i)}canLoad(e){return this.hasPermissions(e)}canMatch(e){return this.hasPermissions(e)}hasPermissions(e,i){let s=e&&e.data?e.data.permissions:{},o=this.transformPermission(s,e,i);return this.isParameterAvailable(o.except)?this.passingExceptPermissionsValidation(o,e,i):this.isParameterAvailable(o.only)?this.passingOnlyPermissionsValidation(o,e,i):!0}transformPermission(e,i,s){let o=u(e.only)?e.only(i,s):R(e.only),n=u(e.except)?e.except(i,s):R(e.except),a=e.redirectTo;return{only:o,except:n,redirectTo:a}}isParameterAvailable(e){return!!e&&e.length>0}passingExceptPermissionsValidation(e,i,s){if(e.redirectTo&&(u(e.redirectTo)||k(e.redirectTo)&&!this.isRedirectionWithParameters(e.redirectTo))){let o="";return g(e.except).pipe(m(n=>z([this.permissionsService.hasPermission(n),this.rolesService.hasOnlyRoles(n)]).pipe(C(a=>{a.every(w=>w===!1)||(o=n)}))),y(n=>n.some(a=>a===!0),!1),m(n=>o?(this.handleRedirectOfFailedPermission(e,o,i,s),h(!1)):!n&&e.only?this.onlyRedirectCheck(e,i,s):h(!n))).toPromise()}return Promise.all([this.permissionsService.hasPermission(e.except),this.rolesService.hasOnlyRoles(e.except)]).then(([o,n])=>o||n?(e.redirectTo&&this.redirectToAnotherRoute(e.redirectTo,i,s),!1):e.only?this.checkOnlyPermissions(e,i,s):!0)}redirectToAnotherRoute(e,i,s,o){let n=u(e)?e(o,i,s):e;if(this.isRedirectionWithParameters(n)){n.navigationCommands=this.transformNavigationCommands(n.navigationCommands,i,s),n.navigationExtras=this.transformNavigationExtras(n.navigationExtras,i,s),this.router.navigate(n.navigationCommands,n.navigationExtras);return}Array.isArray(n)?this.router.navigate(n):this.router.navigate([n])}isRedirectionWithParameters(e){return k(e)&&(!!e.navigationCommands||!!e.navigationExtras)}transformNavigationCommands(e,i,s){return u(e)?e(i,s):e}transformNavigationExtras(e,i,s){return u(e)?e(i,s):e}onlyRedirectCheck(e,i,s){let o="";return g(e.only).pipe(m(n=>z([this.permissionsService.hasPermission(n),this.rolesService.hasOnlyRoles(n)]).pipe(C(a=>{a.every(w=>w===!1)&&(o=n)}))),y(n=>u(e.redirectTo)?n.some(a=>a===!0):n.every(a=>a===!1),!1),m(n=>u(e.redirectTo)?n?h(!0):(this.handleRedirectOfFailedPermission(e,o,i,s),h(!1)):(o&&this.handleRedirectOfFailedPermission(e,o,i,s),h(!n)))).toPromise()}handleRedirectOfFailedPermission(e,i,s,o){this.isFailedPermissionPropertyOfRedirectTo(e,i)?this.redirectToAnotherRoute(e.redirectTo[i],s,o,i):u(e.redirectTo)?this.redirectToAnotherRoute(e.redirectTo,s,o,i):this.redirectToAnotherRoute(e.redirectTo[re],s,o,i)}isFailedPermissionPropertyOfRedirectTo(e,i){return!!e.redirectTo&&e.redirectTo[i]}checkOnlyPermissions(e,i,s){let o=l({},e);return Promise.all([this.permissionsService.hasPermission(o.only),this.rolesService.hasOnlyRoles(o.only)]).then(([n,a])=>n||a?!0:(o.redirectTo&&this.redirectToAnotherRoute(o.redirectTo,i,s),!1))}passingOnlyPermissionsValidation(e,i,s){return u(e.redirectTo)||k(e.redirectTo)&&!this.isRedirectionWithParameters(e.redirectTo)?this.onlyRedirectCheck(e,i,s):this.checkOnlyPermissions(e,i,s)}};t.\u0275fac=function(i){return new(i||t)(c(x),c(D),c(Z))},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})();var ye=(()=>{let t=class t{static forRoot(e={}){return{ngModule:t,providers:[se,U,ee,x,_,D,$,{provide:W,useValue:e.permissionsIsolate},{provide:H,useValue:e.rolesIsolate},{provide:B,useValue:e.configurationIsolate}]}}static forChild(e={}){return{ngModule:t,providers:[{provide:W,useValue:e.permissionsIsolate},{provide:H,useValue:e.rolesIsolate},{provide:B,useValue:e.configurationIsolate},$,x,D,_]}}};t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=N({type:t}),t.\u0275inj=K({});let r=t;return r})();export{x as a,pe as b,ye as c};
@@ -1,4 +1,4 @@
1
- import{a as D,b as ee,j as Cd,k as Ro,l as Ed,m as Id}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6RUGKYFT.js";function M(t){return typeof t=="function"}function ca(t){return M(t?.lift)}function b(t){return e=>{if(ca(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function jt(t){let r=t(n=>{Error.call(n),n.stack=new Error().stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Oo=jt(t=>function(r){t(this),this.message=r?`${r.length} errors occurred during unsubscription:
1
+ import{a as D,b as ee,j as Cd,k as Ro,l as Ed,m as Id}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-GLK7UGZJ.js";function M(t){return typeof t=="function"}function ca(t){return M(t?.lift)}function b(t){return e=>{if(ca(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function jt(t){let r=t(n=>{Error.call(n),n.stack=new Error().stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Oo=jt(t=>function(r){t(this),this.message=r?`${r.length} errors occurred during unsubscription:
2
2
  ${r.map((n,o)=>`${o+1}) ${n.toString()}`).join(`
3
3
  `)}`:"",this.name="UnsubscriptionError",this.errors=r});function en(t,e){if(t){let r=t.indexOf(e);0<=r&&t.splice(r,1)}}var Q=class t{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;let{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(let i of r)i.remove(this);else r.remove(this);let{initialTeardown:n}=this;if(M(n))try{n()}catch(i){e=i instanceof Oo?i.errors:[i]}let{_finalizers:o}=this;if(o){this._finalizers=null;for(let i of o)try{bd(i)}catch(s){e=e??[],s instanceof Oo?e=[...e,...s.errors]:e.push(s)}}if(e)throw new Oo(e)}}add(e){var r;if(e&&e!==this)if(this.closed)bd(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}}_hasParent(e){let{_parentage:r}=this;return r===e||Array.isArray(r)&&r.includes(e)}_addParent(e){let{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e}_removeParent(e){let{_parentage:r}=this;r===e?this._parentage=null:Array.isArray(r)&&en(r,e)}remove(e){let{_finalizers:r}=this;r&&en(r,e),e instanceof t&&e._removeParent(this)}};Q.EMPTY=(()=>{let t=new Q;return t.closed=!0,t})();var la=Q.EMPTY;function Po(t){return t instanceof Q||t&&"closed"in t&&M(t.remove)&&M(t.add)&&M(t.unsubscribe)}function bd(t){M(t)?t():t.unsubscribe()}var Be={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Tn={setTimeout(t,e,...r){let{delegate:n}=Tn;return n?.setTimeout?n.setTimeout(t,e,...r):setTimeout(t,e,...r)},clearTimeout(t){let{delegate:e}=Tn;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function Fo(t){Tn.setTimeout(()=>{let{onUnhandledError:e}=Be;if(e)e(t);else throw t})}function He(){}var Md=(()=>da("C",void 0,void 0))();function Sd(t){return da("E",void 0,t)}function Td(t){return da("N",t,void 0)}function da(t,e,r){return{kind:t,value:e,error:r}}var tn=null;function xn(t){if(Be.useDeprecatedSynchronousErrorHandling){let e=!tn;if(e&&(tn={errorThrown:!1,error:null}),t(),e){let{errorThrown:r,error:n}=tn;if(tn=null,r)throw n}}else t()}function xd(t){Be.useDeprecatedSynchronousErrorHandling&&tn&&(tn.errorThrown=!0,tn.error=t)}var nn=class extends Q{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,Po(e)&&e.add(this)):this.destination=Dv}static create(e,r,n){return new vt(e,r,n)}next(e){this.isStopped?ha(Td(e),this):this._next(e)}error(e){this.isStopped?ha(Sd(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?ha(Md,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},vv=Function.prototype.bind;function fa(t,e){return vv.call(t,e)}var pa=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:r}=this;if(r.next)try{r.next(e)}catch(n){ko(n)}}error(e){let{partialObserver:r}=this;if(r.error)try{r.error(e)}catch(n){ko(n)}else ko(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(r){ko(r)}}},vt=class extends nn{constructor(e,r,n){super();let o;if(M(e)||!e)o={next:e??void 0,error:r??void 0,complete:n??void 0};else{let i;this&&Be.useDeprecatedNextContext?(i=Object.create(e),i.unsubscribe=()=>this.unsubscribe(),o={next:e.next&&fa(e.next,i),error:e.error&&fa(e.error,i),complete:e.complete&&fa(e.complete,i)}):o=e}this.destination=new pa(o)}};function ko(t){Be.useDeprecatedSynchronousErrorHandling?xd(t):Fo(t)}function yv(t){throw t}function ha(t,e){let{onStoppedNotification:r}=Be;r&&Tn.setTimeout(()=>r(t,e))}var Dv={closed:!0,next:He,error:yv,complete:He};function I(t,e,r,n,o){return new ga(t,e,r,n,o)}var ga=class extends nn{constructor(e,r,n,o,i,s){super(e),this.onFinalize=i,this.shouldUnsubscribe=s,this._next=r?function(a){try{r(a)}catch(u){e.error(u)}}:super._next,this._error=o?function(a){try{o(a)}catch(u){e.error(u)}finally{this.unsubscribe()}}:super._error,this._complete=n?function(){try{n()}catch(a){e.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:r}=this;super.unsubscribe(),!r&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}};function O(t,e){return b((r,n)=>{let o=0;r.subscribe(I(n,i=>{n.next(t.call(e,i,o++))}))})}var _n=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")();function le(t){return t}function ma(...t){return va(t)}function va(t){return t.length===0?le:t.length===1?t[0]:function(r){return t.reduce((n,o)=>o(n),r)}}var k=(()=>{class t{constructor(r){r&&(this._subscribe=r)}lift(r){let n=new t;return n.source=this,n.operator=r,n}subscribe(r,n,o){let i=Cv(r)?r:new vt(r,n,o);return xn(()=>{let{operator:s,source:a}=this;i.add(s?s.call(i,a):a?this._subscribe(i):this._trySubscribe(i))}),i}_trySubscribe(r){try{return this._subscribe(r)}catch(n){r.error(n)}}forEach(r,n){return n=_d(n),new n((o,i)=>{let s=new vt({next:a=>{try{r(a)}catch(u){i(u),s.unsubscribe()}},error:i,complete:o});this.subscribe(s)})}_subscribe(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)}[_n](){return this}pipe(...r){return va(r)(this)}toPromise(r){return r=_d(r),new r((n,o)=>{let i;this.subscribe(s=>i=s,s=>o(s),()=>n(i))})}}return t.create=e=>new t(e),t})();function _d(t){var e;return(e=t??Be.Promise)!==null&&e!==void 0?e:Promise}function wv(t){return t&&M(t.next)&&M(t.error)&&M(t.complete)}function Cv(t){return t&&t instanceof nn||wv(t)&&Po(t)}var Ad=jt(t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var ae=(()=>{class t extends k{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){let n=new Lo(this,this);return n.operator=r,n}_throwIfClosed(){if(this.closed)throw new Ad}next(r){xn(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let n of this.currentObservers)n.next(r)}})}error(r){xn(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;let{observers:n}=this;for(;n.length;)n.shift().error(r)}})}complete(){xn(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){let{hasError:n,isStopped:o,observers:i}=this;return n||o?la:(this.currentObservers=null,i.push(r),new Q(()=>{this.currentObservers=null,en(i,r)}))}_checkFinalizedStatuses(r){let{hasError:n,thrownError:o,isStopped:i}=this;n?r.error(o):i&&r.complete()}asObservable(){let r=new k;return r.source=this,r}}return t.create=(e,r)=>new Lo(e,r),t})(),Lo=class extends ae{constructor(e,r){super(),this.destination=e,this.source=r}next(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.next)===null||n===void 0||n.call(r,e)}error(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.error)===null||n===void 0||n.call(r,e)}complete(){var e,r;(r=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||r===void 0||r.call(e)}_subscribe(e){var r,n;return(n=(r=this.source)===null||r===void 0?void 0:r.subscribe(e))!==null&&n!==void 0?n:la}};var Ir={now(){return(Ir.delegate||Date).now()},delegate:void 0};var br=class extends ae{constructor(e=1/0,r=1/0,n=Ir){super(),this._bufferSize=e,this._windowTime=r,this._timestampProvider=n,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=r===1/0,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,r)}next(e){let{isStopped:r,_buffer:n,_infiniteTimeWindow:o,_timestampProvider:i,_windowTime:s}=this;r||(n.push(e),!o&&n.push(i.now()+s)),this._trimBuffer(),super.next(e)}_subscribe(e){this._throwIfClosed(),this._trimBuffer();let r=this._innerSubscribe(e),{_infiniteTimeWindow:n,_buffer:o}=this,i=o.slice();for(let s=0;s<i.length&&!e.closed;s+=n?1:2)e.next(i[s]);return this._checkFinalizedStatuses(e),r}_trimBuffer(){let{_bufferSize:e,_timestampProvider:r,_buffer:n,_infiniteTimeWindow:o}=this,i=(o?1:2)*e;if(e<1/0&&i<n.length&&n.splice(0,n.length-i),!o){let s=r.now(),a=0;for(let u=1;u<n.length&&n[u]<=s;u+=2)a=u;a&&n.splice(0,a+1)}}};var An=t=>t&&typeof t.length=="number"&&typeof t!="function";function jo(t){return M(t?.then)}function Vo(t){return M(t[_n])}function $o(t){return Symbol.asyncIterator&&M(t?.[Symbol.asyncIterator])}function Uo(t){return new TypeError(`You provided ${t!==null&&typeof t=="object"?"an invalid object":`'${t}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function Ev(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Bo=Ev();function Ho(t){return M(t?.[Bo])}function zo(t){return Ed(this,arguments,function*(){let r=t.getReader();try{for(;;){let{value:n,done:o}=yield Ro(r.read());if(o)return yield Ro(void 0);yield yield Ro(n)}}finally{r.releaseLock()}})}function Wo(t){return M(t?.getReader)}function P(t){if(t instanceof k)return t;if(t!=null){if(Vo(t))return Iv(t);if(An(t))return bv(t);if(jo(t))return Mv(t);if($o(t))return Nd(t);if(Ho(t))return Sv(t);if(Wo(t))return Tv(t)}throw Uo(t)}function Iv(t){return new k(e=>{let r=t[_n]();if(M(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function bv(t){return new k(e=>{for(let r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}function Mv(t){return new k(e=>{t.then(r=>{e.closed||(e.next(r),e.complete())},r=>e.error(r)).then(null,Fo)})}function Sv(t){return new k(e=>{for(let r of t)if(e.next(r),e.closed)return;e.complete()})}function Nd(t){return new k(e=>{xv(t,e).catch(r=>e.error(r))})}function Tv(t){return Nd(zo(t))}function xv(t,e){var r,n,o,i;return Cd(this,void 0,void 0,function*(){try{for(r=Id(t);n=yield r.next(),!n.done;){let s=n.value;if(e.next(s),e.closed)return}}catch(s){o={error:s}}finally{try{n&&!n.done&&(i=r.return)&&(yield i.call(r))}finally{if(o)throw o.error}}e.complete()})}function Da(t={}){let{connector:e=()=>new ae,resetOnError:r=!0,resetOnComplete:n=!0,resetOnRefCountZero:o=!0}=t;return i=>{let s,a,u,c=0,l=!1,d=!1,f=()=>{a?.unsubscribe(),a=void 0},h=()=>{f(),s=u=void 0,l=d=!1},p=()=>{let S=s;h(),S?.unsubscribe()};return b((S,C)=>{c++,!d&&!l&&f();let m=u=u??e();C.add(()=>{c--,c===0&&!d&&!l&&(a=ya(p,o))}),m.subscribe(C),!s&&c>0&&(s=new vt({next:j=>m.next(j),error:j=>{d=!0,f(),a=ya(h,r,j),m.error(j)},complete:()=>{l=!0,f(),a=ya(h,n),m.complete()}}),P(S).subscribe(s))})(i)}}function ya(t,e,...r){if(e===!0){t();return}if(e===!1)return;let n=new vt({next:()=>{n.unsubscribe(),t()}});return P(e(...r)).subscribe(n)}function Rd(t,e,r){let n,o=!1;return t&&typeof t=="object"?{bufferSize:n=1/0,windowTime:e=1/0,refCount:o=!1,scheduler:r}=t:n=t??1/0,Da({connector:()=>new br(n,e,r),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}function Nn(){return b((t,e)=>{let r=null;t._refCount++;let n=I(e,void 0,void 0,void 0,()=>{if(!t||t._refCount<=0||0<--t._refCount){r=null;return}let o=t._connection,i=r;r=null,o&&(!i||o===i)&&o.unsubscribe(),e.unsubscribe()});t.subscribe(n),n.closed||(r=t.connect())})}var Rn=class extends k{constructor(e,r){super(),this.source=e,this.subjectFactory=r,this._subject=null,this._refCount=0,this._connection=null,ca(e)&&(this.lift=e.lift)}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){let e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;let{_connection:e}=this;this._subject=this._connection=null,e?.unsubscribe()}connect(){let e=this._connection;if(!e){e=this._connection=new Q;let r=this.getSubject();e.add(this.source.subscribe(I(r,void 0,()=>{this._teardown(),r.complete()},n=>{this._teardown(),r.error(n)},()=>this._teardown()))),e.closed&&(this._connection=null,e=Q.EMPTY)}return e}refCount(){return Nn()(this)}};var On={schedule(t){let e=requestAnimationFrame,r=cancelAnimationFrame,{delegate:n}=On;n&&(e=n.requestAnimationFrame,r=n.cancelAnimationFrame);let o=e(i=>{r=void 0,t(i)});return new Q(()=>r?.(o))},requestAnimationFrame(...t){let{delegate:e}=On;return(e?.requestAnimationFrame||requestAnimationFrame)(...t)},cancelAnimationFrame(...t){let{delegate:e}=On;return(e?.cancelAnimationFrame||cancelAnimationFrame)(...t)},delegate:void 0};var de=class extends ae{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let r=super._subscribe(e);return!r.closed&&e.next(this._value),r}getValue(){let{hasError:e,thrownError:r,_value:n}=this;if(e)throw r;return this._throwIfClosed(),n}next(e){super.next(this._value=e)}};var Go=class extends Q{constructor(e,r){super()}schedule(e,r=0){return this}};var Mr={setInterval(t,e,...r){let{delegate:n}=Mr;return n?.setInterval?n.setInterval(t,e,...r):setInterval(t,e,...r)},clearInterval(t){let{delegate:e}=Mr;return(e?.clearInterval||clearInterval)(t)},delegate:void 0};var Ke=class extends Go{constructor(e,r){super(e,r),this.scheduler=e,this.work=r,this.pending=!1}schedule(e,r=0){var n;if(this.closed)return this;this.state=e;let o=this.id,i=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(i,o,r)),this.pending=!0,this.delay=r,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(i,this.id,r),this}requestAsyncId(e,r,n=0){return Mr.setInterval(e.flush.bind(e,this),n)}recycleAsyncId(e,r,n=0){if(n!=null&&this.delay===n&&this.pending===!1)return r;r!=null&&Mr.clearInterval(r)}execute(e,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let n=this._execute(e,r);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,r){let n=!1,o;try{this.work(e)}catch(i){n=!0,o=i||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),o}unsubscribe(){if(!this.closed){let{id:e,scheduler:r}=this,{actions:n}=r;this.work=this.state=this.scheduler=null,this.pending=!1,en(n,this),e!=null&&(this.id=this.recycleAsyncId(r,e,null)),this.delay=null,super.unsubscribe()}}};var _v=1,wa,Ca={};function Od(t){return t in Ca?(delete Ca[t],!0):!1}var Pd={setImmediate(t){let e=_v++;return Ca[e]=!0,wa||(wa=Promise.resolve()),wa.then(()=>Od(e)&&t()),e},clearImmediate(t){Od(t)}};var{setImmediate:Av,clearImmediate:Nv}=Pd,Sr={setImmediate(...t){let{delegate:e}=Sr;return(e?.setImmediate||Av)(...t)},clearImmediate(t){let{delegate:e}=Sr;return(e?.clearImmediate||Nv)(t)},delegate:void 0};var qo=class extends Ke{constructor(e,r){super(e,r),this.scheduler=e,this.work=r}requestAsyncId(e,r,n=0){return n!==null&&n>0?super.requestAsyncId(e,r,n):(e.actions.push(this),e._scheduled||(e._scheduled=Sr.setImmediate(e.flush.bind(e,void 0))))}recycleAsyncId(e,r,n=0){var o;if(n!=null?n>0:this.delay>0)return super.recycleAsyncId(e,r,n);let{actions:i}=e;r!=null&&((o=i[i.length-1])===null||o===void 0?void 0:o.id)!==r&&(Sr.clearImmediate(r),e._scheduled===r&&(e._scheduled=void 0))}};var Pn=class t{constructor(e,r=t.now){this.schedulerActionCtor=e,this.now=r}schedule(e,r=0,n){return new this.schedulerActionCtor(this,e).schedule(n,r)}};Pn.now=Ir.now;var Je=class extends Pn{constructor(e,r=Pn.now){super(e,r),this.actions=[],this._active=!1}flush(e){let{actions:r}=this;if(this._active){r.push(e);return}let n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=r.shift());if(this._active=!1,n){for(;e=r.shift();)e.unsubscribe();throw n}}};var Zo=class extends Je{flush(e){this._active=!0;let r=this._scheduled;this._scheduled=void 0;let{actions:n}=this,o;e=e||n.shift();do if(o=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===r&&n.shift());if(this._active=!1,o){for(;(e=n[0])&&e.id===r&&n.shift();)e.unsubscribe();throw o}}};var Rv=new Zo(qo);var Xe=new Je(Ke),Ea=Xe;var Yo=class extends Ke{constructor(e,r){super(e,r),this.scheduler=e,this.work=r}schedule(e,r=0){return r>0?super.schedule(e,r):(this.delay=r,this.state=e,this.scheduler.flush(this),this)}execute(e,r){return r>0||this.closed?super.execute(e,r):this._execute(e,r)}requestAsyncId(e,r,n=0){return n!=null&&n>0||n==null&&this.delay>0?super.requestAsyncId(e,r,n):(e.flush(this),0)}};var Qo=class extends Je{};var Ov=new Qo(Yo);var Ko=class extends Ke{constructor(e,r){super(e,r),this.scheduler=e,this.work=r}requestAsyncId(e,r,n=0){return n!==null&&n>0?super.requestAsyncId(e,r,n):(e.actions.push(this),e._scheduled||(e._scheduled=On.requestAnimationFrame(()=>e.flush(void 0))))}recycleAsyncId(e,r,n=0){var o;if(n!=null?n>0:this.delay>0)return super.recycleAsyncId(e,r,n);let{actions:i}=e;r!=null&&((o=i[i.length-1])===null||o===void 0?void 0:o.id)!==r&&(On.cancelAnimationFrame(r),e._scheduled=void 0)}};var Jo=class extends Je{flush(e){this._active=!0;let r=this._scheduled;this._scheduled=void 0;let{actions:n}=this,o;e=e||n.shift();do if(o=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===r&&n.shift());if(this._active=!1,o){for(;(e=n[0])&&e.id===r&&n.shift();)e.unsubscribe();throw o}}};var Pv=new Jo(Ko);var Ie=new k(t=>t.complete());function Xo(t){return t&&M(t.schedule)}function Ia(t){return t[t.length-1]}function Fn(t){return M(Ia(t))?t.pop():void 0}function et(t){return Xo(Ia(t))?t.pop():void 0}function Fd(t,e){return typeof Ia(t)=="number"?t.pop():e}function pe(t,e,r,n=0,o=!1){let i=e.schedule(function(){r(),o?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(i),!o)return i}function Tr(t,e=0){return b((r,n)=>{r.subscribe(I(n,o=>pe(n,t,()=>n.next(o),e),()=>pe(n,t,()=>n.complete(),e),o=>pe(n,t,()=>n.error(o),e)))})}function xr(t,e=0){return b((r,n)=>{n.add(t.schedule(()=>r.subscribe(n),e))})}function kd(t,e){return P(t).pipe(xr(e),Tr(e))}function Ld(t,e){return P(t).pipe(xr(e),Tr(e))}function jd(t,e){return new k(r=>{let n=0;return e.schedule(function(){n===t.length?r.complete():(r.next(t[n++]),r.closed||this.schedule())})})}function Vd(t,e){return new k(r=>{let n;return pe(r,e,()=>{n=t[Bo](),pe(r,e,()=>{let o,i;try{({value:o,done:i}=n.next())}catch(s){r.error(s);return}i?r.complete():r.next(o)},0,!0)}),()=>M(n?.return)&&n.return()})}function ei(t,e){if(!t)throw new Error("Iterable cannot be null");return new k(r=>{pe(r,e,()=>{let n=t[Symbol.asyncIterator]();pe(r,e,()=>{n.next().then(o=>{o.done?r.complete():r.next(o.value)})},0,!0)})})}function $d(t,e){return ei(zo(t),e)}function Ud(t,e){if(t!=null){if(Vo(t))return kd(t,e);if(An(t))return jd(t,e);if(jo(t))return Ld(t,e);if($o(t))return ei(t,e);if(Ho(t))return Vd(t,e);if(Wo(t))return $d(t,e)}throw Uo(t)}function G(t,e){return e?Ud(t,e):P(t)}function T(...t){let e=et(t);return G(t,e)}function kn(t,e){let r=M(t)?t:()=>t,n=o=>o.error(r());return new k(e?o=>e.schedule(n,0,o):n)}function ba(t){return!!t&&(t instanceof k||M(t.lift)&&M(t.subscribe))}var yt=jt(t=>function(){t(this),this.name="EmptyError",this.message="no elements in sequence"});function ti(t){return t instanceof Date&&!isNaN(t)}var Fv=jt(t=>function(r=null){t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r});function kv(t,e){let{first:r,each:n,with:o=Lv,scheduler:i=e??Xe,meta:s=null}=ti(t)?{first:t}:typeof t=="number"?{each:t}:t;if(r==null&&n==null)throw new TypeError("No timeout provided.");return b((a,u)=>{let c,l,d=null,f=0,h=p=>{l=pe(u,i,()=>{try{c.unsubscribe(),P(o({meta:s,lastValue:d,seen:f})).subscribe(u)}catch(S){u.error(S)}},p)};c=a.subscribe(I(u,p=>{l?.unsubscribe(),f++,u.next(d=p),n>0&&h(n)},void 0,void 0,()=>{l?.closed||l?.unsubscribe(),d=null})),!f&&h(r!=null?typeof r=="number"?r:+r-i.now():n)})}function Lv(t){throw new Fv(t)}var{isArray:jv}=Array;function Vv(t,e){return jv(e)?t(...e):t(e)}function Ln(t){return O(e=>Vv(t,e))}var{isArray:$v}=Array,{getPrototypeOf:Uv,prototype:Bv,keys:Hv}=Object;function ni(t){if(t.length===1){let e=t[0];if($v(e))return{args:e,keys:null};if(zv(e)){let r=Hv(e);return{args:r.map(n=>e[n]),keys:r}}}return{args:t,keys:null}}function zv(t){return t&&typeof t=="object"&&Uv(t)===Bv}function ri(t,e){return t.reduce((r,n,o)=>(r[n]=e[o],r),{})}function _r(...t){let e=et(t),r=Fn(t),{args:n,keys:o}=ni(t);if(n.length===0)return G([],e);let i=new k(Wv(n,e,o?s=>ri(o,s):le));return r?i.pipe(Ln(r)):i}function Wv(t,e,r=le){return n=>{Bd(e,()=>{let{length:o}=t,i=new Array(o),s=o,a=o;for(let u=0;u<o;u++)Bd(e,()=>{let c=G(t[u],e),l=!1;c.subscribe(I(n,d=>{i[u]=d,l||(l=!0,a--),a||n.next(r(i.slice()))},()=>{--s||n.complete()}))},n)},n)}}function Bd(t,e,r){t?pe(r,t,e):e()}function Hd(t,e,r,n,o,i,s,a){let u=[],c=0,l=0,d=!1,f=()=>{d&&!u.length&&!c&&e.complete()},h=S=>c<n?p(S):u.push(S),p=S=>{i&&e.next(S),c++;let C=!1;P(r(S,l++)).subscribe(I(e,m=>{o?.(m),i?h(m):e.next(m)},()=>{C=!0},void 0,()=>{if(C)try{for(c--;u.length&&c<n;){let m=u.shift();s?pe(e,s,()=>p(m)):p(m)}f()}catch(m){e.error(m)}}))};return t.subscribe(I(e,h,()=>{d=!0,f()})),()=>{a?.()}}function K(t,e,r=1/0){return M(e)?K((n,o)=>O((i,s)=>e(n,i,o,s))(P(t(n,o))),r):(typeof e=="number"&&(r=e),b((n,o)=>Hd(n,o,t,r)))}function tt(t=1/0){return K(le,t)}function zd(){return tt(1)}function jn(...t){return zd()(G(t,et(t)))}function oi(t){return new k(e=>{P(t()).subscribe(e)})}function Gv(...t){let e=Fn(t),{args:r,keys:n}=ni(t),o=new k(i=>{let{length:s}=r;if(!s){i.complete();return}let a=new Array(s),u=s,c=s;for(let l=0;l<s;l++){let d=!1;P(r[l]).subscribe(I(i,f=>{d||(d=!0,c--),a[l]=f},()=>u--,void 0,()=>{(!u||!d)&&(c||i.next(n?ri(n,a):a),i.complete())}))}});return e?o.pipe(Ln(e)):o}var qv=["addListener","removeListener"],Zv=["addEventListener","removeEventListener"],Yv=["on","off"];function Ma(t,e,r,n){if(M(r)&&(n=r,r=void 0),n)return Ma(t,e,r).pipe(Ln(n));let[o,i]=Jv(t)?Zv.map(s=>a=>t[s](e,a,r)):Qv(t)?qv.map(Wd(t,e)):Kv(t)?Yv.map(Wd(t,e)):[];if(!o&&An(t))return K(s=>Ma(s,e,r))(P(t));if(!o)throw new TypeError("Invalid event target");return new k(s=>{let a=(...u)=>s.next(1<u.length?u:u[0]);return o(a),()=>i(a)})}function Wd(t,e){return r=>n=>t[r](e,n)}function Qv(t){return M(t.addListener)&&M(t.removeListener)}function Kv(t){return M(t.on)&&M(t.off)}function Jv(t){return M(t.addEventListener)&&M(t.removeEventListener)}function Ar(t=0,e,r=Ea){let n=-1;return e!=null&&(Xo(e)?r=e:n=e),new k(o=>{let i=ti(t)?+t-r.now():t;i<0&&(i=0);let s=0;return r.schedule(function(){o.closed||(o.next(s++),0<=n?this.schedule(void 0,n):o.complete())},i)})}function Xv(t=0,e=Xe){return t<0&&(t=0),Ar(t,t,e)}function ey(...t){let e=et(t),r=Fd(t,1/0),n=t;return n.length?n.length===1?P(n[0]):tt(r)(G(n,e)):Ie}function Gd(t,e){return(r,n)=>!t.call(e,r,n)}function te(t,e){return b((r,n)=>{let o=0;r.subscribe(I(n,i=>t.call(e,i,o++)&&n.next(i)))})}function ty(t,e,r){return[te(e,r)(P(t)),te(Gd(e,r))(P(t))]}function qd(t){return b((e,r)=>{let n=!1,o=null,i=null,s=!1,a=()=>{if(i?.unsubscribe(),i=null,n){n=!1;let c=o;o=null,r.next(c)}s&&r.complete()},u=()=>{i=null,s&&r.complete()};e.subscribe(I(r,c=>{n=!0,o=c,i||P(t(c)).subscribe(i=I(r,a,u))},()=>{s=!0,(!n||!i||i.closed)&&r.complete()}))})}function ny(t,e=Xe){return qd(()=>Ar(t,e))}function Dt(t){return b((e,r)=>{let n=null,o=!1,i;n=e.subscribe(I(r,void 0,void 0,s=>{i=P(t(s,Dt(t)(e))),n?(n.unsubscribe(),n=null,i.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(r))})}function Zd(t,e,r,n,o){return(i,s)=>{let a=r,u=e,c=0;i.subscribe(I(s,l=>{let d=c++;u=a?t(u,l,d):(a=!0,l),n&&s.next(u)},o&&(()=>{a&&s.next(u),s.complete()})))}}function nt(t,e){return M(e)?K(t,e,1):K(t,1)}function ry(t){return b((e,r)=>{let n=!1,o=null,i=null,s=()=>{if(i?.unsubscribe(),i=null,n){n=!1;let a=o;o=null,r.next(a)}};e.subscribe(I(r,a=>{i?.unsubscribe(),n=!0,o=a,i=I(r,s,He),P(t(a)).subscribe(i)},()=>{s(),r.complete()},void 0,()=>{o=i=null}))})}function oy(t,e=Xe){return b((r,n)=>{let o=null,i=null,s=null,a=()=>{if(o){o.unsubscribe(),o=null;let c=i;i=null,n.next(c)}};function u(){let c=s+t,l=e.now();if(l<c){o=this.schedule(void 0,c-l),n.add(o);return}a()}r.subscribe(I(n,c=>{i=c,s=e.now(),o||(o=e.schedule(u,t),n.add(o))},()=>{a(),n.complete()},void 0,()=>{i=o=null}))})}function Vt(t){return b((e,r)=>{let n=!1;e.subscribe(I(r,o=>{n=!0,r.next(o)},()=>{n||r.next(t),r.complete()}))})}function wt(t){return t<=0?()=>Ie:b((e,r)=>{let n=0;e.subscribe(I(r,o=>{++n<=t&&(r.next(o),t<=n&&r.complete())}))})}function iy(){return b((t,e)=>{t.subscribe(I(e,He))})}function Sa(t){return O(()=>t)}function sy(t,e=le){return t=t??ay,b((r,n)=>{let o,i=!0;r.subscribe(I(n,s=>{let a=e(s);(i||!t(o,a))&&(i=!1,o=a,n.next(s))}))})}function ay(t,e){return t===e}function ii(t=uy){return b((e,r)=>{let n=!1;e.subscribe(I(r,o=>{n=!0,r.next(o)},()=>n?r.complete():r.error(t())))})}function uy(){return new yt}function cy(t,e){return b((r,n)=>{let o=0;r.subscribe(I(n,i=>{t.call(e,i,o++,r)||(n.next(!1),n.complete())},()=>{n.next(!0),n.complete()}))})}function $t(t){return b((e,r)=>{try{e.subscribe(r)}finally{r.add(t)}})}function rt(t,e){let r=arguments.length>=2;return n=>n.pipe(t?te((o,i)=>t(o,i,n)):le,wt(1),r?Vt(e):ii(()=>new yt))}function Vn(t){return t<=0?()=>Ie:b((e,r)=>{let n=[];e.subscribe(I(r,o=>{n.push(o),t<n.length&&n.shift()},()=>{for(let o of n)r.next(o);r.complete()},void 0,()=>{n=null}))})}function Ta(t,e){let r=arguments.length>=2;return n=>n.pipe(t?te((o,i)=>t(o,i,n)):le,Vn(1),r?Vt(e):ii(()=>new yt))}function si(t,e){return b(Zd(t,e,arguments.length>=2,!0))}function ly(t){return te((e,r)=>t<=r)}function xa(...t){let e=et(t);return b((r,n)=>{(e?jn(t,r,e):jn(t,r)).subscribe(n)})}function ue(t,e){return b((r,n)=>{let o=null,i=0,s=!1,a=()=>s&&!o&&n.complete();r.subscribe(I(n,u=>{o?.unsubscribe();let c=0,l=i++;P(t(u,l)).subscribe(o=I(n,d=>n.next(e?e(u,d,l,c++):d),()=>{o=null,a()}))},()=>{s=!0,a()}))})}function dy(t,e){return M(e)?ue(()=>t,e):ue(()=>t)}function ai(t){return b((e,r)=>{P(t).subscribe(I(r,()=>r.complete(),He)),!r.closed&&e.subscribe(r)})}function fy(t,e=!1){return b((r,n)=>{let o=0;r.subscribe(I(n,i=>{let s=t(i,o++);(s||e)&&n.next(i),!s&&n.complete()}))})}function ne(t,e,r){let n=M(t)||e||r?{next:t,error:e,complete:r}:t;return n?b((o,i)=>{var s;(s=n.subscribe)===null||s===void 0||s.call(n);let a=!0;o.subscribe(I(i,u=>{var c;(c=n.next)===null||c===void 0||c.call(n,u),i.next(u)},()=>{var u;a=!1,(u=n.complete)===null||u===void 0||u.call(n),i.complete()},u=>{var c;a=!1,(c=n.error)===null||c===void 0||c.call(n,u),i.error(u)},()=>{var u,c;a&&((u=n.unsubscribe)===null||u===void 0||u.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):le}function hy(...t){let e=Fn(t);return b((r,n)=>{let o=t.length,i=new Array(o),s=t.map(()=>!1),a=!1;for(let u=0;u<o;u++)P(t[u]).subscribe(I(n,c=>{i[u]=c,!a&&!s[u]&&(s[u]=!0,(a=s.every(le))&&(s=null))},He));r.subscribe(I(n,u=>{if(a){let c=[u,...i];n.next(e?e(...c):c)}}))})}var Yd=null;var _a=1;function se(t){let e=Yd;return Yd=t,e}var Qd={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function py(t){if(!(Ra(t)&&!t.dirty)&&!(!t.dirty&&t.lastCleanEpoch===_a)){if(!t.producerMustRecompute(t)&&!Aa(t)){t.dirty=!1,t.lastCleanEpoch=_a;return}t.producerRecomputeValue(t),t.dirty=!1,t.lastCleanEpoch=_a}}function Kd(t){return t&&(t.nextProducerIndex=0),se(t)}function Jd(t,e){if(se(e),!(!t||t.producerNode===void 0||t.producerIndexOfThis===void 0||t.producerLastReadVersion===void 0)){if(Ra(t))for(let r=t.nextProducerIndex;r<t.producerNode.length;r++)Na(t.producerNode[r],t.producerIndexOfThis[r]);for(;t.producerNode.length>t.nextProducerIndex;)t.producerNode.pop(),t.producerLastReadVersion.pop(),t.producerIndexOfThis.pop()}}function Aa(t){ui(t);for(let e=0;e<t.producerNode.length;e++){let r=t.producerNode[e],n=t.producerLastReadVersion[e];if(n!==r.version||(py(r),n!==r.version))return!0}return!1}function Xd(t){if(ui(t),Ra(t))for(let e=0;e<t.producerNode.length;e++)Na(t.producerNode[e],t.producerIndexOfThis[e]);t.producerNode.length=t.producerLastReadVersion.length=t.producerIndexOfThis.length=0,t.liveConsumerNode&&(t.liveConsumerNode.length=t.liveConsumerIndexOfThis.length=0)}function Na(t,e){if(gy(t),ui(t),t.liveConsumerNode.length===1)for(let n=0;n<t.producerNode.length;n++)Na(t.producerNode[n],t.producerIndexOfThis[n]);let r=t.liveConsumerNode.length-1;if(t.liveConsumerNode[e]=t.liveConsumerNode[r],t.liveConsumerIndexOfThis[e]=t.liveConsumerIndexOfThis[r],t.liveConsumerNode.length--,t.liveConsumerIndexOfThis.length--,e<t.liveConsumerNode.length){let n=t.liveConsumerIndexOfThis[e],o=t.liveConsumerNode[e];ui(o),o.producerIndexOfThis[n]=e}}function Ra(t){return t.consumerIsAlwaysLive||(t?.liveConsumerNode?.length??0)>0}function ui(t){t.producerNode??=[],t.producerIndexOfThis??=[],t.producerLastReadVersion??=[]}function gy(t){t.liveConsumerNode??=[],t.liveConsumerIndexOfThis??=[]}function my(){throw new Error}var vy=my;function ef(t){vy=t}function z(t){for(let e in t)if(t[e]===z)return e;throw Error("Could not find renamed property on target object.")}function ci(t,e){for(let r in e)e.hasOwnProperty(r)&&!t.hasOwnProperty(r)&&(t[r]=e[r])}function ge(t){if(typeof t=="string")return t;if(Array.isArray(t))return"["+t.map(ge).join(", ")+"]";if(t==null)return""+t;if(t.overriddenName)return`${t.overriddenName}`;if(t.name)return`${t.name}`;let e=t.toString();if(e==null)return""+e;let r=e.indexOf(`
4
4
  `);return r===-1?e:e.substring(0,r)}function Ya(t,e){return t==null||t===""?e===null?"":e:e==null||e===""?t:t+" "+e}var yy=z({__forward_ref__:z});function zf(t){return t.__forward_ref__=zf,t.toString=function(){return ge(this())},t}function we(t){return Wf(t)?t():t}function Wf(t){return typeof t=="function"&&t.hasOwnProperty(yy)&&t.__forward_ref__===zf}function Gf(t){return t&&!!t.\u0275providers}var qf="https://g.co/ng/security#xss",v=class extends Error{constructor(e,r){super(zi(e,r)),this.code=e}};function zi(t,e){return`${`NG0${Math.abs(t)}`}${e?": "+e:""}`}var Dy=z({\u0275cmp:z}),wy=z({\u0275dir:z}),Cy=z({\u0275pipe:z}),Ey=z({\u0275mod:z}),Ii=z({\u0275fac:z}),Nr=z({__NG_ELEMENT_ID__:z}),tf=z({__NG_ENV_ID__:z});function sn(t){return typeof t=="string"?t:t==null?"":String(t)}function Iy(t){return typeof t=="function"?t.name||t.toString():typeof t=="object"&&t!=null&&typeof t.type=="function"?t.type.name||t.type.toString():sn(t)}function by(t,e){let r=e?`. Dependency path: ${e.join(" > ")} > ${t}`:"";throw new v(-200,`Circular dependency in DI detected for ${t}${r}`)}function ac(t,e){let r=e?` in ${e}`:"";throw new v(-201,!1)}function My(t,e){t==null&&Sy(e,t,null,"!=")}function Sy(t,e,r,n){throw new Error(`ASSERTION ERROR: ${t}`+(n==null?"":` [Expected=> ${r} ${n} ${e} <=Actual]`))}function w(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function Mt(t){return{providers:t.providers||[],imports:t.imports||[]}}function Wi(t){return nf(t,Yf)||nf(t,Qf)}function Zf(t){return Wi(t)!==null}function nf(t,e){return t.hasOwnProperty(e)?t[e]:null}function Ty(t){let e=t&&(t[Yf]||t[Qf]);return e||null}function rf(t){return t&&(t.hasOwnProperty(of)||t.hasOwnProperty(xy))?t[of]:null}var Yf=z({\u0275prov:z}),of=z({\u0275inj:z}),Qf=z({ngInjectableDef:z}),xy=z({ngInjectorDef:z}),F=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}(F||{}),Qa;function Kf(){return Qa}function be(t){let e=Qa;return Qa=t,e}function Jf(t,e,r){let n=Wi(t);if(n&&n.providedIn=="root")return n.value===void 0?n.value=n.factory():n.value;if(r&F.Optional)return null;if(e!==void 0)return e;ac(ge(t),"Injector")}var X=globalThis;var E=class{constructor(e,r){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,typeof r=="number"?this.__NG_ELEMENT_ID__=r:r!==void 0&&(this.\u0275prov=w({token:this,providedIn:r.providedIn||"root",factory:r.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};var _y={},Or=_y,Ka="__NG_DI_FLAG__",bi="ngTempTokenPath",Ay="ngTokenPath",Ny=/\n/gm,Ry="\u0275",sf="__source",zn;function Oy(){return zn}function Ut(t){let e=zn;return zn=t,e}function Py(t,e=F.Default){if(zn===void 0)throw new v(-203,!1);return zn===null?Jf(t,void 0,e):zn.get(t,e&F.Optional?null:void 0,e)}function y(t,e=F.Default){return(Kf()||Py)(we(t),e)}function g(t,e=F.Default){return y(t,Gi(e))}function Gi(t){return typeof t>"u"||typeof t=="number"?t:0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function Ja(t){let e=[];for(let r=0;r<t.length;r++){let n=we(t[r]);if(Array.isArray(n)){if(n.length===0)throw new v(900,!1);let o,i=F.Default;for(let s=0;s<n.length;s++){let a=n[s],u=Fy(a);typeof u=="number"?u===-1?o=a.token:i|=u:o=a}e.push(y(o,i))}else e.push(y(n))}return e}function Xf(t,e){return t[Ka]=e,t.prototype[Ka]=e,t}function Fy(t){return t[Ka]}function ky(t,e,r,n){let o=t[bi];throw e[sf]&&o.unshift(e[sf]),t.message=Ly(`
@@ -1 +1 @@
1
- import{e as p}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-VX5ROJLM.js";import{$ as c,ca as a,q as n}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MGVAWFYU.js";var f=(()=>{let t=class t{constructor(r){this.httpService=r}getInventoryAsyncLog(r){return this.httpService.post("api/Inventory/GetAsyncLog",r).pipe(n(e=>(e.hits=e.hits.map(i=>(i.DurationInSecond=parseInt(i._source?.Duration)/1e3,i)),e)))}getInventoryAsyncLogDetail(r){return this.httpService.post("api/Inventory/GetAsyncLogDetail",{ID:r})}};t.\u0275fac=function(e){return new(e||t)(a(p))},t.\u0275prov=c({token:t,factory:t.\u0275fac,providedIn:"root"});let o=t;return o})();export{f as a};
1
+ import{e as p}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-OPU2YPBG.js";import{$ as c,ca as a,q as n}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-3TYJJ4PH.js";var f=(()=>{let t=class t{constructor(r){this.httpService=r}getInventoryAsyncLog(r){return this.httpService.post("api/Inventory/GetAsyncLog",r).pipe(n(e=>(e.hits=e.hits.map(i=>(i.DurationInSecond=parseInt(i._source?.Duration)/1e3,i)),e)))}getInventoryAsyncLogDetail(r){return this.httpService.post("api/Inventory/GetAsyncLogDetail",{ID:r})}};t.\u0275fac=function(e){return new(e||t)(a(p))},t.\u0275prov=c({token:t,factory:t.\u0275fac,providedIn:"root"});let o=t;return o})();export{f as a};
@@ -1,2 +1,2 @@
1
- import{a as E,b as Ie,c as ne,d as ie}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-5LICD27P.js";import{a as ye,b as Te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-I7PLLVEH.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-W7OIIPRU.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-ZLME6FEU.js";import{a as be,b as we}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-FBU5QXHN.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6HLIRI7N.js";import{a as te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-AO2MXRCQ.js";import{a as X}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-PUSB4EIC.js";import{a as ee}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-NEAQH3FX.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-IOUI2FZD.js";import{c as W}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-K5FAZTRK.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-BUG6II55.js";import{a as xe,b as Se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MLMGMDJA.js";import{b as z,e as Q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-VX5ROJLM.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-V752HOUZ.js";import{a as ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MBHOZDLB.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-PP4T4PLJ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-HVNMMTYL.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-DKPFXQNF.js";import{d as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-2FZAKLVH.js";import{a as le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-G4PZ5CPL.js";import{t as Z,u as Ce,v as q,w as fe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-IM6ZDC7I.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-JWESCPR3.js";import{b as he,c as G,h as K,k as J,m as Y,u as ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6YFZBURX.js";import{c as b}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-KPTAVWMG.js";import{$a as S,B as P,Cb as f,Db as x,Eb as re,Fa as s,Ga as y,Hc as _e,Lb as R,Lc as H,Oa as c,Ua as g,X as k,Xb as pe,Za as r,Zb as me,_a as l,_b as $,aa as B,ab as T,bb as M,bc as L,cc as de,db as v,ea as F,ec as U,fa as O,fc as j,hb as u,ja as _,jb as p,ka as h,mb as ce,ob as A,pb as m,q as se,qb as V,rb as I,wb as oe,za as N}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MGVAWFYU.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6RUGKYFT.js";var Me=(()=>{let o=class o{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=F({type:o,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,a){n&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),S(3,"nav-tab",2),l()()(),S(4,"router-outlet")),n&2&&(s(3),c("Tabs",a.inventoryTabs))},dependencies:[_e,xe]});let i=o;return i})();function Le(i,o){if(i&1){let e=v();r(0,"button",22),u("click",function(){_(e);let n=p(3);return h(n.openScanDialog())}),S(1,"i",23),m(2," Scan Channel "),l()}}function Ue(i,o){if(i&1){let e=v();r(0,"button",24),u("click",function(){_(e);let n=p().ngIf,a=p(2);return h(a.onUpdateItems(n))}),S(1,"i",25),m(2," Update "),l()}}function je(i,o){if(i&1&&(r(0,"actions")(1,"div",3)(2,"div"),g(3,Le,3,0,"button",20)(4,Ue,3,0,"button",21),l()()()),i&2){let e=o.ngIf,t=p(2);s(3),c("ngIf",!t.productService.hasSelectionVariant(e)),s(1),c("ngIf",t.productService.hasSelectionVariant(e))}}function ze(i,o){if(i&1){let e=v();r(0,"app-table",26),u("onToggle",function(n){_(e);let a=p(2);return h(a.onShowDifferenceStock(n))})("onSubmit",function(n){let d=_(e).ngIf,C=p(2);return h(C.updateStockByVariant(n,d))}),l()}if(i&2){let e=o.ngIf,t=p(2);c("data",e)("channel",t.channelOptions)("showProductToggle",!0)("filter",t.searchFilter)}}function Qe(i,o){if(i&1){let e=v();r(0,"span",27),u("click",function(){_(e);let n=p(2);return h(n.getRowCount())}),r(1,"i",28),m(2,"?"),l()()}}function He(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=o.ngIf;s(1),V(x(2,1,e))}}function Ge(i,o){if(i&1){let e=v();r(0,"a",29),u("click",function(){_(e);let n=p(2);return h(n.nextPage())}),S(1,"i",30),m(2," Next"),l()}}function Ke(i,o){if(i&1){let e=v();r(0,"a",31),u("click",function(){_(e);let n=p(2);return h(n.getAllData())}),S(1,"i",32),m(2," Last"),l()}}function Je(i,o){if(i&1){let e=v();r(0,"mainpanel",1),u("onSubmit",function(n){_(e);let a=p();return h(a.onSearch(n))}),g(1,je,5,2,"actions",2),f(2,"async"),r(3,"filters")(4,"div",3)(5,"div",4)(6,"div")(7,"label",5),m(8,"PageNumber"),l(),r(9,"input",6),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.PageNumber=n)}),l()(),r(10,"div")(11,"label",7),m(12,"Page Size"),l(),r(13,"input",8),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.RowCount=n)}),l()()()()(),r(14,"content")(15,"div",9)(16,"div",10)(17,"div",11),g(18,ze,1,4,"app-table",12),f(19,"async"),T(20),r(21,"div",13)(22,"div",14)(23,"div",15),m(24),f(25,"number"),f(26,"async"),g(27,Qe,3,0,"span",16)(28,He,3,3,"span",2),f(29,"async"),m(30),l()(),r(31,"div",17),g(32,Ge,3,0,"a",18)(33,Ke,3,0,"a",19),l()(),M(),l()()()()()}if(i&2){let e=p(),t;c("pageData",e.pageData)("hideSearchBox",!1)("textButton","Search"),s(1),c("ngIf",x(2,13,e.paginationService.data$)),s(8),c("ngModel",e.searchFilter.PageNumber),s(4),c("ngModel",e.searchFilter.RowCount),s(5),c("ngIf",x(19,15,e.paginationService.data$)),s(6),I(" Showing 1 - ",x(25,17,(t=x(26,19,e.paginationService.data$))==null?null:t.length)," of "),s(3),c("ngIf",e.paginationService.hideCount),s(1),c("ngIf",x(29,21,!e.paginationService.hideCount&&e.allDataCount$)),s(2),I(" records ~ ",e.paginationService.footerPageNumber," Page "),s(2),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}var De=(()=>{let o=class o{constructor(t,n,a,d,C){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=d,this.productService=C,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{this.channelOptions=t.Options.Channel,t.Filter={PageNumber:t.Filter.PageNumber,filterModel:E.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,n){let a=this.productService.selectedVariantProduct(t);if(a.length>0){let C=a.map(w=>({ID:w.ID,Code:w.Code,Inventory:w.Inventory}));var d=n.filter(w=>w.selected).map(w=>w.ID);let D={ListChannelID:d,List:C};this.http.post("/api/Inventory/UpdateChannel",D).subscribe(w=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+D.List.length+" variants in "+D.ListChannelID.length+" channels","Success")})}}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(X,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(P(a=>b.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct),this.initPageLoader()}this.searchFilter.ChannelID=b.GuidEMpty})}updateStockByVariant(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(d=>{let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+C.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=E.DIFFERENCE:this.searchFilter.filterModel=E.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let n=this.productService.selectedVariantProduct(t);this.dialog.open(ye,{data:{selectedItems:n,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe(P(a=>b.IsNotEmpty(a))).subscribe(a=>{this.updateStock(t,a)})}getRowCount(){this.paginationService.hideCount=!1;let t={text:this.searchFilter.text};this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,t)}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(Q),y(z),y(W),y(te),y(ee))},o.\u0275cmp=F({type:o,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit"],[4,"ngIf"],[1,"d-flex"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(g(0,Je,34,23,"mainpanel",0),f(1,"async")),n&2&&c("ngIf",x(1,1,a.loader$))},dependencies:[$,G,Y,K,J,q,ne,Z,L,U],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();function Ye(i,o){if(i&1){let e=v();r(0,"button",36),u("click",function(){_(e);let n=p(2).ngIf,a=p();return h(a.openScanDialog(n))}),S(1,"i",37),m(2," Scan Channel "),l()}}function Ze(i,o){if(i&1){let e=v();r(0,"button",38),u("click",function(){_(e);let n=p().ngIf,a=p(2);return h(a.updateStock(n))}),S(1,"i",39),m(2," Update"),l()}}function qe(i,o){if(i&1&&(r(0,"div"),g(1,Ye,3,0,"button",34)(2,Ze,3,0,"button",35),l()),i&2){let e=o.ngIf,t=p(2);s(1),c("ngIf",!t.productService.hasSelectionVariant(e)),s(1),c("ngIf",t.productService.hasSelectionVariant(e))}}function We(i,o){i&1&&(r(0,"div",40)(1,"span"),m(2," showing only different stock, please press next to populate more data "),l()())}function Xe(i,o){if(i&1){let e=v();r(0,"th")(1,"input",41),u("ngModelChange",function(n){_(e);let a=p(2);return h(a.checkboxState=n)})("ngModelChange",function(){let a=_(e).ngIf,d=p(2);return h(d.onCheckboxStateChange(a))}),l()()}if(i&2){let e=p(2);s(1),c("ngModel",e.checkboxState)}}function et(i,o){i&1&&(T(0),r(1,"th",42),m(2," Reserved "),l(),M())}function tt(i,o){if(i&1){let e=v();r(0,"input",68),u("ngModelChange",function(n){_(e);let a=p(3).$implicit;return h(a.selected=n)})("ngModelChange",function(){_(e);let n=p(3).$implicit,a=p(2);return h(a.onCheckboxStateProduct(n))}),l()}if(i&2){let e=p(3).$implicit;c("ngModel",e.selected)}}function nt(i,o){if(i&1){let e=v();r(0,"img",69),u("click",function(n){_(e);let a=p(3).$implicit,d=p(2);return h(d.onZoomImage(n,a==null?null:a.ImageUrl))}),l()}if(i&2){let e=p(3).$implicit;ce("src",e==null?null:e.ThumbnailUrl,N)}}function it(i,o){i&1&&S(0,"img",70)}function at(i,o){if(i&1&&(T(0),r(1,"td",59)(2,"div",60),g(3,tt,1,1,"input",61)(4,nt,1,1,"img",62)(5,it,1,0,"ng-template",null,63,R),l()(),r(7,"td",64)(8,"span",65),m(9),l(),S(10,"br"),r(11,"div",66),S(12,"i",67),r(13,"small"),m(14),l()()(),M()),i&2){let e=A(6),t=p().$implicit,n=p().$implicit;s(1),c("rowSpan",n==null?null:n.Variants.length),s(2),c("ngIf",(t==null?null:t.Inventory)>=0||n.Variants.length>1),s(1),c("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",e),s(3),c("rowSpan",n==null?null:n.Variants.length),s(2),V(n==null?null:n.Name),s(5),I("(",n==null?null:n.Category,")")}}function ot(i,o){if(i&1){let e=v();T(0),r(1,"input",41),u("ngModelChange",function(n){_(e);let a=p(2).$implicit;return h(a.selected=n)}),l(),M()}if(i&2){let e=p(2).$implicit;s(1),c("ngModel",e.selected)}}function rt(i,o){if(i&1&&(T(0),g(1,ot,2,1,"ng-container",3),M()),i&2){let e=p().$implicit;s(1),c("ngIf",(e==null?null:e.Inventory)<=1e5)}}function lt(i,o){if(i&1){let e=v();r(0,"input",41),u("ngModelChange",function(n){_(e);let a=p(2).$implicit;return h(a.selected=n)}),l()}if(i&2){let e=p(2).$implicit;c("ngModel",e.selected)}}function st(i,o){if(i&1&&g(0,lt,1,1,"input",71),i&2){let e=p().$implicit;c("ngIf",(e==null?null:e.Inventory)>=0)}}function ct(i,o){if(i&1&&(r(0,"span")(1,"span",72),m(2),f(3,"number"),l(),m(4," => "),r(5,"span",73),m(6),f(7,"number"),l()()),i&2){let e=p().$implicit;s(2),I(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),V(x(7,4,e==null?null:e.Inventory))}}function pt(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=p().$implicit;s(1),I(" ",x(2,1,e==null?null:e.Inventory)," ")}}var mt=i=>({"bg-gradient-warning":i});function dt(i,o){if(i&1){let e=v();r(0,"td",74)(1,"span",75),u("click",function(){_(e);let n=p().$implicit,a=p(),d=a.$implicit,C=a.ngForOf,D=p(2);return h(D.openTableDialog(d,n,C))}),m(2),f(3,"number"),l()()}if(i&2){let e=p().$implicit;c("ngClass",oe(4,mt,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(2),I(" ",x(3,2,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function _t(i,o){if(i&1&&(T(0),r(1,"span",77),m(2),f(3,"number"),l(),M()),i&2){let e=p(2).$implicit;s(2),I(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function ht(i,o){i&1&&m(0," - ")}function ut(i,o){if(i&1&&(T(0),r(1,"td",53),g(2,_t,4,3,"ng-container",51)(3,ht,1,0,"ng-template",null,76,R),l(),M()),i&2){let e=A(4),t=p().$implicit;s(2),c("ngIf",t==null||t.Channel[0]==null?null:t.Channel[0].InventoryReserved)("ngIfElse",e)}}function gt(i,o){i&1&&(T(0),m(1," - "),M())}function Ct(i,o){if(i&1&&(r(0,"span",78),f(1,"date"),m(2),f(3,"date"),l()),i&2){let e=p().$implicit;c("matTooltip",re(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),I(" ",re(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}var ft=i=>({"text-decoration-line-through":i});function xt(i,o){if(i&1){let e=v();r(0,"tr"),g(1,at,15,7,"ng-container",3),r(2,"td",43),m(3),l(),r(4,"td",44)(5,"div",45)(6,"span",46),m(7),l(),r(8,"span",47)(9,"a",48),S(10,"i",49),l()()()(),r(11,"td",50),g(12,rt,2,1,"ng-container",51)(13,st,1,1,"ng-template",null,52,R),l(),r(15,"td",53),g(16,ct,8,6,"span",3)(17,pt,3,3,"span",3),l(),g(18,dt,4,6,"td",54)(19,ut,5,2,"ng-container",3),r(20,"td",26),g(21,gt,2,0,"ng-container",51)(22,Ct,4,8,"ng-template",null,55,R),l(),r(24,"td")(25,"div",12)(26,"div",56)(27,"a",48),S(28,"i",49),l(),m(29," \xA0\xA0 "),r(30,"span",57),u("click",function(){let a=_(e).$implicit,d=p(3);return h(d.refreshInventory(a==null||a.Channel[0]==null?null:a.Channel[0].ChannelItemID,a==null||a.Channel[0]==null?null:a.Channel[0].ChannelVariationID,a==null||a.Channel[0]==null?null:a.Channel[0].ChannelID,a==null?null:a.ID))}),S(31,"i",58),l()()()()()}if(i&2){let e=o.$implicit,t=o.index,n=A(14),a=A(23),d=p(3);s(1),c("ngIf",t==0),s(2),V(e==null?null:e.Model),s(1),c("matTooltip",e.isDiscontinued?d.discontinuedVariantMsg:""),s(2),c("ngClass",oe(15,ft,e.isDiscontinued)),s(1),V(e==null?null:e.Code),s(2),c("href","https://"+d.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),N),s(3),c("ngIf",(e==null?null:e.Channel[0].TypeID)==1)("ngIfElse",n),s(4),c("ngIf",(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)),s(1),c("ngIf",(e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)),s(1),c("ngIf",e==null?null:e.Channel),s(1),c("ngIf",d.isShowReservedColumn),s(2),c("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==d.minDate)("ngIfElse",a),s(6),c("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,N)}}function St(i,o){if(i&1&&(r(0,"tbody"),g(1,xt,32,17,"tr",28),l()),i&2){let e=o.$implicit;s(1),c("ngForOf",e.Variants)}}function vt(i,o){if(i&1){let e=v();r(0,"span",79),u("click",function(){_(e);let n=p(2);return h(n.getRowCount())}),r(1,"i",80),m(2,"?"),l()()}}function yt(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=o.ngIf;s(1),V(x(2,1,e==null?null:e.Total))}}function It(i,o){if(i&1){let e=v();r(0,"a",84),u("click",function(){_(e);let n=p(3);return h(n.onNextPage())}),S(1,"i",85),m(2," Next"),l()}}function bt(i,o){if(i&1){let e=v();r(0,"a",86),u("click",function(){_(e);let n=p(3);return h(n.onLastPage())}),S(1,"i",87),m(2," Last"),l()}}function wt(i,o){if(i&1&&(r(0,"div",81),g(1,It,3,0,"a",82)(2,bt,3,0,"a",83),l()),i&2){let e=p(2);s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}function Tt(i,o){if(i&1){let e=v();r(0,"mainpanel",1),u("onSubmit",function(n){_(e);let a=p();return h(a.onSearch(n))}),r(1,"actions")(2,"div",2),g(3,qe,3,2,"div",3),f(4,"async"),l()(),r(5,"filters")(6,"div",2)(7,"div",4)(8,"div")(9,"label",5),m(10,"PageNumber"),l(),r(11,"input",6),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.PageNumber=n)}),l()(),r(12,"div")(13,"label",7),m(14,"Page Size"),l(),r(15,"input",8),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.RowCount=n)}),l()(),r(16,"div")(17,"h6"),m(18,"Quantity From - To"),l(),r(19,"input",9),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.QuantityFrom=n)}),l(),m(20," - "),r(21,"input",10),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.QuantityTo=n)}),l()()()()(),r(22,"content")(23,"div",11)(24,"div",12)(25,"div",13),g(26,We,3,0,"div",14),r(27,"table",15)(28,"thead",16)(29,"tr")(30,"th",17),m(31,"Product "),S(32,"br"),r(33,"mat-slide-toggle",18),u("toggleChange",function(){_(e);let n=p();return n.showDifferenceStock=!n.showDifferenceStock,h(n.onShowDifferenceStock())}),r(34,"small",19),m(35,"FILTER DIFFERENT INVENTORY"),l()()(),r(36,"th",20),m(37,"Variant"),l(),r(38,"th",21),m(39,"SKU"),l(),g(40,Xe,2,1,"th",3),f(41,"async"),r(42,"th",22),m(43,"POS"),l(),r(44,"th",23)(45,"div",24),u("click",function(){_(e);let n=p();return h(n.onChangeChannel())}),S(46,"img",25),m(47),l()(),g(48,et,3,0,"ng-container",3),r(49,"th",26),m(50,"Last Sync"),l(),S(51,"th",27),l()(),g(52,St,2,1,"tbody",28),f(53,"async"),l(),r(54,"div",29)(55,"div",30)(56,"div",31),m(57),f(58,"number"),f(59,"async"),g(60,vt,3,0,"span",32)(61,yt,3,3,"span",3),f(62,"async"),m(63),l()(),g(64,wt,3,2,"div",33),f(65,"async"),l()()()()()()}if(i&2){let e=p(),t,n;c("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),s(3),c("ngIf",x(4,20,e.paginationService.data$)),s(8),c("ngModel",e.searchFilter.PageNumber),s(4),c("ngModel",e.searchFilter.RowCount),s(4),c("ngModel",e.searchFilter.QuantityFrom),s(2),c("ngModel",e.searchFilter.QuantityTo),s(5),c("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),s(14),c("ngIf",x(41,22,e.paginationService.data$)),s(5),c("matTooltip","Change "+(e.selectedChannel==null?null:e.selectedChannel.Name)),s(1),c("src",e.selectedChannel.logo,N),s(1),I(" ",e.selectedChannel!=null&&e.selectedChannel.Name?e.selectedChannel==null?null:e.selectedChannel.Name:"Choose Channel ..."," "),s(1),c("ngIf",e.isShowReservedColumn),s(4),c("ngForOf",x(53,24,e.products$)),s(5),I(" Showing 1 - ",x(58,26,(t=x(59,28,e.paginationService.data$))==null?null:t.length)," of "),s(3),c("ngIf",e.paginationService.hideCount),s(1),c("ngIf",x(62,30,!e.paginationService.hideCount&&e.rowCount$)),s(2),I(" records ~ ",e.paginationService.footerPageNumber," Page "),s(1),c("ngIf",((n=x(65,32,e.paginationService.data$))==null?null:n.length)>0)}}var Ve=(()=>{let o=class o{constructor(t,n,a,d,C,D,w){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=d,this.productService=C,this.biggerPictureService=D,this.inventoryService=w,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=b.MinDate,this.isShowReservedColumn=!0,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.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]},this.hostName=C.getHostName()}ngOnInit(){this.initPageLoader(),this.products$=this.paginationService.data$.pipe(se(t=>(t=t.map(n=>(n.Variants=n.Variants.map(a=>(a.isDiscontinued=n.Discontinued=="Yes",a)),n)),t)),k(t=>{this.checkShowReservedColumn(t)}))}checkShowReservedColumn(t){let n=0,a;t.forEach(d=>{a=d.Variants.find(C=>b.IsNotEmpty(C?.Channel[0]?.InventoryReserved)),a&&(n+=1)}),this.isShowReservedColumn=n>0}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe(k(t=>{if(this.channelOptions=t.Options.Channel,this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.initSelectedChannel(),this.paginationService.reloadPagination(this.searchFilter),!t.Filter.IsMarketplaceAppActive){let n=`Automatic inventory sync disabled.
1
+ import{a as E,b as Ie,c as ne,d as ie}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-XC47PR7D.js";import{a as ye,b as Te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-3BUKJ3GE.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-5YXFGJWF.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-FRY56U37.js";import{a as be,b as we}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-JWHHOF7N.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-4CWATSUN.js";import{a as te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-UI3GOMJ2.js";import{a as X}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-TWJIQ2V4.js";import{a as ee}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-IWJP53WS.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-F6CH4W4K.js";import{c as W}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-TZXECYID.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-3HICANYR.js";import{a as xe,b as Se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-OJCFIUAX.js";import{b as z,e as Q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-OPU2YPBG.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-3IPEE6XU.js";import{a as ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-PSCYH4CH.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-WQRVB6GT.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-ZBHZ3ASR.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-DIKDR4YZ.js";import{d as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-7ECA4R7M.js";import{a as le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-VZVPXWTV.js";import{t as Z,u as Ce,v as q,w as fe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-ESASEBJL.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-EM7B4QFY.js";import{b as he,c as G,h as K,k as J,m as Y,u as ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-PX3OVSRI.js";import{c as b}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-NFCTGNSM.js";import{$a as S,B as P,Cb as f,Db as x,Eb as re,Fa as s,Ga as y,Hc as _e,Lb as R,Lc as H,Oa as c,Ua as g,X as k,Xb as pe,Za as r,Zb as me,_a as l,_b as $,aa as B,ab as T,bb as M,bc as L,cc as de,db as v,ea as F,ec as U,fa as O,fc as j,hb as u,ja as _,jb as p,ka as h,mb as ce,ob as A,pb as m,q as se,qb as V,rb as I,wb as oe,za as N}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-3TYJJ4PH.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.1/Marketplace/chunk-GLK7UGZJ.js";var Me=(()=>{let o=class o{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=F({type:o,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,a){n&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),S(3,"nav-tab",2),l()()(),S(4,"router-outlet")),n&2&&(s(3),c("Tabs",a.inventoryTabs))},dependencies:[_e,xe]});let i=o;return i})();function Le(i,o){if(i&1){let e=v();r(0,"button",22),u("click",function(){_(e);let n=p(3);return h(n.openScanDialog())}),S(1,"i",23),m(2," Scan Channel "),l()}}function Ue(i,o){if(i&1){let e=v();r(0,"button",24),u("click",function(){_(e);let n=p().ngIf,a=p(2);return h(a.onUpdateItems(n))}),S(1,"i",25),m(2," Update "),l()}}function je(i,o){if(i&1&&(r(0,"actions")(1,"div",3)(2,"div"),g(3,Le,3,0,"button",20)(4,Ue,3,0,"button",21),l()()()),i&2){let e=o.ngIf,t=p(2);s(3),c("ngIf",!t.productService.hasSelectionVariant(e)),s(1),c("ngIf",t.productService.hasSelectionVariant(e))}}function ze(i,o){if(i&1){let e=v();r(0,"app-table",26),u("onToggle",function(n){_(e);let a=p(2);return h(a.onShowDifferenceStock(n))})("onSubmit",function(n){let d=_(e).ngIf,C=p(2);return h(C.updateStockByVariant(n,d))}),l()}if(i&2){let e=o.ngIf,t=p(2);c("data",e)("channel",t.channelOptions)("showProductToggle",!0)("filter",t.searchFilter)}}function Qe(i,o){if(i&1){let e=v();r(0,"span",27),u("click",function(){_(e);let n=p(2);return h(n.getRowCount())}),r(1,"i",28),m(2,"?"),l()()}}function He(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=o.ngIf;s(1),V(x(2,1,e))}}function Ge(i,o){if(i&1){let e=v();r(0,"a",29),u("click",function(){_(e);let n=p(2);return h(n.nextPage())}),S(1,"i",30),m(2," Next"),l()}}function Ke(i,o){if(i&1){let e=v();r(0,"a",31),u("click",function(){_(e);let n=p(2);return h(n.getAllData())}),S(1,"i",32),m(2," Last"),l()}}function Je(i,o){if(i&1){let e=v();r(0,"mainpanel",1),u("onSubmit",function(n){_(e);let a=p();return h(a.onSearch(n))}),g(1,je,5,2,"actions",2),f(2,"async"),r(3,"filters")(4,"div",3)(5,"div",4)(6,"div")(7,"label",5),m(8,"PageNumber"),l(),r(9,"input",6),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.PageNumber=n)}),l()(),r(10,"div")(11,"label",7),m(12,"Page Size"),l(),r(13,"input",8),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.RowCount=n)}),l()()()()(),r(14,"content")(15,"div",9)(16,"div",10)(17,"div",11),g(18,ze,1,4,"app-table",12),f(19,"async"),T(20),r(21,"div",13)(22,"div",14)(23,"div",15),m(24),f(25,"number"),f(26,"async"),g(27,Qe,3,0,"span",16)(28,He,3,3,"span",2),f(29,"async"),m(30),l()(),r(31,"div",17),g(32,Ge,3,0,"a",18)(33,Ke,3,0,"a",19),l()(),M(),l()()()()()}if(i&2){let e=p(),t;c("pageData",e.pageData)("hideSearchBox",!1)("textButton","Search"),s(1),c("ngIf",x(2,13,e.paginationService.data$)),s(8),c("ngModel",e.searchFilter.PageNumber),s(4),c("ngModel",e.searchFilter.RowCount),s(5),c("ngIf",x(19,15,e.paginationService.data$)),s(6),I(" Showing 1 - ",x(25,17,(t=x(26,19,e.paginationService.data$))==null?null:t.length)," of "),s(3),c("ngIf",e.paginationService.hideCount),s(1),c("ngIf",x(29,21,!e.paginationService.hideCount&&e.allDataCount$)),s(2),I(" records ~ ",e.paginationService.footerPageNumber," Page "),s(2),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}var De=(()=>{let o=class o{constructor(t,n,a,d,C){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=d,this.productService=C,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{this.channelOptions=t.Options.Channel,t.Filter={PageNumber:t.Filter.PageNumber,filterModel:E.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,n){let a=this.productService.selectedVariantProduct(t);if(a.length>0){let C=a.map(w=>({ID:w.ID,Code:w.Code,Inventory:w.Inventory}));var d=n.filter(w=>w.selected).map(w=>w.ID);let D={ListChannelID:d,List:C};this.http.post("/api/Inventory/UpdateChannel",D).subscribe(w=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+D.List.length+" variants in "+D.ListChannelID.length+" channels","Success")})}}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(X,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(P(a=>b.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct),this.initPageLoader()}this.searchFilter.ChannelID=b.GuidEMpty})}updateStockByVariant(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(d=>{let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+C.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=E.DIFFERENCE:this.searchFilter.filterModel=E.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let n=this.productService.selectedVariantProduct(t);this.dialog.open(ye,{data:{selectedItems:n,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe(P(a=>b.IsNotEmpty(a))).subscribe(a=>{this.updateStock(t,a)})}getRowCount(){this.paginationService.hideCount=!1;let t={text:this.searchFilter.text};this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,t)}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(Q),y(z),y(W),y(te),y(ee))},o.\u0275cmp=F({type:o,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit"],[4,"ngIf"],[1,"d-flex"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(g(0,Je,34,23,"mainpanel",0),f(1,"async")),n&2&&c("ngIf",x(1,1,a.loader$))},dependencies:[$,G,Y,K,J,q,ne,Z,L,U],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();function Ye(i,o){if(i&1){let e=v();r(0,"button",36),u("click",function(){_(e);let n=p(2).ngIf,a=p();return h(a.openScanDialog(n))}),S(1,"i",37),m(2," Scan Channel "),l()}}function Ze(i,o){if(i&1){let e=v();r(0,"button",38),u("click",function(){_(e);let n=p().ngIf,a=p(2);return h(a.updateStock(n))}),S(1,"i",39),m(2," Update"),l()}}function qe(i,o){if(i&1&&(r(0,"div"),g(1,Ye,3,0,"button",34)(2,Ze,3,0,"button",35),l()),i&2){let e=o.ngIf,t=p(2);s(1),c("ngIf",!t.productService.hasSelectionVariant(e)),s(1),c("ngIf",t.productService.hasSelectionVariant(e))}}function We(i,o){i&1&&(r(0,"div",40)(1,"span"),m(2," showing only different stock, please press next to populate more data "),l()())}function Xe(i,o){if(i&1){let e=v();r(0,"th")(1,"input",41),u("ngModelChange",function(n){_(e);let a=p(2);return h(a.checkboxState=n)})("ngModelChange",function(){let a=_(e).ngIf,d=p(2);return h(d.onCheckboxStateChange(a))}),l()()}if(i&2){let e=p(2);s(1),c("ngModel",e.checkboxState)}}function et(i,o){i&1&&(T(0),r(1,"th",42),m(2," Reserved "),l(),M())}function tt(i,o){if(i&1){let e=v();r(0,"input",68),u("ngModelChange",function(n){_(e);let a=p(3).$implicit;return h(a.selected=n)})("ngModelChange",function(){_(e);let n=p(3).$implicit,a=p(2);return h(a.onCheckboxStateProduct(n))}),l()}if(i&2){let e=p(3).$implicit;c("ngModel",e.selected)}}function nt(i,o){if(i&1){let e=v();r(0,"img",69),u("click",function(n){_(e);let a=p(3).$implicit,d=p(2);return h(d.onZoomImage(n,a==null?null:a.ImageUrl))}),l()}if(i&2){let e=p(3).$implicit;ce("src",e==null?null:e.ThumbnailUrl,N)}}function it(i,o){i&1&&S(0,"img",70)}function at(i,o){if(i&1&&(T(0),r(1,"td",59)(2,"div",60),g(3,tt,1,1,"input",61)(4,nt,1,1,"img",62)(5,it,1,0,"ng-template",null,63,R),l()(),r(7,"td",64)(8,"span",65),m(9),l(),S(10,"br"),r(11,"div",66),S(12,"i",67),r(13,"small"),m(14),l()()(),M()),i&2){let e=A(6),t=p().$implicit,n=p().$implicit;s(1),c("rowSpan",n==null?null:n.Variants.length),s(2),c("ngIf",(t==null?null:t.Inventory)>=0||n.Variants.length>1),s(1),c("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",e),s(3),c("rowSpan",n==null?null:n.Variants.length),s(2),V(n==null?null:n.Name),s(5),I("(",n==null?null:n.Category,")")}}function ot(i,o){if(i&1){let e=v();T(0),r(1,"input",41),u("ngModelChange",function(n){_(e);let a=p(2).$implicit;return h(a.selected=n)}),l(),M()}if(i&2){let e=p(2).$implicit;s(1),c("ngModel",e.selected)}}function rt(i,o){if(i&1&&(T(0),g(1,ot,2,1,"ng-container",3),M()),i&2){let e=p().$implicit;s(1),c("ngIf",(e==null?null:e.Inventory)<=1e5)}}function lt(i,o){if(i&1){let e=v();r(0,"input",41),u("ngModelChange",function(n){_(e);let a=p(2).$implicit;return h(a.selected=n)}),l()}if(i&2){let e=p(2).$implicit;c("ngModel",e.selected)}}function st(i,o){if(i&1&&g(0,lt,1,1,"input",71),i&2){let e=p().$implicit;c("ngIf",(e==null?null:e.Inventory)>=0)}}function ct(i,o){if(i&1&&(r(0,"span")(1,"span",72),m(2),f(3,"number"),l(),m(4," => "),r(5,"span",73),m(6),f(7,"number"),l()()),i&2){let e=p().$implicit;s(2),I(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),V(x(7,4,e==null?null:e.Inventory))}}function pt(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=p().$implicit;s(1),I(" ",x(2,1,e==null?null:e.Inventory)," ")}}var mt=i=>({"bg-gradient-warning":i});function dt(i,o){if(i&1){let e=v();r(0,"td",74)(1,"span",75),u("click",function(){_(e);let n=p().$implicit,a=p(),d=a.$implicit,C=a.ngForOf,D=p(2);return h(D.openTableDialog(d,n,C))}),m(2),f(3,"number"),l()()}if(i&2){let e=p().$implicit;c("ngClass",oe(4,mt,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(2),I(" ",x(3,2,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function _t(i,o){if(i&1&&(T(0),r(1,"span",77),m(2),f(3,"number"),l(),M()),i&2){let e=p(2).$implicit;s(2),I(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function ht(i,o){i&1&&m(0," - ")}function ut(i,o){if(i&1&&(T(0),r(1,"td",53),g(2,_t,4,3,"ng-container",51)(3,ht,1,0,"ng-template",null,76,R),l(),M()),i&2){let e=A(4),t=p().$implicit;s(2),c("ngIf",t==null||t.Channel[0]==null?null:t.Channel[0].InventoryReserved)("ngIfElse",e)}}function gt(i,o){i&1&&(T(0),m(1," - "),M())}function Ct(i,o){if(i&1&&(r(0,"span",78),f(1,"date"),m(2),f(3,"date"),l()),i&2){let e=p().$implicit;c("matTooltip",re(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),I(" ",re(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}var ft=i=>({"text-decoration-line-through":i});function xt(i,o){if(i&1){let e=v();r(0,"tr"),g(1,at,15,7,"ng-container",3),r(2,"td",43),m(3),l(),r(4,"td",44)(5,"div",45)(6,"span",46),m(7),l(),r(8,"span",47)(9,"a",48),S(10,"i",49),l()()()(),r(11,"td",50),g(12,rt,2,1,"ng-container",51)(13,st,1,1,"ng-template",null,52,R),l(),r(15,"td",53),g(16,ct,8,6,"span",3)(17,pt,3,3,"span",3),l(),g(18,dt,4,6,"td",54)(19,ut,5,2,"ng-container",3),r(20,"td",26),g(21,gt,2,0,"ng-container",51)(22,Ct,4,8,"ng-template",null,55,R),l(),r(24,"td")(25,"div",12)(26,"div",56)(27,"a",48),S(28,"i",49),l(),m(29," \xA0\xA0 "),r(30,"span",57),u("click",function(){let a=_(e).$implicit,d=p(3);return h(d.refreshInventory(a==null||a.Channel[0]==null?null:a.Channel[0].ChannelItemID,a==null||a.Channel[0]==null?null:a.Channel[0].ChannelVariationID,a==null||a.Channel[0]==null?null:a.Channel[0].ChannelID,a==null?null:a.ID))}),S(31,"i",58),l()()()()()}if(i&2){let e=o.$implicit,t=o.index,n=A(14),a=A(23),d=p(3);s(1),c("ngIf",t==0),s(2),V(e==null?null:e.Model),s(1),c("matTooltip",e.isDiscontinued?d.discontinuedVariantMsg:""),s(2),c("ngClass",oe(15,ft,e.isDiscontinued)),s(1),V(e==null?null:e.Code),s(2),c("href","https://"+d.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),N),s(3),c("ngIf",(e==null?null:e.Channel[0].TypeID)==1)("ngIfElse",n),s(4),c("ngIf",(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)),s(1),c("ngIf",(e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)),s(1),c("ngIf",e==null?null:e.Channel),s(1),c("ngIf",d.isShowReservedColumn),s(2),c("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==d.minDate)("ngIfElse",a),s(6),c("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,N)}}function St(i,o){if(i&1&&(r(0,"tbody"),g(1,xt,32,17,"tr",28),l()),i&2){let e=o.$implicit;s(1),c("ngForOf",e.Variants)}}function vt(i,o){if(i&1){let e=v();r(0,"span",79),u("click",function(){_(e);let n=p(2);return h(n.getRowCount())}),r(1,"i",80),m(2,"?"),l()()}}function yt(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=o.ngIf;s(1),V(x(2,1,e==null?null:e.Total))}}function It(i,o){if(i&1){let e=v();r(0,"a",84),u("click",function(){_(e);let n=p(3);return h(n.onNextPage())}),S(1,"i",85),m(2," Next"),l()}}function bt(i,o){if(i&1){let e=v();r(0,"a",86),u("click",function(){_(e);let n=p(3);return h(n.onLastPage())}),S(1,"i",87),m(2," Last"),l()}}function wt(i,o){if(i&1&&(r(0,"div",81),g(1,It,3,0,"a",82)(2,bt,3,0,"a",83),l()),i&2){let e=p(2);s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}function Tt(i,o){if(i&1){let e=v();r(0,"mainpanel",1),u("onSubmit",function(n){_(e);let a=p();return h(a.onSearch(n))}),r(1,"actions")(2,"div",2),g(3,qe,3,2,"div",3),f(4,"async"),l()(),r(5,"filters")(6,"div",2)(7,"div",4)(8,"div")(9,"label",5),m(10,"PageNumber"),l(),r(11,"input",6),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.PageNumber=n)}),l()(),r(12,"div")(13,"label",7),m(14,"Page Size"),l(),r(15,"input",8),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.RowCount=n)}),l()(),r(16,"div")(17,"h6"),m(18,"Quantity From - To"),l(),r(19,"input",9),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.QuantityFrom=n)}),l(),m(20," - "),r(21,"input",10),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.QuantityTo=n)}),l()()()()(),r(22,"content")(23,"div",11)(24,"div",12)(25,"div",13),g(26,We,3,0,"div",14),r(27,"table",15)(28,"thead",16)(29,"tr")(30,"th",17),m(31,"Product "),S(32,"br"),r(33,"mat-slide-toggle",18),u("toggleChange",function(){_(e);let n=p();return n.showDifferenceStock=!n.showDifferenceStock,h(n.onShowDifferenceStock())}),r(34,"small",19),m(35,"FILTER DIFFERENT INVENTORY"),l()()(),r(36,"th",20),m(37,"Variant"),l(),r(38,"th",21),m(39,"SKU"),l(),g(40,Xe,2,1,"th",3),f(41,"async"),r(42,"th",22),m(43,"POS"),l(),r(44,"th",23)(45,"div",24),u("click",function(){_(e);let n=p();return h(n.onChangeChannel())}),S(46,"img",25),m(47),l()(),g(48,et,3,0,"ng-container",3),r(49,"th",26),m(50,"Last Sync"),l(),S(51,"th",27),l()(),g(52,St,2,1,"tbody",28),f(53,"async"),l(),r(54,"div",29)(55,"div",30)(56,"div",31),m(57),f(58,"number"),f(59,"async"),g(60,vt,3,0,"span",32)(61,yt,3,3,"span",3),f(62,"async"),m(63),l()(),g(64,wt,3,2,"div",33),f(65,"async"),l()()()()()()}if(i&2){let e=p(),t,n;c("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),s(3),c("ngIf",x(4,20,e.paginationService.data$)),s(8),c("ngModel",e.searchFilter.PageNumber),s(4),c("ngModel",e.searchFilter.RowCount),s(4),c("ngModel",e.searchFilter.QuantityFrom),s(2),c("ngModel",e.searchFilter.QuantityTo),s(5),c("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),s(14),c("ngIf",x(41,22,e.paginationService.data$)),s(5),c("matTooltip","Change "+(e.selectedChannel==null?null:e.selectedChannel.Name)),s(1),c("src",e.selectedChannel.logo,N),s(1),I(" ",e.selectedChannel!=null&&e.selectedChannel.Name?e.selectedChannel==null?null:e.selectedChannel.Name:"Choose Channel ..."," "),s(1),c("ngIf",e.isShowReservedColumn),s(4),c("ngForOf",x(53,24,e.products$)),s(5),I(" Showing 1 - ",x(58,26,(t=x(59,28,e.paginationService.data$))==null?null:t.length)," of "),s(3),c("ngIf",e.paginationService.hideCount),s(1),c("ngIf",x(62,30,!e.paginationService.hideCount&&e.rowCount$)),s(2),I(" records ~ ",e.paginationService.footerPageNumber," Page "),s(1),c("ngIf",((n=x(65,32,e.paginationService.data$))==null?null:n.length)>0)}}var Ve=(()=>{let o=class o{constructor(t,n,a,d,C,D,w){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=d,this.productService=C,this.biggerPictureService=D,this.inventoryService=w,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=b.MinDate,this.isShowReservedColumn=!0,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.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]},this.hostName=C.getHostName()}ngOnInit(){this.initPageLoader(),this.products$=this.paginationService.data$.pipe(se(t=>(t=t.map(n=>(n.Variants=n.Variants.map(a=>(a.isDiscontinued=n.Discontinued=="Yes",a)),n)),t)),k(t=>{this.checkShowReservedColumn(t)}))}checkShowReservedColumn(t){let n=0,a;t.forEach(d=>{a=d.Variants.find(C=>b.IsNotEmpty(C?.Channel[0]?.InventoryReserved)),a&&(n+=1)}),this.isShowReservedColumn=n>0}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe(k(t=>{if(this.channelOptions=t.Options.Channel,this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.initSelectedChannel(),this.paginationService.reloadPagination(this.searchFilter),!t.Filter.IsMarketplaceAppActive){let n=`Automatic inventory sync disabled.
2
2
  Please enable Dealpos X Marketplace Apps integration in POS Configuration`;this.toastr.warning(n,"Warning")}}))}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(t=>t.ID==this.searchFilter.ChannelID),this.selectedChannel&&(this.selectedChannel.logo=b.getChannelLogoByTypeId(this.selectedChannel.TypeID))}onChangeChannel(){this.dialog.open(Te,{data:{channelOptions:this.channelOptions,selectedChannel:this.selectedChannel}}).afterClosed().pipe(P(t=>b.IsNotEmpty(t))).subscribe(t=>{this.selectedChannel=t,this.onFilterChannel(t.ID)})}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}onFilterChannel(t){this.searchFilter.ChannelID=t,this.searchFilter.PageNumber=1,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t){let n=this.productService.selectedVariantProduct(t);if(n.length>0){let a=n.map(C=>({ID:C.ID,Code:C.Code,Inventory:C.Inventory})),d={ListChannelID:[this.searchFilter.ChannelID],List:a};this.http.post("/api/Inventory/UpdateChannel",d).subscribe(C=>{this.searchFilter.PageNumber=1,this.paginationService.reloadPagination(this.searchFilter),this.checkboxState=!1,this.handlingUpdateStock(C)})}}handlingUpdateStock(t){if(t[0]?.StatusProduct){let n=t[0].StatusProduct.Fail_list,a=t[0].StatusProduct.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",a,n)}else this.toastr.error(t[0]?.Exception,"Error")}openScanDialog(t){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=b.GuidEMpty,this.dialog.open(X,{data:{filter:n,channelOptions:t.Options.Channel},width:"600px"}).afterClosed().pipe(P(d=>b.IsNotEmpty(d))).subscribe(d=>{this.searchFilter.ChannelID=d.ChannelID,this.searchFilter.ScanFull=d.ScanFull,this.searchFilter.UpdatedProduct=d.UpdatedProduct,this.searchFilter.Async=d.Async,this.scannALl(t)})}scannALl(t){let n=this.productService.findChannelById(this.searchFilter.ChannelID,t.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(a=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.searchFilter.ScanFull=!1,this.initPageLoader(),this.toastr.success("Successfully scanned from "+n?.Name,"Success"))})}refreshInventory(t,n,a,d){let C={ChannelItemID:t,ChannelVariationID:n,ChannelID:a,VariantID:d};this.http.post("/api/Inventory/RefreshInventoryChannel",C).subscribe(D=>{this.toastr.success("Successfully updated","Success"),this.paginationService.reloadPagination(this.searchFilter)})}onCheckboxStateProduct(t){t.Variants=t.Variants.map(n=>(n.Inventory>=0&&(n.selected=t.selected),n))}onCheckboxStateChange(t){t=t.map(n=>(n.Variants=n.Variants.map(a=>(a.selected=this.checkboxState,a)),n))}openTableDialog(t,n,a){this.dialog.open(Ie,{data:{Name:t.Name,Variant:n,ChannelID:n?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:t.ChannelItemID}}).afterClosed().pipe(P(C=>b.IsNotEmpty(C))).subscribe(C=>{this.updateItemAfterDialog(C,a)})}updateItemAfterDialog(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku},d=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(C=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+d?.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=E.DIFFERENCE:this.searchFilter.filterModel=E.ALL,this.paginationService.reloadPagination(this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,PageNumber:1,text:this.searchFilter.text};this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`${this.rowCountApi}`,t)}onLastPage(){let t={ChannelID:this.searchFilter.ChannelID,PageNumber:1};this.http.post(`${this.rowCountApi}`,t).subscribe({next:n=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,n.Total)}})}onZoomImage(t,n){this.biggerPictureService.openBiggerPicture(t,n)}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(Q),y(z),y(W),y(te),y(ee),y(ve),y(ie))},o.\u0275cmp=F({type:o,selectors:[["app-single-channel-comparison"]],decls:2,vars:3,consts:[["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],["type","number","name","QuantityFrom",1,"w-25","me-2",3,"ngModel","ngModelChange"],["type","number","name","QuantityTo",1,"w-25","ms-2",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],[1,"fw-bold"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","100px"],["matTooltipPosition","above",1,"d-inline-block","text-truncate","mt-3","cursor-pointer",2,"max-width","114px",3,"matTooltip","click"],[2,"width","16px",3,"src"],[1,"text-center"],[2,"width","4%"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModel","ngModelChange"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-start"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"align-middle"],[4,"ngIf","ngIfElse"],["OTHER_CHANNEL",""],[1,"text-end"],["class","text-end",3,"ngClass",4,"ngIf"],["SYNCDATE",""],[1,"col-12","ps-0","d-flex","justify-content-between"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["title","Allocated"],["title","Inventory below minimum inventory"],[1,"text-end",3,"ngClass"],[1,"cursor",3,"click"],["EMPTY_RESERVED",""],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(g(0,Tt,66,34,"mainpanel",0),f(1,"async")),n&2&&c("ngIf",x(1,1,a.loader$))},dependencies:[pe,me,$,G,Y,he,K,J,be,q,Z,L,U,de],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});let i=o;return i})();var Mt=[{path:"",component:Me,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:De,canActivate:[le],data:{title:"Inventory Comparison"}},{path:"bychannel",component:Ve,canActivate:[le],data:{title:"Inventory Comparison"}}]}],Pe=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=O({type:o}),o.\u0275inj=B({imports:[j,H.forChild(Mt)]});let i=o;return i})();var xn=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=O({type:o}),o.\u0275inj=B({providers:[ie],imports:[j,Pe,H,Se,ue,ge,we,fe,ne,Ce]});let i=o;return i})();export{xn as InventoryModule};