dealpos 12.4.1 → 12.4.2

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.
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[3962],{27874:(A,C,c)=>{c.d(C,{O:()=>G});var o=c(81180),P=c(65592),u=c(22096),S=c(2459),p=c(69862),E=c(16321),t=c(70093),e=c(79360),r=c(54829),a=c(82306),_=c(8251),T=c(27103);const x=(0,a.d)(D=>function(s=null){D(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=s});function I(D,L){const{first:s,each:l,with:d=M,scheduler:i=L??E.z,meta:m=null}=(0,t.q)(D)?{first:D}:"number"==typeof D?{each:D}:D;if(null==s&&null==l)throw new TypeError("No timeout provided.");return(0,e.e)((h,y)=>{let n,g,f=null,R=0;const w=O=>{g=(0,T.f)(y,i,()=>{try{n.unsubscribe(),(0,r.Xf)(d({meta:m,lastValue:f,seen:R})).subscribe(y)}catch(Z){y.error(Z)}},O)};n=h.subscribe((0,_.x)(y,O=>{g?.unsubscribe(),R++,y.next(f=O),l>0&&w(l)},void 0,void 0,()=>{g?.closed||g?.unsubscribe(),f=null})),!R&&w(null!=s?"number"==typeof s?s:+s-i.now():l)})}function M(D){throw new x(D)}var b=c(26306),k=c(70108),v=c(65879),B=c(58763),K=c(64190);let G=(()=>{class D{constructor(s,l,d){(0,o.Z)(this,"http",void 0),(0,o.Z)(this,"toastr",void 0),(0,o.Z)(this,"router",void 0),(0,o.Z)(this,"hostURL",i=>k.N.production?i:`https://localhost:44364${i}`),this.http=s,this.toastr=l,this.router=d}PostToUrlEncode(s,l,d=1e5){let i=new p.WM;return i=i.set("Content-Type","application/x-www-form-urlencoded"),new P.y(m=>{this.http.post(this.hostURL(s),l,{headers:i}).pipe(I(d)).subscribe(h=>{m.next(h),m.complete()})})}GetText(s=1e5){let l=localStorage.getItem("Token");const i={responseType:"text",headers:new p.WM({Authorization:"Bearer "+l})};return new P.y(m=>{this.http.get(this.hostURL("/API/Token/GetZendeskJWT"),i).pipe(I(s)).subscribe(h=>{m.next(h),m.complete()})})}POSText(s,l,d=1e5){let i=localStorage.getItem("Token");const h={responseType:"text",headers:new p.WM({"Content-Type":"application/json","Cache-Control":"no-cache",Authorization:"Bearer "+i})};return new P.y(y=>{this.http.post(this.hostURL(s),l,h).pipe(I(d)).subscribe(n=>{y.next(n),y.complete()})})}get(s){let l=localStorage.getItem("Token"),d=new p.WM({"Content-Type":"application/json","Cache-Control":"no-cache"});l&&(d=d.append("Authorization","Bearer "+l));let i={headers:d};return this.http.get(this.hostURL(s),i).pipe((0,b.K)(m=>{let h=this.errorMessageHandling(m);this.toastr.error(""!=h.Message?h.Message:"An unknown error has occured!",h.header);let y=(0,u.of)("error",m);return 402==m.status&&(y=(0,S.D)(this.router.navigate(["/menu/Profile/Main/My_Subscription"]))),y}))}post(s,l,d=1e5){return new P.y(i=>{let m=localStorage.getItem("Token"),h=new p.WM({"Content-Type":"application/json","Cache-Control":"no-cache"});m&&(h=h.append("Authorization","Bearer "+m));let y={headers:h};this.http.post(this.hostURL(s),l,y).pipe(I(d)).subscribe({next:n=>{i.next(n),i.complete()},error:n=>{if(200==n.status)i.next(n.error.text),i.complete();else{if(!this.unauthorizedErrorHandling(n)){let f=this.errorMessageHandling(n);this.toastr.error(""!=f.Message?f.Message:"An unknown error has occured!",f.header,{enableHtml:!0})}i.error(n)}}})})}postFile(s,l,d=1e5){return new P.y(i=>{let m=localStorage.getItem("Token"),h=new p.WM({"Content-Type":"application/json","Cache-Control":"no-cache"});m&&(h=h.append("Authorization","Bearer "+m)),this.http.post(this.hostURL(s),l,{headers:h,observe:"response",responseType:"blob"}).pipe(I(d)).subscribe({next:y=>{i.next({title:y.headers.get("Content-Disposition"),file:y.body}),i.complete()},error:y=>{if(200==y.status)i.next(y.error.text),i.complete();else{if(!this.unauthorizedErrorHandling(y)){let g=this.errorMessageHandling(y);this.toastr.error(""!=g.Message?g.Message:"An unknown error has occured!",g.header,{enableHtml:!0})}i.error(y)}}})})}put(s,l,d=1e5){return new P.y(i=>{let m=localStorage.getItem("Token"),h=new p.WM({"Content-Type":"application/json","Cache-Control":"no-cache"});m&&(h=h.append("Authorization","Bearer "+m));let y={headers:h};this.http.put(this.hostURL(s),l,y).pipe(I(d)).subscribe({next:n=>{i.next(n),i.complete()},error:n=>{if(200==n.status)i.next(n.error.text),i.complete();else{if(!this.unauthorizedErrorHandling(n)){let f=this.errorMessageHandling(n);this.toastr.error(""!=f.Message?f.Message:"An unknown error has occured!",f.header)}i.error(n)}}})})}delete(s,l,d=1e5){return new P.y(i=>{let m=localStorage.getItem("Token"),h=new p.WM({"Content-Type":"application/json","Cache-Control":"no-cache"});m&&(h=h.append("Authorization","Bearer "+m));let y={headers:h,body:l};this.http.delete(this.hostURL(s),y).pipe(I(d)).subscribe({next:n=>{i.next(n),i.complete()},error:n=>{if(200==n.status)i.next(n.error.text),i.complete();else{if(!this.unauthorizedErrorHandling(n)){let f=this.errorMessageHandling(n);this.toastr.error(""!=f.Message?f.Message:"An unknown error has occured!",f.header)}i.error(n)}}})})}unauthorizedErrorHandling(s){let l=!1;return(401==s.status||403==s.status)&&(localStorage.getItem("Token")?this.router.navigate(["/menu/Unauthorized/Main/Unauthorized"]):window.location.href="/",l=!0),l}errorMessageHandling(s){let l="API Error",d="Exception Message";return s.error?(l="API Error - "+s.status,451==s.status&&(l="Error"),s.error&&(d=s.error.Message)):s.Message&&(l="API Error - "+s.name,d=s.Message),{header:l,Message:d}}postFormDataWithoutBearer(s,l){return new P.y(d=>{this.http.post(this.hostURL(s),l).pipe(I(1e5)).subscribe({next:i=>{d.next(i),d.complete()},error:i=>{200==i.status&&(d.next(i.error.text),d.complete()),d.error(i)}})})}postFormData(s,l,d=!0){return new P.y(i=>{let m=localStorage.getItem("Token"),y={headers:new p.WM({Authorization:"Bearer "+m})};this.http.post(this.hostURL(s),l,y).pipe(I(1e5)).subscribe({next:n=>{i.next(n),i.complete()},error:n=>{if(200==n.status)i.next(n.error.text),i.complete();else{if(!this.unauthorizedErrorHandling(n)&&d){let f=this.errorMessageHandling(n);this.toastr.error(""!=f.Message?f.Message:"An unknown error has occured!",f.header)}i.error(n)}}})})}}return(0,o.Z)(D,"\u0275fac",function(s){return new(s||D)(v.LFG(p.eN),v.LFG(B._W),v.LFG(K.F0))}),(0,o.Z)(D,"\u0275prov",v.Yz7({token:D,factory:D.\u0275fac,providedIn:"root"})),D})()},82430:(A,C,c)=>{c.d(C,{N:()=>p});var o=c(81180),P=c(96354),u=c(86864),S=c(65879);let p=(()=>{class E{constructor(){(0,o.Z)(this,"_roles",void 0),(0,o.Z)(this,"_product",void 0),(0,o.Z)(this,"_contact",void 0),(0,o.Z)(this,"_promotion",void 0),(0,o.Z)(this,"_accounting",void 0),(0,o.Z)(this,"_users",void 0),(0,o.Z)(this,"_outlets",void 0),(0,o.Z)(this,"_setup",void 0),(0,o.Z)(this,"_service",void 0),(0,o.Z)(this,"_profile",void 0),(0,o.Z)(this,"_customerDisplay",void 0),(0,o.Z)(this,"_orderDisplay",void 0),(0,o.Z)(this,"_global",void 0),(0,o.Z)(this,"_apps",void 0),(0,o.Z)(this,"_fulfillment",void 0),(0,o.Z)(this,"_manufacture",void 0),(0,o.Z)(this,"_inventory",void 0),(0,o.Z)(this,"_sell",void 0),(0,o.Z)(this,"_report",void 0),(0,o.Z)(this,"_buy",void 0),(0,o.Z)(this,"_adjustment",void 0),(0,o.Z)(this,"_debt",void 0),(0,o.Z)(this,"_payment",void 0),(0,o.Z)(this,"_prepaidPackage",void 0),(0,o.Z)(this,"_order",void 0),(0,o.Z)(this,"_logistic",void 0),(0,o.Z)(this,"_estimate",void 0),(0,o.Z)(this,"_shift",void 0),this.parseJWTRoles()}parseJWTRoles(){const e=localStorage.getItem("Token");if(u.gT.IsNotEmpty(e)){var r=u.gT.parseJwt(e);this._roles=r["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]}}isInRole(e,r){const a={};return r.forEach((_,T)=>a[e[T]]="string"==typeof _?this._roles.includes(_):_(this._roles)),a}isUserHasRole(e){return this._roles.includes(e)}get product(){return u.gT.IsEmpty(this._product)&&(this._product=this.setBulkRole("product")),this._product}get contact(){return u.gT.IsEmpty(this._contact)&&(this._contact=this.setBulkRole("contact")),this._contact}get promotion(){return u.gT.IsEmpty(this._promotion)&&(this._promotion=this.setBulkRole("promotion")),this._promotion}get accounting(){return u.gT.IsEmpty(this._accounting)&&(this._accounting=this.setBulkRole("accounting")),this._accounting}get users(){return u.gT.IsEmpty(this._users)&&(this._users=this.setBulkRole("users")),this._users}get outlets(){return u.gT.IsEmpty(this._outlets)&&(this._outlets=this.setBulkRole("outlets")),this._outlets}get setup(){return u.gT.IsEmpty(this._setup)&&(this._setup=this.setBulkRole("setup")),this._setup}get service(){return u.gT.IsEmpty(this._service)&&(this._service=this.setBulkRole("service")),this._service}get profile(){return u.gT.IsEmpty(this._profile)&&(this._profile=this.setBulkRole("myProfile")),this._profile}get customerDisplay(){return u.gT.IsEmpty(this._customerDisplay)&&(this._customerDisplay=this.setBulkRole("customerDisplay")),this._customerDisplay}get orderDisplay(){return u.gT.IsEmpty(this._orderDisplay)&&(this._orderDisplay=this.setBulkRole("orderDisplay")),this._orderDisplay}get global(){return u.gT.IsEmpty(this._global)&&(this._global=this.setBulkRole("global")),this._global}get apps(){return u.gT.IsEmpty(this._apps)&&(this._apps=this.setBulkRole("apps")),this._apps}get fulfillment(){return u.gT.IsEmpty(this._fulfillment)&&(this._fulfillment=this.setBulkRole("fulfillment")),this._fulfillment}get manufacture(){return u.gT.IsEmpty(this._manufacture)&&(this._manufacture=this.setBulkRole("manufacture")),this._manufacture}get inventory(){return u.gT.IsEmpty(this._inventory)&&(this._inventory=this.setBulkRole("inventory")),this._inventory}get sell(){return u.gT.IsEmpty(this._sell)&&(this._sell=this.setBulkRole("sell")),this._sell}get report(){return u.gT.IsEmpty(this._report)&&(this._report=this.setBulkRole("report")),this._report}get buy(){return u.gT.IsEmpty(this._buy)&&(this._buy=this.setBulkRole("buy")),this._buy}get adjustment(){return u.gT.IsEmpty(this._adjustment)&&(this._adjustment=this.setBulkRole("adjustment")),this._adjustment}get debt(){return u.gT.IsEmpty(this._debt)&&(this._debt=this.setBulkRole("debt")),this._debt}get payment(){return u.gT.IsEmpty(this._payment)&&(this._payment=this.setBulkRole("payment")),this._payment}get prepaidPackage(){return u.gT.IsEmpty(this._prepaidPackage)&&(this._prepaidPackage=this.setBulkRole("prepaidPackage")),this._prepaidPackage}get order(){return u.gT.IsEmpty(this._order)&&(this._order=this.setBulkRole("orders")),this._order}get logistic(){return u.gT.IsEmpty(this._logistic)&&(this._logistic=this.setBulkRole("logistics")),this._logistic}get estimate(){return u.gT.IsEmpty(this._estimate)&&(this._estimate=this.setBulkRole("estimate")),this._estimate}get shift(){return u.gT.IsEmpty(this._shift)&&(this._shift=this.setBulkRole("shift")),this._shift}setBulkRole(e){const r={};for(const a in P.G[e])r[a]=this.isUserHasRole(P.G[e][a]);return r}get isSystemUser(){const e=localStorage.getItem("Token");return"System"==u.gT.parseJwt(e).Type}resetRoles(){this._roles=[],this._accounting=null,this._adjustment=null,this._apps=null,this._buy=null,this._contact=null,this._customerDisplay=null,this._debt=null,this._fulfillment=null,this._estimate=null,this._global=null,this._inventory=null,this._logistic=null,this._manufacture=null,this._order=null,this._orderDisplay=null,this._outlets=null,this._payment=null,this._product=null,this._prepaidPackage=null,this._profile=null,this._promotion=null,this._report=null,this._sell=null,this._service=null,this._setup=null,this._shift=null,this._users=null}}return(0,o.Z)(E,"\u0275fac",function(e){return new(e||E)}),(0,o.Z)(E,"\u0275prov",S.Yz7({token:E,factory:E.\u0275fac,providedIn:"root"})),E})()},86864:(A,C,c)=>{c.d(C,{FI:()=>u,gT:()=>P});var o=c(81180);let P=(()=>{class p{static StringFormat(t,...e){for(let r=0;r<e.length;r++)t=t.replace(`{${r}}`,e[r]);return t}static IsNotEmpty(t){return""!=t&&!p.containsOnlySpaces(t)&&t!=p.GuidEmpty&&null!=t&&null!=t}static IsEmpty(t){return!(""!=t&&!p.containsOnlySpaces(t)&&null!=t&&null!=t&&t!=p.GuidEmpty)}static containsOnlySpaces(t){return/^\s*$/.test(t)}static FilterByID(t,e){try{const r=t.filter(a=>a.ID==e);if(r.length>0)return r[0]}catch{}return null}static GenerateYears(t,e,r){let a=-1;(null==e||null==e)&&(e=11),(null==r||null==r||!r)&&(a=1);const _=[];for(let T=0;T<e;T++)_.push(t+T*a);return _}static DateOnly(t){return t?new Date(new Date(t).toDateString()):new Date((new Date).toDateString())}static differentInDays(t,e){let r=e.getTime()-t.getTime();return Math.floor(r/864e5)}static minutesDiff(t,e){let r=(e.getTime()-t.getTime())/6e4;return Math.ceil(r)}static hoursDiff(t,e){let a=(e.getTime()-t.getTime())/36e5;return parseFloat(a.toFixed(1))}static Guid_NewGuid(){let t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var a=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==r?a:3&a|8).toString(16)})}static parseJwt(t){var r=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(r).split("").map(function(_){return"%"+("00"+_.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}static numberOnly(t){const e=t.which?t.which:t.keyCode;return!(e>31&&(e<48||e>57))}static formatNumber(t){let e,r="",a=Math.abs(t);return a>999&&a<1e6?(r="K",e=(a/1e3).toFixed(0)):a>=1e6?(r="M",e=(a/1e6).toFixed(0)):a<900&&(e=a.toString()),t<0&&(e="-"+e),e.replace(/\B(?=(\d{3})+(?!\d))/g,",")+r}static isToDay(t){if(t){const e=new Date;return e.setHours(0,0,0,0),e.getTime()==t.getTime()}}static compare(t,e,r){return(t<e?-1:1)*(r?1:-1)}static generateSerialasNote(t=[]){let e;return t&&t.length>0&&(e=`[${t.map((a,_)=>`${_>0?" ":""}${a.Number}${a.Quantity>1||a.Quantity<0?"*"+a.Quantity:""}`)}]`),e}static getDatesInRange(t,e){const r=new Date(t.getTime()),a=[];for(;r<=e;)a.push(new Date(r)),r.setDate(r.getDate()+1);return a}static getDaysBefore(t,e){return new Date(t.setDate((new Date).getDate()-e))}static getRangeDate(t,e){const r=new Date;return r.setMonth(t),r.setFullYear(e),{firstDay:new Date(r.getFullYear(),r.getMonth()-1,1),lastDay:new Date(r.getFullYear(),r.getMonth(),0)}}static setDateTime(t,e){let r=new Date;e&&(r=new Date(e));let a=t.split(":");return r.setHours(parseInt(a[0])),r.setMinutes(parseInt(a[1])),r}static checkJSApiSupported(t){let e;return e=t in window,e}static cloneObject(t){let e;return e=this.checkJSApiSupported("structuredClone")?structuredClone(t):JSON.parse(JSON.stringify(t)),e}}return(0,o.Z)(p,"GuidEmpty","00000000-0000-0000-0000-000000000000"),(0,o.Z)(p,"DecimalMinValue","-7.922816251426434e+28"),(0,o.Z)(p,"InputLockTimeSpan",500),(0,o.Z)(p,"MinDate","0001-01-01T00:00:00"),(0,o.Z)(p,"MinTime","00:00:00"),(0,o.Z)(p,"tinyMceApiKey","zc58cdrrftek5r5igtmjiar7ed4n3wr00hzd4w4mvtx8mpxa"),(0,o.Z)(p,"Months",[{ID:1,Label:"January"},{ID:2,Label:"February"},{ID:3,Label:"March"},{ID:4,Label:"April"},{ID:5,Label:"May"},{ID:6,Label:"June"},{ID:7,Label:"July"},{ID:8,Label:"August"},{ID:9,Label:"September"},{ID:10,Label:"October"},{ID:11,Label:"November"},{ID:12,Label:"December"}]),p})();function u(p){return new Promise((E,t)=>{let e=new Image;e.src=p,e.decode().then(()=>{E({img:p,height:e.height,width:e.width})}).catch(()=>{t(new Error(`Image load error for ${p}`))})})}},96354:(A,C,c)=>{c.d(C,{G:()=>o});const o={dashboard:{WeeklySales:"Chart"},estimate:{Create:"EstC",Edit:"EstE",Delete:"EstD"},report:{View:"Rep",Advanced:"RepA",Profit:"RepF"},shift:{View:"Shift",Create:"ShiftC",Edit:"ShiftE",Delete:"ShiftD"},contact:{View:"Con",Create:"ConC",Edit:"ConE",Delete:"ConD",LoyaltyPointEditor:"LoyPE",ContactDetail:"ContD",ContactImageEditor:"ContE"},sell:{Create:"Sell",PricebookSelector:"PricebS",Edit:"SellE",Delete:"SellD",Date:"DateE",Number:"NumE",SalesPerson:"SalesmanE",Return:"Return",Discount:"Disc",UnitPriceEditor:"UnitPE",Commission:"Comms",Tax:"Tax",CustomerInputLock:"CustL",Payment:"PayR",PriceVisible:"PriceV",PriceMinimum:"PriceM",Email:"Email",DeleteItem:"DelItm",Shipping:"Ship",PaymentCodeLock:"PayCL",EraseVoidOrd:"EraseVO",RestoreVoidOrd:"RestVO",RetrieveR:"RetrieveR",BundlingPrice:"BundlP",ClearCartRestriction:"ClearCartRestriction",CreditSalesLock:"CredSL",CouponInputLock:"CouponInputLock"},orders:{View:"Ord",SupplierBill:"OrdB",VoidInvoice:"OrdVo",Reprint:"OrdRpr",NoteEditor:"OrdNe",Invoice:"Ordlr"},product:{View:"Prod",Delete:"ProdD",ImageEditor:"ImgE",Create:"ProdC",Edit:"ProdE",Cost:"Cost",BarcodePrinting:"BarP",DeleteAllOutletPrice:"DeleteAllOutletPrice",Expense:"Expense",CommissionView:"CommV"},payment:{View:"Pay",Delete:"PayD",Create:"PayC",Edit:"PayE",PaymentDate:"PayDE"},adjustment:{View:"Adj",Delete:"AdjD",Create:"AdjC",Edit:"AdjE",Approval:"AdjApp",InventoryProductCount:"InvPC"},buy:{Delete:"BuyD",Create:"Buy",Edit:"BuyE",DateEditor:"BuyDE",ShippingRestriction:"BuySh",Approval:"PurA"},logistics:{View:"Del",Create:"DelC",Edit:"DelE",Delete:"DelD",TransferOrderEditor:"DelRE",Outbound:"FulF",TransferOrderApproval:"DelA",TransferDateEditor:"DelDE",TransferOrderReceiver:"DelR"},debt:{View:"Debt",Delete:"DebtD",Create:"DebtC",Edit:"DebtE"},prepaidPackage:{View:"Tre",Create:"TreC",Edit:"TreE",Delete:"TreD",TreatmentIncentive:"TreI",SharePackageEditor:"SharPacE",TreatmentNote:"TreN",Doctor:"Doct"},inventory:{View:"Inv",Edit:"InvE"},promotion:{View:"Prom",Create:"PromC",Edit:"PromE",Delete:"PromD",Coupon:"Cou",Pricebook:"Pri"},accounting:{View:"Act",Create:"ActC",Edit:"ActE",Delete:"ActD",Report:"ActRep",Ledger:"ActL",EmptyOutlet:"ActEO",ClosingEditor:"ActCE",Advanced:"ActRA",Recurring:"ActRec"},users:{View:"Use",Create:"UseC",Edit:"UseE",Delete:"UseD",Groups:"Gro",LoginTimeRestriction:"LogTR",UserIPRestriction:"UseIR",GroupsRestriction:"UseG",LogRestriction:"LogResct"},outlets:{View:"Out",Create:"OutC",Edit:"OutE",Delete:"OutD"},setup:{View:"Stp",Create:"StpC",Edit:"StpE",Delete:"StpD",Webhook:"StpWh",Developer:"StpDev"},service:{View:"Serv"},myProfile:{View:"Prof",Notification:"Notf",Subscription:"Subs",Activity:"Actv"},customerDisplay:{View:"Disp"},orderDisplay:{View:"KitD"},global:{Export:"Export"},apps:{Marketplace:"Mrp",Jurnal:"Jurnal",Tools:"Tools"},fulfillment:{View:"Ful",Edit:"FulE",Create:"FulC",Delete:"FulD",Ship:"FulS"},manufacture:{View:"Man",Create:"ManC",Edit:"ManE",Delete:"ManD"}}}}]);