marketplacepos 3.7.2 → 3.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{chunk-WIPT5BVZ.js → chunk-2T3C7JV2.js} +2 -2
- package/Marketplace/{chunk-VZO27DX6.js → chunk-2TI26R6R.js} +2 -2
- package/Marketplace/{chunk-H65V337R.js → chunk-3FSLTDK2.js} +1 -1
- package/Marketplace/{chunk-T5BNV4KL.js → chunk-3I7X7G5V.js} +1 -1
- package/Marketplace/{chunk-7QK5UPRO.js → chunk-3RHXQKFB.js} +1 -1
- package/Marketplace/chunk-3SG3EKQ3.js +1 -0
- package/Marketplace/{chunk-AE6IHJSI.js → chunk-43GAJ6WD.js} +1 -1
- package/Marketplace/{chunk-EJ4H3OFV.js → chunk-4OCVE5TR.js} +1 -1
- package/Marketplace/{chunk-KOEWWMXB.js → chunk-55IYK2MP.js} +1 -1
- package/Marketplace/{chunk-W5LP6HWA.js → chunk-5GBQIVIY.js} +1 -1
- package/Marketplace/{chunk-ONRH4TTU.js → chunk-5J3KK3OL.js} +1 -1
- package/Marketplace/chunk-5KFJSI3K.js +1 -0
- package/Marketplace/{chunk-CBW7JGFJ.js → chunk-5L5KIUTY.js} +1 -1
- package/Marketplace/{chunk-QHJPUEQJ.js → chunk-6AEIRWBB.js} +1 -1
- package/Marketplace/{chunk-HD4CTBL2.js → chunk-6HBCXTS4.js} +1 -1
- package/Marketplace/{chunk-GSZGHECR.js → chunk-7KEJK435.js} +1 -1
- package/Marketplace/{chunk-RNMZG2RU.js → chunk-7LUEPJ2P.js} +1 -1
- package/Marketplace/{chunk-NY3NDLUY.js → chunk-7WXWLZE6.js} +1 -1
- package/Marketplace/{chunk-ZA6GABVQ.js → chunk-AKFKM77U.js} +1 -1
- package/Marketplace/{chunk-3KV2JLZD.js → chunk-AZBCL75Q.js} +1 -1
- package/Marketplace/{chunk-JEIL7GTU.js → chunk-C2BQDUEV.js} +1 -1
- package/Marketplace/{chunk-4SAZAICQ.js → chunk-C2JFVBCK.js} +1 -1
- package/Marketplace/{chunk-JHT6TPR2.js → chunk-DEWN3AM5.js} +1 -1
- package/Marketplace/{chunk-B2H2LMDP.js → chunk-DXK4LS22.js} +1 -1
- package/Marketplace/{chunk-ULZ3J3BD.js → chunk-DXSLWAQX.js} +1 -1
- package/Marketplace/{chunk-NE4U3Z2F.js → chunk-EAABO2EV.js} +1 -1
- package/Marketplace/{chunk-CQJJCQOZ.js → chunk-FEDAZTKI.js} +1 -1
- package/Marketplace/{chunk-P7MI7GDE.js → chunk-FQHOMORA.js} +1 -1
- package/Marketplace/{chunk-PL4TRYLK.js → chunk-GGNPOSPC.js} +1 -1
- package/Marketplace/{chunk-MCTEEYBG.js → chunk-GLWEQ2ER.js} +1 -1
- package/Marketplace/{chunk-QWKP6LGP.js → chunk-GWVXLAM4.js} +1 -1
- package/Marketplace/{chunk-UUY6BTJU.js → chunk-HQMAKO4U.js} +1 -1
- package/Marketplace/{chunk-N6VKSGEM.js → chunk-IATB7RKG.js} +1 -1
- package/Marketplace/{chunk-JGSLR6Q7.js → chunk-IJNIZXOB.js} +1 -1
- package/Marketplace/{chunk-ZSK75YJW.js → chunk-JVPANFAL.js} +1 -1
- package/Marketplace/{chunk-F2WJC5YO.js → chunk-L7OJXQ77.js} +2 -2
- package/Marketplace/{chunk-H65R6LYY.js → chunk-LRQNHNRY.js} +1 -1
- package/Marketplace/{chunk-LQUPRVED.js → chunk-M5Z572X7.js} +1 -1
- package/Marketplace/{chunk-ZMMTX4YX.js → chunk-MAI7CBHC.js} +1 -1
- package/Marketplace/{chunk-F7PVCSNW.js → chunk-MLVLUUHO.js} +1 -1
- package/Marketplace/{chunk-VM5LF2AQ.js → chunk-N46PJUA5.js} +1 -1
- package/Marketplace/{chunk-LU4CQUNV.js → chunk-NCBXZDJX.js} +1 -1
- package/Marketplace/{chunk-GSZSRSYG.js → chunk-NIBADICW.js} +1 -1
- package/Marketplace/{chunk-LPD77TVJ.js → chunk-NXJ4V4YK.js} +1 -1
- package/Marketplace/{chunk-37MHCWTD.js → chunk-O3LNYZ4M.js} +1 -1
- package/Marketplace/{chunk-MG7FPXZX.js → chunk-PYALJMBO.js} +1 -1
- package/Marketplace/{chunk-MQUFUG4I.js → chunk-QGZX7NE7.js} +1 -1
- package/Marketplace/{chunk-I66FBNYV.js → chunk-QQ47EB3G.js} +1 -1
- package/Marketplace/{chunk-HIX2BUDB.js → chunk-RZS2AMLW.js} +1 -1
- package/Marketplace/{chunk-27IVVEQ5.js → chunk-SEWZHFIK.js} +1 -1
- package/Marketplace/{chunk-QOBUHJEC.js → chunk-T4LIIUEO.js} +1 -1
- package/Marketplace/{chunk-LV7NKX2V.js → chunk-TCPJNRJT.js} +1 -1
- package/Marketplace/{chunk-T4IQWUBV.js → chunk-TEFJMIF6.js} +1 -1
- package/Marketplace/{chunk-RQWHADXY.js → chunk-TFNZ2JVX.js} +1 -1
- package/Marketplace/{chunk-4Z75AP5X.js → chunk-TGUXB6A6.js} +1 -1
- package/Marketplace/{chunk-IANWTXDM.js → chunk-TWKTPY5E.js} +1 -1
- package/Marketplace/{chunk-PSAPUCAJ.js → chunk-TXMYJ7NJ.js} +1 -1
- package/Marketplace/{chunk-JOI2R7DA.js → chunk-UCFGCNLH.js} +1 -1
- package/Marketplace/{chunk-6GVQC3OR.js → chunk-YJLWIQ6B.js} +1 -1
- package/Marketplace/{chunk-2SYJDDTX.js → chunk-Z7LEVL23.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-AUAZAZGD.js → main-FR3NRD5D.js} +1 -1
- package/Marketplace/{styles-DC4DACOA.css → styles-RDEF5CK2.css} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-5CBOZ77Z.js +0 -1
- package/Marketplace/chunk-FX4KZMXX.js +0 -1
- /package/Marketplace/{chunk-QYP6WXYL.js → chunk-2XBPNKZX.js} +0 -0
- /package/Marketplace/{chunk-VS4FYYKI.js → chunk-GURYDDY4.js} +0 -0
- /package/Marketplace/{chunk-5DL35YCG.js → chunk-K3WUITRV.js} +0 -0
- /package/Marketplace/{chunk-FG5W5K4B.js → chunk-W3FHD4GW.js} +0 -0
- /package/Marketplace/{polyfills-FXABYPWM.js → polyfills-ROFNJMEJ.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ne}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.
|
|
1
|
+
import{a as Ne}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.3/Marketplace/chunk-IJNIZXOB.js";import{e as Be}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.3/Marketplace/chunk-PYALJMBO.js";import{a as Le,b as le,c as $e,d as He,e as ue,f as We,g as de,h as Ke,i as q,j as he,k as I}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.3/Marketplace/chunk-N46PJUA5.js";import{a as Ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.3/Marketplace/chunk-JVPANFAL.js";import{b as ce,c as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.3/Marketplace/chunk-2XBPNKZX.js";import{$ as E,A as Ce,B as Pe,I as oe,Ic as Fe,Ka as $,Mb as xe,N as De,Nb as Re,Q as ie,Rb as ae,T as _,U as se,X as U,aa as N,b as g,ba as y,c as X,ca as h,fa as F,fc as je,g as ye,gc as Oe,h as Ie,hc as Me,k as M,l as B,m as x,n as K,pa as _e,q as D,r as Te,ua as L}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.3/Marketplace/chunk-FEDAZTKI.js";import{h as b}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.3/Marketplace/chunk-W3FHD4GW.js";var dt="firebase",ht="10.7.1";q(dt,ht,"app");var G=new xe("ANGULARFIRE2_VERSION");var pt=(r,i)=>{let t=i?[i]:Ke(),e=[];return t.forEach(n=>{n.container.getProvider(r).instances.forEach(s=>{e.includes(s)||e.push(s)})}),e},V=class{constructor(){return pt(ft)}},ft="app-check";function pe(){}var Y=class{zone;delegate;constructor(i,t=Ie){this.zone=i,this.delegate=t}now(){return this.delegate.now()}schedule(i,t,e){let n=this.zone,o=function(s){n.runGuarded(()=>{i.apply(this,[s])})};return this.delegate.schedule(o,t,e)}},fe=class{zone;task=null;constructor(i){this.zone=i}call(i,t){let e=this.unscheduleTask.bind(this);return this.task=this.zone.run(()=>Zone.current.scheduleMacroTask("firebaseZoneBlock",pe,{},pe,pe)),t.pipe(U({next:e,complete:e,error:e})).subscribe(i).add(e)}unscheduleTask(){setTimeout(()=>{this.task!=null&&this.task.state==="scheduled"&&(this.task.invoke(),this.task=null)},10)}},ze=(()=>{class r{ngZone;outsideAngular;insideAngular;constructor(t){this.ngZone=t,this.outsideAngular=t.runOutsideAngular(()=>new Y(Zone.current)),this.insideAngular=t.run(()=>new Y(Zone.current,ye)),globalThis.\u0275AngularFireScheduler||=this}static \u0275fac=function(e){return new(e||r)(h($))};static \u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();function gt(){let r=globalThis.\u0275AngularFireScheduler;if(!r)throw new Error(`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using
|
|
2
2
|
provideFirebaseApp) or you're calling an AngularFire method outside of an NgModule (which is not supported).`);return r}function qe(r){return mt(gt())(r)}function mt(r){return function(t){return t=t.lift(new fe(r.ngZone)),t.pipe(B(r.outsideAngular),M(r.insideAngular))}}var wt="firebase",kt="10.7.1";I.registerVersion(wt,kt,"app-compat");var vt=["ngOnDestroy"],Ge=(r,i,t,e={})=>new Proxy(r,{get:(n,o)=>t.runOutsideAngular(()=>{if(r[o])return e?.spy?.get&&e.spy.get(o,r[o]),r[o];if(vt.indexOf(o)>-1)return()=>{};let s=i.toPromise().then(a=>{let c=a?.[o];return typeof c=="function"?c.bind(a):c?.then?c.then(l=>t.run(()=>l)):t.run(()=>c)});return new Proxy(()=>{},{get:(a,c)=>s[c],apply:(a,c,l)=>s.then(d=>{let u=d?.(...l);return e?.spy?.apply&&e.spy.apply(o,l,u),u})})})});var Q=class{constructor(i){return i}},ee=new y("angularfire2.app.options"),te=new y("angularfire2.app.name");function ge(r,i,t){let e=typeof t=="string"&&t||"[DEFAULT]",n=typeof t=="object"&&t||{};n.name=n.name||e;let s=I.apps.filter(a=>a&&a.name===n.name)[0]||i.runOutsideAngular(()=>I.initializeApp(r,n));try{if(JSON.stringify(r)!==JSON.stringify(s.options)){let a=!!module.hot;St("error",`${s.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new Q(s)}var St=(r,...i)=>{ae()&&typeof console<"u"&&console[r](...i)},bt={provide:Q,useFactory:ge,deps:[ee,$,[new _e,te]]},Pn=(()=>{class r{static initializeApp(t,e){return{ngModule:r,providers:[{provide:ee,useValue:t},{provide:te,useValue:e}]}}constructor(t){I.registerVersion("angularfire",G.full,"core"),I.registerVersion("angularfire",G.full,"app-compat"),I.registerVersion("angular",Re.full,t.toString())}static \u0275fac=function(e){return new(e||r)(h(L))};static \u0275mod=F({type:r});static \u0275inj=N({providers:[bt]})}return r})();function Je(r,i,t,e,n){let[,o,s]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===r)||[];if(o)return Et(n,s)||(Ve("error",`${i} was already initialized on the ${t} Firebase App with different settings.${yt?" You may need to reload as Firebase is not HMR aware.":""}`),Ve("warn",{is:n,was:s})),o;{let a=e();return globalThis.\u0275AngularfireInstanceCache.push([r,a,n]),a}}function Et(r,i){try{return r.toString()===i.toString()}catch{return r===i}}var yt=typeof module<"u"&&!!module.hot,Ve=(r,...i)=>{ae()&&typeof console<"u"&&console[r](...i)};globalThis.\u0275AngularfireInstanceCache||=[];var It=new Map,Tt={activated:!1,tokenObservers:[]},Ct={initialized:!1,enabled:!1};function T(r){return It.get(r)||Object.assign({},Tt)}function et(){return Ct}var Pt="https://content-firebaseappcheck.googleapis.com/v1";var Dt="exchangeDebugToken",Ze={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Hn=24*60*60*1e3;var Ae=class{constructor(i,t,e,n,o){if(this.operation=i,this.retryPolicy=t,this.getWaitDuration=e,this.lowerBound=n,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=n,n>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(i){return b(this,null,function*(){this.stop();try{this.pending=new le,this.pending.promise.catch(t=>{}),yield _t(this.getNextRun(i)),this.pending.resolve(),yield this.pending.promise,this.pending=new le,this.pending.promise.catch(t=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(t){this.retryPolicy(t)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(i){if(i)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let t=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),t}}};function _t(r){return new Promise(i=>{setTimeout(i,r)})}var xt={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"},R=new He("appCheck","AppCheck",xt);function tt(r){if(!T(r).activated)throw R.create("use-before-activation",{appName:r.name})}function nt(e,n){return b(this,arguments,function*({url:r,body:i},t){let o={"Content-Type":"application/json"},s=t.getImmediate({optional:!0});if(s){let f=yield s.getHeartbeatsHeader();f&&(o["X-Firebase-Client"]=f)}let a={method:"POST",body:JSON.stringify(i),headers:o},c;try{c=yield fetch(r,a)}catch(f){throw R.create("fetch-network-error",{originalErrorMessage:f?.message})}if(c.status!==200)throw R.create("fetch-status-error",{httpStatus:c.status});let l;try{l=yield c.json()}catch(f){throw R.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=l.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw R.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${l.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:l.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function rt(r,i){let{projectId:t,appId:e,apiKey:n}=r.options;return{url:`${Pt}/projects/${t}/apps/${e}:${Dt}?key=${n}`,body:{debug_token:i}}}var Rt="firebase-app-check-database",jt=1,we="firebase-app-check-store";var ne=null;function Ot(){return ne||(ne=new Promise((r,i)=>{try{let t=indexedDB.open(Rt,jt);t.onsuccess=e=>{r(e.target.result)},t.onerror=e=>{var n;i(R.create("storage-open",{originalErrorMessage:(n=e.target.error)===null||n===void 0?void 0:n.message}))},t.onupgradeneeded=e=>{let n=e.target.result;switch(e.oldVersion){case 0:n.createObjectStore(we,{keyPath:"compositeKey"})}}}catch(t){i(R.create("storage-open",{originalErrorMessage:t?.message}))}}),ne)}function Mt(r,i){return Bt(Nt(r),i)}function Bt(r,i){return b(this,null,function*(){let e=(yield Ot()).transaction(we,"readwrite"),o=e.objectStore(we).put({compositeKey:r,value:i});return new Promise((s,a)=>{o.onsuccess=c=>{s()},e.onerror=c=>{var l;a(R.create("storage-set",{originalErrorMessage:(l=c.target.error)===null||l===void 0?void 0:l.message}))}})})}function Nt(r){return`${r.options.appId}-${r.name}`}var ke=new We("@firebase/app-check");function me(r,i){return $e()?Mt(r,i).catch(t=>{ke.warn(`Failed to write token to IndexedDB. Error: ${t}`)}):Promise.resolve()}function ot(){return et().enabled}function it(){return b(this,null,function*(){let r=et();if(r.enabled&&r.token)return r.token.promise;throw Error(`
|
|
3
3
|
Can't get debug token in production mode.
|
|
4
|
-
`)})}var Ft={error:"UNKNOWN_ERROR"};function Lt(r){return Le.encodeString(JSON.stringify(r),!1)}function ve(r,i=!1){return b(this,null,function*(){let t=r.app;tt(t);let e=T(t),n=e.token,o;if(n&&!J(n)&&(e.token=void 0,n=void 0),!n){let c=yield e.cachedTokenPromise;c&&(J(c)?n=c:yield me(t,void 0))}if(!i&&n&&J(n))return{token:n.token};let s=!1;if(ot()){e.exchangeTokenPromise||(e.exchangeTokenPromise=nt(rt(t,yield it()),r.heartbeatServiceProvider).finally(()=>{e.exchangeTokenPromise=void 0}),s=!0);let c=yield e.exchangeTokenPromise;return yield me(t,c),e.token=c,{token:c.token}}try{e.exchangeTokenPromise||(e.exchangeTokenPromise=e.provider.getToken().finally(()=>{e.exchangeTokenPromise=void 0}),s=!0),n=yield T(t).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"?ke.warn(c.message):ke.error(c),o=c}let a;return n?o?J(n)?a={token:n.token,internalError:o}:a=Ye(o):(a={token:n.token},e.token=n,yield me(t,n)):a=Ye(o),s&&Kt(t,a),a})}function $t(r){return b(this,null,function*(){let i=r.app;tt(i);let{provider:t}=T(i);if(ot()){let e=yield it(),{token:n}=yield nt(rt(i,e),r.heartbeatServiceProvider);return{token:n}}else{let{token:e}=yield t.getToken();return{token:e}}})}function Ht(r,i,t,e){let{app:n}=r,o=T(n),s={next:t,error:e,type:i};if(o.tokenObservers=[...o.tokenObservers,s],o.token&&J(o.token)){let a=o.token;Promise.resolve().then(()=>{t({token:a.token}),Xe(r)}).catch(()=>{})}o.cachedTokenPromise.then(()=>Xe(r))}function st(r,i){let t=T(r),e=t.tokenObservers.filter(n=>n.next!==i);e.length===0&&t.tokenRefresher&&t.tokenRefresher.isRunning()&&t.tokenRefresher.stop(),t.tokenObservers=e}function Xe(r){let{app:i}=r,t=T(i),e=t.tokenRefresher;e||(e=Wt(r),t.tokenRefresher=e),!e.isRunning()&&t.isTokenAutoRefreshEnabled&&e.start()}function Wt(r){let{app:i}=r;return new Ae(()=>b(this,null,function*(){let t=T(i),e;if(t.token?e=yield ve(r,!0):e=yield ve(r),e.error)throw e.error;if(e.internalError)throw e.internalError}),()=>!0,()=>{let t=T(i);if(t.token){let e=t.token.issuedAtTimeMillis+(t.token.expireTimeMillis-t.token.issuedAtTimeMillis)*.5+3e5,n=t.token.expireTimeMillis-5*60*1e3;return e=Math.min(e,n),Math.max(0,e-Date.now())}else return 0},Ze.RETRIAL_MIN_WAIT,Ze.RETRIAL_MAX_WAIT)}function Kt(r,i){let t=T(r).tokenObservers;for(let e of t)try{e.type==="EXTERNAL"&&i.error!=null?e.error(i.error):e.next(i)}catch{}}function J(r){return r.expireTimeMillis-Date.now()>0}function Ye(r){return{token:Lt(Ft),error:r}}var Se=class{constructor(i,t){this.app=i,this.heartbeatServiceProvider=t}_delete(){let{tokenObservers:i}=T(this.app);for(let t of i)st(this.app,t.next);return Promise.resolve()}};function Ut(r,i){return new Se(r,i)}function zt(r){return{getToken:i=>ve(r,i),getLimitedUseToken:()=>$t(r),addTokenListener:i=>Ht(r,"INTERNAL",i),removeTokenListener:i=>st(r.app,i)}}var qt="@firebase/app-check",Vt="0.8.1";var Gt="app-check",Qe="app-check-internal";function Jt(){de(new ue(Gt,r=>{let i=r.getProvider("app").getImmediate(),t=r.getProvider("heartbeat");return Ut(i,t)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((r,i,t)=>{r.getProvider(Qe).initialize()})),de(new ue(Qe,r=>{let i=r.getProvider("app-check").getImmediate();return zt(i)},"PUBLIC").setInstantiationMode("EXPLICIT")),q(qt,Vt)}Jt();var Zt=["localhost","0.0.0.0","127.0.0.1"],Qn=typeof window<"u"&&Zt.includes(window.location.hostname);var Yt=new y("angularfire2.auth.use-emulator"),Qt=new y("angularfire2.auth.settings"),en=new y("angularfire2.auth.tenant-id"),tn=new y("angularfire2.auth.langugage-code"),nn=new y("angularfire2.auth.use-device-language"),rn=new y("angularfire.auth.persistence"),on=(r,i,t,e,n,o,s,a)=>Je(`${r.name}.auth`,"AngularFireAuth",r.name,()=>{let c=i.runOutsideAngular(()=>r.auth());if(t&&c.useEmulator(...t),e&&(c.tenantId=e),c.languageCode=n,o&&c.useDeviceLanguage(),s)for(let[l,d]of Object.entries(s))c.settings[l]=d;return a&&c.setPersistence(a),c},[t,e,n,o,s,a]),be=(()=>{class r{authState;idToken;user;idTokenResult;credential;constructor(t,e,n,o,s,a,c,l,d,u,p,f){let W=new X,j=K(void 0).pipe(M(s.outsideAngular),_(()=>o.runOutsideAngular(()=>import("https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-5CBOZ77Z.js"))),D(()=>ge(t,o,e)),D(C=>on(C,o,a,l,d,u,c,p)),ie({bufferSize:1,refCount:!1}));if(Me(n))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=K(null);else{j.pipe(De()).subscribe();let C=j.pipe(_(A=>A.getRedirectResult().then(P=>P,()=>null)),qe,ie({bufferSize:1,refCount:!1})),Z=j.pipe(_(A=>new g(P=>({unsubscribe:o.runOutsideAngular(()=>A.onAuthStateChanged(O=>P.next(O),O=>P.error(O),()=>P.complete()))})))),re=j.pipe(_(A=>new g(P=>({unsubscribe:o.runOutsideAngular(()=>A.onIdTokenChanged(O=>P.next(O),O=>P.error(O),()=>P.complete()))}))));this.authState=C.pipe(se(Z),B(s.outsideAngular),M(s.insideAngular)),this.user=C.pipe(se(re),B(s.outsideAngular),M(s.insideAngular)),this.idToken=this.user.pipe(_(A=>A?x(A.getIdToken()):K(null))),this.idTokenResult=this.user.pipe(_(A=>A?x(A.getIdTokenResult()):K(null))),this.credential=Ce(C,W,this.authState.pipe(Pe(A=>!A))).pipe(D(A=>A?.user?A:null),B(s.outsideAngular),M(s.insideAngular))}return Ge(this,j,o,{spy:{apply:(C,Z,re)=>{(C.startsWith("signIn")||C.startsWith("createUser"))&&re.then(A=>W.next(A))}}})}static \u0275fac=function(e){return new(e||r)(h(ee),h(te,8),h(L),h($),h(ze),h(Yt,8),h(Qt,8),h(en,8),h(tn,8),h(nn,8),h(rn,8),h(V,8))};static \u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"any"})}return r})(),gr=(()=>{class r{constructor(){I.registerVersion("angularfire",G.full,"auth-compat")}static \u0275fac=function(e){return new(e||r)};static \u0275mod=F({type:r});static \u0275inj=N({providers:[be]})}return r})();function m(r,i,t,e){return new Promise((n,o)=>{r||o("IndexedDB not available");let s=r.open(i,t),a;s.onsuccess=c=>{a=s.result,n(a)},s.onerror=c=>{o(`IndexedDB error: ${s.error}`)},typeof e=="function"&&(s.onupgradeneeded=c=>{e(c,a)})})}function at(r,i,t,e,n){if(!r)return;let o=r.open(i,t);o.onupgradeneeded=s=>{let a=s.target.result;e.forEach(l=>{if(!a.objectStoreNames.contains(l.store)){let d=a.createObjectStore(l.store,l.storeConfig);l.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let c=n&&n();c&&Object.keys(c).map(l=>parseInt(l,10)).filter(l=>l>s.oldVersion).sort((l,d)=>l-d).forEach(l=>{c[l](a,o.transaction)}),a.close()},o.onsuccess=s=>{s.target.result.close()}}function an(r,i,t){if(!r||!i||!t)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(e=>{try{let n=i+1,o=indexedDB.open(r,n);o.onupgradeneeded=s=>{let a=s.target.result;a.deleteObjectStore(t),a.close(),console.log("onupgradeneeded"),e.next(!0),e.complete()},o.onerror=s=>e.error(s)}catch(n){e.error(n)}})}function cn(r,i){return r.objectStoreNames.contains(i)}function S(r,i,t){r||t("You need to use the openDatabase function to create a database before you query it!"),cn(r,i)||t(`objectStore does not exists: ${i}`)}function k(r,i){let t=r.transaction(i.storeName,i.dbMode);return t.onerror=i.error,t.onabort=i.abort,t}function v(r,i,t,e){return{storeName:i,dbMode:r,error:n=>{t(n)},abort:n=>{t(n)}}}var w=function(r){return r.readonly="readonly",r.readwrite="readwrite",r}(w||{}),ct=new y(null),Ee=(()=>{class r{constructor(t,e){if(this.dbConfig=t,this.platformId=e,!t.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!t.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=Oe(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,at(this.indexedDB,t.name,t.version,t.objectStoresMeta,t.migrationFactory),m(this.indexedDB,t.name).then(n=>{n.version!==t.version&&(this.dbConfig.version=n.version)}))}createObjectStore(t,e){let n=[t];at(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,n,e)}add(t,e,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{let c=k(s,v(w.readwrite,t,d=>o.error(d))).objectStore(t),l=n?c.add(e,n):c.add(e);l.onsuccess=d=>b(this,null,function*(){let u=d.target.result,p=c.get(u);p.onsuccess=f=>{o.next(f.target.result),o.complete()}})}).catch(s=>o.error(s))})}bulkAdd(t,e){let n=new Promise((o,s)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{let l=k(a,v(w.readwrite,t,o,s)).objectStore(t),d=e.map(u=>new Promise((p,f)=>{let W=u.key;delete u.key;let j=W?l.add(u,W):l.add(u);j.onsuccess=C=>{let Z=C.target.result;p(Z)}}));o(Promise.all(d))}).catch(a=>s(a))});return x(n)}bulkDelete(t,e){let n=e.map(o=>new Promise((s,a)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(c=>{let l=k(c,v(w.readwrite,t,a,s));l.objectStore(t).delete(o),l.oncomplete=()=>{this.getAll(t).pipe(oe(1)).subscribe(u=>{s(u)})}}).catch(c=>a(c))}));return x(Promise.all(n))}getByKey(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{let c=k(o,v(w.readonly,t,n.error)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result),n.complete()},c.onerror=l=>{n.error(l)}}).catch(o=>n.error(o))})}bulkGet(t,e){let n=e.map(o=>this.getByKey(t,o));return new g(o=>{Te(n).subscribe(s=>{o.next(s),o.complete()})})}getByID(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,l=>n.error(l));let c=k(o,v(w.readonly,t,n.error,n.next)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result)}}).catch(o=>n.error(o))})}getByIndex(t,e,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{S(s,t,u=>o.error(u));let d=k(s,v(w.readonly,t,o.error)).objectStore(t).index(e).get(n);d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(s=>o.error(s))})}getAll(t){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{S(n,t,c=>e.error(c));let a=k(n,v(w.readonly,t,e.error,e.next)).objectStore(t).getAll();a.onerror=c=>{e.error(c)},a.onsuccess=({target:{result:c}})=>{e.next(c),e.complete()}}).catch(n=>e.error(n))})}update(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,l=>n.error(l));let a=k(o,v(w.readwrite,t,l=>n.error(l))).objectStore(t),c=a.put(e);c.onsuccess=l=>b(this,null,function*(){let d=l.target.result,u=a.get(d);u.onsuccess=p=>{n.next(p.target.result),n.complete()}})}).catch(o=>n.error(o))})}delete(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,c=>n.error(c));let s=k(o,v(w.readwrite,t,c=>n.error(c)));s.objectStore(t).delete(e),s.oncomplete=()=>{this.getAll(t).pipe(oe(1)).subscribe(c=>{n.next(c),n.complete()})}}).catch(o=>n.error(o))})}deleteByKey(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,c=>n.error(c));let s=k(o,v(w.readwrite,t,c=>n.error(c))),a=s.objectStore(t);s.oncomplete=()=>{n.next(!0),n.complete()},a.delete(e)}).catch(o=>n.error(o))})}clear(t){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{S(n,t,a=>e.error(a));let o=k(n,v(w.readwrite,t,a=>e.error(a)));o.objectStore(t).clear(),o.oncomplete=()=>{e.next(!0),e.complete()}}).catch(n=>e.error(n))})}deleteDatabase(){return new g(t=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(e=>b(this,null,function*(){yield e.close();let n=this.indexedDB.deleteDatabase(this.dbConfig.name);n.onsuccess=()=>{t.next(!0),t.complete()},n.onerror=o=>t.error(o),n.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(e=>t.error(e))})}openCursor(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,l=>n.error(l));let a=k(o,v(w.readonly,t,n.error)).objectStore(t),c=e===void 0?a.openCursor():a.openCursor(e);c.onsuccess=l=>{n.next(l),n.complete()}}).catch(o=>n.error(o))})}openCursorByIndex(t,e,n,o=w.readonly){let s=new X;return m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{S(a,t,p=>{s.error(p)});let u=k(a,v(o,t,p=>{s.error(p)},()=>{s.next()})).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{s.next(p)}}).catch(a=>s.error(a)),s}getAllByIndex(t,e,n){let o=[];return new g(s=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{S(a,t,p=>s.error(p));let u=k(a,v(w.readonly,t,s.error)).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(o.push(f.value),f.continue()):(s.next(o),s.complete())}}).catch(a=>s.error(a))})}getAllKeysByIndex(t,e,n){let o=[];return new g(s=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{S(a,t,p=>s.error(p));let u=k(a,v(w.readonly,t,s.error)).objectStore(t).index(e).openKeyCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(o.push({primaryKey:f.primaryKey,key:f.key}),f.continue()):(s.next(o),s.complete())}}).catch(a=>s.error(a))})}count(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,l=>n.error(l));let c=k(o,v(w.readonly,t,n.error)).objectStore(t).count(e);c.onerror=l=>n.error(l),c.onsuccess=l=>{n.next(l.target.result),n.complete()}}).catch(o=>n.error(o))})}countByIndex(t,e,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{S(s,t,u=>o.error(u));let d=k(s,v(w.readonly,t,o.error)).objectStore(t).index(e).count(n);d.onerror=u=>o.error(u),d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(s=>o.error(s))})}deleteObjectStore(t){return an(this.dbConfig.name,++this.dbConfig.version,t)}}return r.\u0275fac=function(t){return new(t||r)(h(ct),h(L))},r.\u0275prov=E({token:r,factory:r.\u0275fac}),r})(),Er=(()=>{class r{static forRoot(t){return{ngModule:r,providers:[Ee,{provide:ct,useValue:t}]}}}return r.\u0275fac=function(t){return new(t||r)},r.\u0275mod=F({type:r}),r.\u0275inj=N({imports:[[je]]}),r})();var lt=(()=>{let i=class i{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,n){let o=this.getKey(n);return this.db.add(this.DATABASE,e,o).pipe(D(s=>e))}getCategoriesByChannelType(e){let n=this.getKey(e);return this.db.getByKey(this.DATABASE,n)}getKey(e){let n="";switch(e){case ce.Lazada:n="Lazada";break;case ce.Tokopedia:n="Tokopedia";break}return n}clearDatabase(){this.db.clear(this.DATABASE)}getHostName(){let e=localStorage.getItem("Authorization");return this.hostName=JSON.parse(e)?.Host,this.hostName}};i.\u0275fac=function(n){return new(n||i)(h(Ee))},i.\u0275prov=E({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})();var ut=(()=>{let i=class i{constructor(){}inititalizeIntercom(){let e=this.getFromLocalStorage();e?.Enabled&&window.Intercom("boot",{app_id:"xv1oomgl",name:e.Name,email:e.Email,created_at:e.Created,user_hash:e.Hash})}shutdown(){this.getFromLocalStorage()?.Enabled&&(window.Intercom("shutdown"),this.clearStorage())}clearStorage(){localStorage.removeItem("Intercom")}updateLocalStorage(e){e&&(e.Enabled=!0),localStorage.setItem("Intercom",JSON.stringify(e))}getFromLocalStorage(){let e=localStorage.getItem("Intercom");return JSON.parse(e)}hideLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!0}),e.hide_default_launcher=!0,this.updateLocalStorage(e))}showLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!1}),e.hide_default_launcher=!1,this.updateLocalStorage(e))}isHideLauncher(){let e=this.getFromLocalStorage();return z.IsEmpty(e?.hide_default_launcher)?!1:e?.hide_default_launcher}};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=E({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})();var Ai=(()=>{let i=class i{constructor(e,n,o,s,a,c,l){this.httpService=e,this.tokenDecodeService=n,this.afAuth=o,this.ngxPermission=s,this.localDataService=a,this.router=c,this.intercomService=l,this.channels=[]}login(e){return this.httpService.post("/api/token/Login",e).pipe(U(n=>{this.setLocalStorage(n,e.Host,e.Username),this.loadPermissions()}))}loginWithGoogle(e,n){e.preventDefault();let o=new he;return o.setCustomParameters({prompt:"select_account"}),x(this.afAuth.signInWithPopup(o)).pipe(D(s=>s.credential),D(s=>s.idToken),_(s=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:s,Host:n}))),U(s=>{this.setLocalStorage(s,n,null),this.loadPermissions()}))}setLocalStorage(e,n,o){localStorage.setItem("user",JSON.stringify(e)),localStorage.setItem("Authorization",JSON.stringify({Host:n,username:o})),localStorage.setItem("channels",JSON.stringify(e.Channels)),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem("user");if(z.IsNotEmpty(e)){let n=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(n)}}getChannels(){let e=JSON.parse(JSON.stringify(this.channels));if(this.channels.length===0){let n=localStorage.getItem("channels");n?(this.channels=JSON.parse(n),e=JSON.parse(JSON.stringify(this.channels))):(this.channels=[],e=[])}return e=this.setChannelLogo(e),e}setChannelLogo(e){return e=e.map(n=>(n.logo=z.getChannelLogoByTypeId(n.TypeID),n)),e}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=JSON.parse(window.localStorage.getItem("user")),n=new Date;if(e!=null){let o=new Date(e.Token.expiredAt);return n<o?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem("Authorization");this.domain="https://"+JSON.parse(e).Host}return this.domain}clearLocalStorage(){this.domain=null,this.channels=[],localStorage.removeItem("channels"),localStorage.removeItem("user"),this.intercomService.shutdown(),this.localDataService.clearDatabase(),this.router.navigate([""])}};i.\u0275fac=function(n){return new(n||i)(h(Be),h(Ne),h(be),h(Ue),h(lt),h(Fe),h(ut))},i.\u0275prov=E({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})();export{Pn as a,gr as b,Er as c,lt as d,Ai as e};
|
|
4
|
+
`)})}var Ft={error:"UNKNOWN_ERROR"};function Lt(r){return Le.encodeString(JSON.stringify(r),!1)}function ve(r,i=!1){return b(this,null,function*(){let t=r.app;tt(t);let e=T(t),n=e.token,o;if(n&&!J(n)&&(e.token=void 0,n=void 0),!n){let c=yield e.cachedTokenPromise;c&&(J(c)?n=c:yield me(t,void 0))}if(!i&&n&&J(n))return{token:n.token};let s=!1;if(ot()){e.exchangeTokenPromise||(e.exchangeTokenPromise=nt(rt(t,yield it()),r.heartbeatServiceProvider).finally(()=>{e.exchangeTokenPromise=void 0}),s=!0);let c=yield e.exchangeTokenPromise;return yield me(t,c),e.token=c,{token:c.token}}try{e.exchangeTokenPromise||(e.exchangeTokenPromise=e.provider.getToken().finally(()=>{e.exchangeTokenPromise=void 0}),s=!0),n=yield T(t).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"?ke.warn(c.message):ke.error(c),o=c}let a;return n?o?J(n)?a={token:n.token,internalError:o}:a=Ye(o):(a={token:n.token},e.token=n,yield me(t,n)):a=Ye(o),s&&Kt(t,a),a})}function $t(r){return b(this,null,function*(){let i=r.app;tt(i);let{provider:t}=T(i);if(ot()){let e=yield it(),{token:n}=yield nt(rt(i,e),r.heartbeatServiceProvider);return{token:n}}else{let{token:e}=yield t.getToken();return{token:e}}})}function Ht(r,i,t,e){let{app:n}=r,o=T(n),s={next:t,error:e,type:i};if(o.tokenObservers=[...o.tokenObservers,s],o.token&&J(o.token)){let a=o.token;Promise.resolve().then(()=>{t({token:a.token}),Xe(r)}).catch(()=>{})}o.cachedTokenPromise.then(()=>Xe(r))}function st(r,i){let t=T(r),e=t.tokenObservers.filter(n=>n.next!==i);e.length===0&&t.tokenRefresher&&t.tokenRefresher.isRunning()&&t.tokenRefresher.stop(),t.tokenObservers=e}function Xe(r){let{app:i}=r,t=T(i),e=t.tokenRefresher;e||(e=Wt(r),t.tokenRefresher=e),!e.isRunning()&&t.isTokenAutoRefreshEnabled&&e.start()}function Wt(r){let{app:i}=r;return new Ae(()=>b(this,null,function*(){let t=T(i),e;if(t.token?e=yield ve(r,!0):e=yield ve(r),e.error)throw e.error;if(e.internalError)throw e.internalError}),()=>!0,()=>{let t=T(i);if(t.token){let e=t.token.issuedAtTimeMillis+(t.token.expireTimeMillis-t.token.issuedAtTimeMillis)*.5+3e5,n=t.token.expireTimeMillis-5*60*1e3;return e=Math.min(e,n),Math.max(0,e-Date.now())}else return 0},Ze.RETRIAL_MIN_WAIT,Ze.RETRIAL_MAX_WAIT)}function Kt(r,i){let t=T(r).tokenObservers;for(let e of t)try{e.type==="EXTERNAL"&&i.error!=null?e.error(i.error):e.next(i)}catch{}}function J(r){return r.expireTimeMillis-Date.now()>0}function Ye(r){return{token:Lt(Ft),error:r}}var Se=class{constructor(i,t){this.app=i,this.heartbeatServiceProvider=t}_delete(){let{tokenObservers:i}=T(this.app);for(let t of i)st(this.app,t.next);return Promise.resolve()}};function Ut(r,i){return new Se(r,i)}function zt(r){return{getToken:i=>ve(r,i),getLimitedUseToken:()=>$t(r),addTokenListener:i=>Ht(r,"INTERNAL",i),removeTokenListener:i=>st(r.app,i)}}var qt="@firebase/app-check",Vt="0.8.1";var Gt="app-check",Qe="app-check-internal";function Jt(){de(new ue(Gt,r=>{let i=r.getProvider("app").getImmediate(),t=r.getProvider("heartbeat");return Ut(i,t)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((r,i,t)=>{r.getProvider(Qe).initialize()})),de(new ue(Qe,r=>{let i=r.getProvider("app-check").getImmediate();return zt(i)},"PUBLIC").setInstantiationMode("EXPLICIT")),q(qt,Vt)}Jt();var Zt=["localhost","0.0.0.0","127.0.0.1"],Qn=typeof window<"u"&&Zt.includes(window.location.hostname);var Yt=new y("angularfire2.auth.use-emulator"),Qt=new y("angularfire2.auth.settings"),en=new y("angularfire2.auth.tenant-id"),tn=new y("angularfire2.auth.langugage-code"),nn=new y("angularfire2.auth.use-device-language"),rn=new y("angularfire.auth.persistence"),on=(r,i,t,e,n,o,s,a)=>Je(`${r.name}.auth`,"AngularFireAuth",r.name,()=>{let c=i.runOutsideAngular(()=>r.auth());if(t&&c.useEmulator(...t),e&&(c.tenantId=e),c.languageCode=n,o&&c.useDeviceLanguage(),s)for(let[l,d]of Object.entries(s))c.settings[l]=d;return a&&c.setPersistence(a),c},[t,e,n,o,s,a]),be=(()=>{class r{authState;idToken;user;idTokenResult;credential;constructor(t,e,n,o,s,a,c,l,d,u,p,f){let W=new X,j=K(void 0).pipe(M(s.outsideAngular),_(()=>o.runOutsideAngular(()=>import("https://cdn.jsdelivr.net/npm/marketplacepos@3.7.3/Marketplace/chunk-5KFJSI3K.js"))),D(()=>ge(t,o,e)),D(C=>on(C,o,a,l,d,u,c,p)),ie({bufferSize:1,refCount:!1}));if(Me(n))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=K(null);else{j.pipe(De()).subscribe();let C=j.pipe(_(A=>A.getRedirectResult().then(P=>P,()=>null)),qe,ie({bufferSize:1,refCount:!1})),Z=j.pipe(_(A=>new g(P=>({unsubscribe:o.runOutsideAngular(()=>A.onAuthStateChanged(O=>P.next(O),O=>P.error(O),()=>P.complete()))})))),re=j.pipe(_(A=>new g(P=>({unsubscribe:o.runOutsideAngular(()=>A.onIdTokenChanged(O=>P.next(O),O=>P.error(O),()=>P.complete()))}))));this.authState=C.pipe(se(Z),B(s.outsideAngular),M(s.insideAngular)),this.user=C.pipe(se(re),B(s.outsideAngular),M(s.insideAngular)),this.idToken=this.user.pipe(_(A=>A?x(A.getIdToken()):K(null))),this.idTokenResult=this.user.pipe(_(A=>A?x(A.getIdTokenResult()):K(null))),this.credential=Ce(C,W,this.authState.pipe(Pe(A=>!A))).pipe(D(A=>A?.user?A:null),B(s.outsideAngular),M(s.insideAngular))}return Ge(this,j,o,{spy:{apply:(C,Z,re)=>{(C.startsWith("signIn")||C.startsWith("createUser"))&&re.then(A=>W.next(A))}}})}static \u0275fac=function(e){return new(e||r)(h(ee),h(te,8),h(L),h($),h(ze),h(Yt,8),h(Qt,8),h(en,8),h(tn,8),h(nn,8),h(rn,8),h(V,8))};static \u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"any"})}return r})(),gr=(()=>{class r{constructor(){I.registerVersion("angularfire",G.full,"auth-compat")}static \u0275fac=function(e){return new(e||r)};static \u0275mod=F({type:r});static \u0275inj=N({providers:[be]})}return r})();function m(r,i,t,e){return new Promise((n,o)=>{r||o("IndexedDB not available");let s=r.open(i,t),a;s.onsuccess=c=>{a=s.result,n(a)},s.onerror=c=>{o(`IndexedDB error: ${s.error}`)},typeof e=="function"&&(s.onupgradeneeded=c=>{e(c,a)})})}function at(r,i,t,e,n){if(!r)return;let o=r.open(i,t);o.onupgradeneeded=s=>{let a=s.target.result;e.forEach(l=>{if(!a.objectStoreNames.contains(l.store)){let d=a.createObjectStore(l.store,l.storeConfig);l.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let c=n&&n();c&&Object.keys(c).map(l=>parseInt(l,10)).filter(l=>l>s.oldVersion).sort((l,d)=>l-d).forEach(l=>{c[l](a,o.transaction)}),a.close()},o.onsuccess=s=>{s.target.result.close()}}function an(r,i,t){if(!r||!i||!t)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(e=>{try{let n=i+1,o=indexedDB.open(r,n);o.onupgradeneeded=s=>{let a=s.target.result;a.deleteObjectStore(t),a.close(),console.log("onupgradeneeded"),e.next(!0),e.complete()},o.onerror=s=>e.error(s)}catch(n){e.error(n)}})}function cn(r,i){return r.objectStoreNames.contains(i)}function S(r,i,t){r||t("You need to use the openDatabase function to create a database before you query it!"),cn(r,i)||t(`objectStore does not exists: ${i}`)}function k(r,i){let t=r.transaction(i.storeName,i.dbMode);return t.onerror=i.error,t.onabort=i.abort,t}function v(r,i,t,e){return{storeName:i,dbMode:r,error:n=>{t(n)},abort:n=>{t(n)}}}var w=function(r){return r.readonly="readonly",r.readwrite="readwrite",r}(w||{}),ct=new y(null),Ee=(()=>{class r{constructor(t,e){if(this.dbConfig=t,this.platformId=e,!t.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!t.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=Oe(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,at(this.indexedDB,t.name,t.version,t.objectStoresMeta,t.migrationFactory),m(this.indexedDB,t.name).then(n=>{n.version!==t.version&&(this.dbConfig.version=n.version)}))}createObjectStore(t,e){let n=[t];at(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,n,e)}add(t,e,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{let c=k(s,v(w.readwrite,t,d=>o.error(d))).objectStore(t),l=n?c.add(e,n):c.add(e);l.onsuccess=d=>b(this,null,function*(){let u=d.target.result,p=c.get(u);p.onsuccess=f=>{o.next(f.target.result),o.complete()}})}).catch(s=>o.error(s))})}bulkAdd(t,e){let n=new Promise((o,s)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{let l=k(a,v(w.readwrite,t,o,s)).objectStore(t),d=e.map(u=>new Promise((p,f)=>{let W=u.key;delete u.key;let j=W?l.add(u,W):l.add(u);j.onsuccess=C=>{let Z=C.target.result;p(Z)}}));o(Promise.all(d))}).catch(a=>s(a))});return x(n)}bulkDelete(t,e){let n=e.map(o=>new Promise((s,a)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(c=>{let l=k(c,v(w.readwrite,t,a,s));l.objectStore(t).delete(o),l.oncomplete=()=>{this.getAll(t).pipe(oe(1)).subscribe(u=>{s(u)})}}).catch(c=>a(c))}));return x(Promise.all(n))}getByKey(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{let c=k(o,v(w.readonly,t,n.error)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result),n.complete()},c.onerror=l=>{n.error(l)}}).catch(o=>n.error(o))})}bulkGet(t,e){let n=e.map(o=>this.getByKey(t,o));return new g(o=>{Te(n).subscribe(s=>{o.next(s),o.complete()})})}getByID(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,l=>n.error(l));let c=k(o,v(w.readonly,t,n.error,n.next)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result)}}).catch(o=>n.error(o))})}getByIndex(t,e,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{S(s,t,u=>o.error(u));let d=k(s,v(w.readonly,t,o.error)).objectStore(t).index(e).get(n);d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(s=>o.error(s))})}getAll(t){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{S(n,t,c=>e.error(c));let a=k(n,v(w.readonly,t,e.error,e.next)).objectStore(t).getAll();a.onerror=c=>{e.error(c)},a.onsuccess=({target:{result:c}})=>{e.next(c),e.complete()}}).catch(n=>e.error(n))})}update(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,l=>n.error(l));let a=k(o,v(w.readwrite,t,l=>n.error(l))).objectStore(t),c=a.put(e);c.onsuccess=l=>b(this,null,function*(){let d=l.target.result,u=a.get(d);u.onsuccess=p=>{n.next(p.target.result),n.complete()}})}).catch(o=>n.error(o))})}delete(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,c=>n.error(c));let s=k(o,v(w.readwrite,t,c=>n.error(c)));s.objectStore(t).delete(e),s.oncomplete=()=>{this.getAll(t).pipe(oe(1)).subscribe(c=>{n.next(c),n.complete()})}}).catch(o=>n.error(o))})}deleteByKey(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,c=>n.error(c));let s=k(o,v(w.readwrite,t,c=>n.error(c))),a=s.objectStore(t);s.oncomplete=()=>{n.next(!0),n.complete()},a.delete(e)}).catch(o=>n.error(o))})}clear(t){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{S(n,t,a=>e.error(a));let o=k(n,v(w.readwrite,t,a=>e.error(a)));o.objectStore(t).clear(),o.oncomplete=()=>{e.next(!0),e.complete()}}).catch(n=>e.error(n))})}deleteDatabase(){return new g(t=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(e=>b(this,null,function*(){yield e.close();let n=this.indexedDB.deleteDatabase(this.dbConfig.name);n.onsuccess=()=>{t.next(!0),t.complete()},n.onerror=o=>t.error(o),n.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(e=>t.error(e))})}openCursor(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,l=>n.error(l));let a=k(o,v(w.readonly,t,n.error)).objectStore(t),c=e===void 0?a.openCursor():a.openCursor(e);c.onsuccess=l=>{n.next(l),n.complete()}}).catch(o=>n.error(o))})}openCursorByIndex(t,e,n,o=w.readonly){let s=new X;return m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{S(a,t,p=>{s.error(p)});let u=k(a,v(o,t,p=>{s.error(p)},()=>{s.next()})).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{s.next(p)}}).catch(a=>s.error(a)),s}getAllByIndex(t,e,n){let o=[];return new g(s=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{S(a,t,p=>s.error(p));let u=k(a,v(w.readonly,t,s.error)).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(o.push(f.value),f.continue()):(s.next(o),s.complete())}}).catch(a=>s.error(a))})}getAllKeysByIndex(t,e,n){let o=[];return new g(s=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{S(a,t,p=>s.error(p));let u=k(a,v(w.readonly,t,s.error)).objectStore(t).index(e).openKeyCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(o.push({primaryKey:f.primaryKey,key:f.key}),f.continue()):(s.next(o),s.complete())}}).catch(a=>s.error(a))})}count(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,l=>n.error(l));let c=k(o,v(w.readonly,t,n.error)).objectStore(t).count(e);c.onerror=l=>n.error(l),c.onsuccess=l=>{n.next(l.target.result),n.complete()}}).catch(o=>n.error(o))})}countByIndex(t,e,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{S(s,t,u=>o.error(u));let d=k(s,v(w.readonly,t,o.error)).objectStore(t).index(e).count(n);d.onerror=u=>o.error(u),d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(s=>o.error(s))})}deleteObjectStore(t){return an(this.dbConfig.name,++this.dbConfig.version,t)}}return r.\u0275fac=function(t){return new(t||r)(h(ct),h(L))},r.\u0275prov=E({token:r,factory:r.\u0275fac}),r})(),Er=(()=>{class r{static forRoot(t){return{ngModule:r,providers:[Ee,{provide:ct,useValue:t}]}}}return r.\u0275fac=function(t){return new(t||r)},r.\u0275mod=F({type:r}),r.\u0275inj=N({imports:[[je]]}),r})();var lt=(()=>{let i=class i{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,n){let o=this.getKey(n);return this.db.add(this.DATABASE,e,o).pipe(D(s=>e))}getCategoriesByChannelType(e){let n=this.getKey(e);return this.db.getByKey(this.DATABASE,n)}getKey(e){let n="";switch(e){case ce.Lazada:n="Lazada";break;case ce.Tokopedia:n="Tokopedia";break}return n}clearDatabase(){this.db.clear(this.DATABASE)}getHostName(){let e=localStorage.getItem("Authorization");return this.hostName=JSON.parse(e)?.Host,this.hostName}};i.\u0275fac=function(n){return new(n||i)(h(Ee))},i.\u0275prov=E({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})();var ut=(()=>{let i=class i{constructor(){}inititalizeIntercom(){let e=this.getFromLocalStorage();e?.Enabled&&window.Intercom("boot",{app_id:"xv1oomgl",name:e.Name,email:e.Email,created_at:e.Created,user_hash:e.Hash})}shutdown(){this.getFromLocalStorage()?.Enabled&&(window.Intercom("shutdown"),this.clearStorage())}clearStorage(){localStorage.removeItem("Intercom")}updateLocalStorage(e){e&&(e.Enabled=!0),localStorage.setItem("Intercom",JSON.stringify(e))}getFromLocalStorage(){let e=localStorage.getItem("Intercom");return JSON.parse(e)}hideLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!0}),e.hide_default_launcher=!0,this.updateLocalStorage(e))}showLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!1}),e.hide_default_launcher=!1,this.updateLocalStorage(e))}isHideLauncher(){let e=this.getFromLocalStorage();return z.IsEmpty(e?.hide_default_launcher)?!1:e?.hide_default_launcher}};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=E({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})();var Ai=(()=>{let i=class i{constructor(e,n,o,s,a,c,l){this.httpService=e,this.tokenDecodeService=n,this.afAuth=o,this.ngxPermission=s,this.localDataService=a,this.router=c,this.intercomService=l,this.channels=[]}login(e){return this.httpService.post("/api/token/Login",e).pipe(U(n=>{this.setLocalStorage(n,e.Host,e.Username),this.loadPermissions()}))}loginWithGoogle(e,n){e.preventDefault();let o=new he;return o.setCustomParameters({prompt:"select_account"}),x(this.afAuth.signInWithPopup(o)).pipe(D(s=>s.credential),D(s=>s.idToken),_(s=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:s,Host:n}))),U(s=>{this.setLocalStorage(s,n,null),this.loadPermissions()}))}setLocalStorage(e,n,o){localStorage.setItem("user",JSON.stringify(e)),localStorage.setItem("Authorization",JSON.stringify({Host:n,username:o})),localStorage.setItem("channels",JSON.stringify(e.Channels)),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem("user");if(z.IsNotEmpty(e)){let n=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(n)}}getChannels(){let e=JSON.parse(JSON.stringify(this.channels));if(this.channels.length===0){let n=localStorage.getItem("channels");n?(this.channels=JSON.parse(n),e=JSON.parse(JSON.stringify(this.channels))):(this.channels=[],e=[])}return e=this.setChannelLogo(e),e}setChannelLogo(e){return e=e.map(n=>(n.logo=z.getChannelLogoByTypeId(n.TypeID),n)),e}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=JSON.parse(window.localStorage.getItem("user")),n=new Date;if(e!=null){let o=new Date(e.Token.expiredAt);return n<o?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem("Authorization");this.domain="https://"+JSON.parse(e).Host}return this.domain}clearLocalStorage(){this.domain=null,this.channels=[],localStorage.removeItem("channels"),localStorage.removeItem("user"),this.intercomService.shutdown(),this.localDataService.clearDatabase(),this.router.navigate([""])}};i.\u0275fac=function(n){return new(n||i)(h(Be),h(Ne),h(be),h(Ue),h(lt),h(Fe),h(ut))},i.\u0275prov=E({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})();export{Pn as a,gr as b,Er as c,lt as d,Ai as e};
|