mergn-webapp-sdk 1.0.0
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/README.md +68 -0
- package/dist/index.d.mts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/package.json +55 -0
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Mergn Web SDK
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
[](https://www.npmjs.com/package/mergn-web-sdk)
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
Mergn Web SDK is available as an npm package.
|
|
9
|
+
|
|
10
|
+
### Use a package manager
|
|
11
|
+
|
|
12
|
+
`npm install mergn-web-sdk --save`
|
|
13
|
+
|
|
14
|
+
## Initialization
|
|
15
|
+
|
|
16
|
+
#### Add your Mergn account credentials
|
|
17
|
+
|
|
18
|
+
```javascript
|
|
19
|
+
import mergn from 'mergn-web-sdk';
|
|
20
|
+
|
|
21
|
+
mergn.init('Api_Key'); // Replace with values applicable to you. Refer below
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`Api_Key` (mandatory): This value is given by Mergn Team.
|
|
25
|
+
|
|
26
|
+
### Event Record
|
|
27
|
+
|
|
28
|
+
Events monitor specific user actions within your app or website, such as app launch, product view, song play, photo share, purchase, or item favoring.
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
// event without properties
|
|
32
|
+
mergn.recordEvent('Product viewed');
|
|
33
|
+
|
|
34
|
+
// event with properties
|
|
35
|
+
mergn.recordEvent('Product viewed', [{ eventProperty: 'Mens Accessories', value: 59.99 }]);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### User Login
|
|
39
|
+
|
|
40
|
+
Use this method where user is logged in successfully to record login event.
|
|
41
|
+
|
|
42
|
+
```javascript
|
|
43
|
+
mergn.login('Unique_Identity');
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`Unique_Identity` (mandatory): This value is the customer's unique identity in your database like `Id` or `Email`.
|
|
47
|
+
|
|
48
|
+
### User Logout
|
|
49
|
+
|
|
50
|
+
Use this method where user is logged out successfully to record logout event.
|
|
51
|
+
|
|
52
|
+
```javascript
|
|
53
|
+
mergn.logout();
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Offline Mode
|
|
57
|
+
|
|
58
|
+
`mergn-web-sdk` automatically queue events in case of internet disruption, and sends them once internet is restored while the user is on the website
|
|
59
|
+
|
|
60
|
+
max event queue limit is 50, after which events are ignored
|
|
61
|
+
|
|
62
|
+
### Debugging
|
|
63
|
+
|
|
64
|
+
To show logs while debugging
|
|
65
|
+
|
|
66
|
+
```javascript
|
|
67
|
+
mergn.showErrorLog(Boolean);
|
|
68
|
+
```
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare class MergnService {
|
|
2
|
+
#private;
|
|
3
|
+
private constructor();
|
|
4
|
+
static getInstance(): MergnService;
|
|
5
|
+
init(apiKey: string): void;
|
|
6
|
+
showErrorLog(showErrorLog?: boolean): void;
|
|
7
|
+
recordAttribute(data: Record<string, any>): Promise<void>;
|
|
8
|
+
login(identity: string): Promise<void>;
|
|
9
|
+
updateAttribute(attributeName: string, attributeValue: string, data?: Record<string, any>): Promise<void>;
|
|
10
|
+
logout(): Promise<void>;
|
|
11
|
+
recordEvent(eventName: string, eventProperties?: [{
|
|
12
|
+
eventProperty: string;
|
|
13
|
+
value: any;
|
|
14
|
+
}]): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: MergnService;
|
|
17
|
+
|
|
18
|
+
export { _default as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare class MergnService {
|
|
2
|
+
#private;
|
|
3
|
+
private constructor();
|
|
4
|
+
static getInstance(): MergnService;
|
|
5
|
+
init(apiKey: string): void;
|
|
6
|
+
showErrorLog(showErrorLog?: boolean): void;
|
|
7
|
+
recordAttribute(data: Record<string, any>): Promise<void>;
|
|
8
|
+
login(identity: string): Promise<void>;
|
|
9
|
+
updateAttribute(attributeName: string, attributeValue: string, data?: Record<string, any>): Promise<void>;
|
|
10
|
+
logout(): Promise<void>;
|
|
11
|
+
recordEvent(eventName: string, eventProperties?: [{
|
|
12
|
+
eventProperty: string;
|
|
13
|
+
value: any;
|
|
14
|
+
}]): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: MergnService;
|
|
17
|
+
|
|
18
|
+
export { _default as default };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const _0x273a96=_0x3444;(function(_0xfa722d,_0x37240d){const _0x3add77=_0x3444,_0x43d706=_0xfa722d();while(!![]){try{const _0x4bff3e=parseInt(_0x3add77(0x187))/0x1+parseInt(_0x3add77(0x18a))/0x2+parseInt(_0x3add77(0x1c1))/0x3+-parseInt(_0x3add77(0x191))/0x4*(parseInt(_0x3add77(0x1c5))/0x5)+parseInt(_0x3add77(0x179))/0x6+-parseInt(_0x3add77(0x1d2))/0x7*(parseInt(_0x3add77(0x1bf))/0x8)+-parseInt(_0x3add77(0x1b1))/0x9*(parseInt(_0x3add77(0x19b))/0xa);if(_0x4bff3e===_0x37240d)break;else _0x43d706['push'](_0x43d706['shift']());}catch(_0x1d3e04){_0x43d706['push'](_0x43d706['shift']());}}}(_0x1d54,0x32212));var ue=Object[_0x273a96(0x1e1)],b=Object[_0x273a96(0x1b7)],de=Object[_0x273a96(0x1ac)],pe=Object['getOwnPropertyDescriptor'],ge=Object['getOwnPropertyDescriptors'],Ee=Object[_0x273a96(0x1aa)],Nt=Object[_0x273a96(0x1a6)],he=Object[_0x273a96(0x1c2)],xt=Object[_0x273a96(0x1e4)][_0x273a96(0x196)],me=Object[_0x273a96(0x1e4)][_0x273a96(0x178)],Lt=(_0x692c57,_0x5033e0,_0x429e72)=>_0x5033e0 in _0x692c57?b(_0x692c57,_0x5033e0,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x429e72}):_0x692c57[_0x5033e0]=_0x429e72,pt=(_0x41cf84,_0x360662)=>{const _0x5a2ec4=_0x273a96;for(var _0x3ecb62 in _0x360662||(_0x360662={}))xt[_0x5a2ec4(0x17a)](_0x360662,_0x3ecb62)&&Lt(_0x41cf84,_0x3ecb62,_0x360662[_0x3ecb62]);if(Nt){for(var _0x3ecb62 of Nt(_0x360662))me['call'](_0x360662,_0x3ecb62)&&Lt(_0x41cf84,_0x3ecb62,_0x360662[_0x3ecb62]);}return _0x41cf84;},gt=(_0x121e0e,_0x21c9aa)=>de(_0x121e0e,ge(_0x21c9aa)),ye=(_0x4446b8,_0x29b92e)=>{for(var _0x5c75d6 in _0x29b92e)b(_0x4446b8,_0x5c75d6,{'get':_0x29b92e[_0x5c75d6],'enumerable':!0x0});},Dt=(_0x1dbf41,_0x2b8938,_0x267632,_0x76c42)=>{const _0x51d73f=_0x273a96;if(_0x2b8938&&typeof _0x2b8938==_0x51d73f(0x199)||typeof _0x2b8938=='function'){for(let _0x1f1b97 of Ee(_0x2b8938))!xt['call'](_0x1dbf41,_0x1f1b97)&&_0x1f1b97!==_0x267632&&b(_0x1dbf41,_0x1f1b97,{'get':()=>_0x2b8938[_0x1f1b97],'enumerable':!(_0x76c42=pe(_0x2b8938,_0x1f1b97))||_0x76c42['enumerable']});}return _0x1dbf41;},_t=(_0x435484,_0x2c278b,_0xfee4d8)=>(_0xfee4d8=_0x435484!=null?ue(he(_0x435484)):{},Dt(_0x2c278b||!_0x435484||!_0x435484['__esModule']?b(_0xfee4d8,_0x273a96(0x1c0),{'value':_0x435484,'enumerable':!0x0}):_0xfee4d8,_0x435484)),ve=_0x1ccb6e=>Dt(b({},'__esModule',{'value':!0x0}),_0x1ccb6e),Et=(_0x1a8f01,_0x2fd371,_0x3e8a58)=>{const _0x2fc1a5=_0x273a96;if(!_0x2fd371[_0x2fc1a5(0x185)](_0x1a8f01))throw TypeError('Cannot\x20'+_0x3e8a58);},u=(_0xadb66,_0x5ef72e,_0x5804ee)=>(Et(_0xadb66,_0x5ef72e,'read\x20from\x20private\x20field'),_0x5804ee?_0x5804ee[_0x273a96(0x17a)](_0xadb66):_0x5ef72e[_0x273a96(0x1a8)](_0xadb66)),i=(_0xc144f4,_0x4b9f3d,_0x25811f)=>{const _0x51da21=_0x273a96;if(_0x4b9f3d['has'](_0xc144f4))throw TypeError(_0x51da21(0x177));_0x4b9f3d instanceof WeakSet?_0x4b9f3d['add'](_0xc144f4):_0x4b9f3d[_0x51da21(0x1ea)](_0xc144f4,_0x25811f);},E=(_0x29d6f3,_0x20ab3c,_0x1e5b6b,_0x16ed23)=>(Et(_0x29d6f3,_0x20ab3c,_0x273a96(0x17c)),_0x16ed23?_0x16ed23[_0x273a96(0x17a)](_0x29d6f3,_0x1e5b6b):_0x20ab3c[_0x273a96(0x1ea)](_0x29d6f3,_0x1e5b6b),_0x1e5b6b),Ct=(_0x59e76c,_0x5d798e,_0x422b6e,_0x41e8ae)=>({set '_'(_0x4ea716){E(_0x59e76c,_0x5d798e,_0x4ea716,_0x422b6e);},get '_'(){return u(_0x59e76c,_0x5d798e,_0x41e8ae);}}),n=(_0x231baf,_0x433595,_0x1bb9ab)=>(Et(_0x231baf,_0x433595,_0x273a96(0x1bd)),_0x1bb9ab),a=(_0x5d217a,_0x57da2c,_0x4c7f13)=>new Promise((_0x36f782,_0x344c79)=>{const _0x23492f=_0x273a96;var _0x130024=_0x51f4a6=>{const _0x18ad0b=_0x3444;try{_0x18470d(_0x4c7f13[_0x18ad0b(0x1a5)](_0x51f4a6));}catch(_0x14bd92){_0x344c79(_0x14bd92);}},_0x5088c5=_0xdb65a5=>{const _0x32aeac=_0x3444;try{_0x18470d(_0x4c7f13[_0x32aeac(0x1f8)](_0xdb65a5));}catch(_0x5f3291){_0x344c79(_0x5f3291);}},_0x18470d=_0x1eef90=>_0x1eef90[_0x23492f(0x195)]?_0x36f782(_0x1eef90['value']):Promise[_0x23492f(0x1c8)](_0x1eef90[_0x23492f(0x181)])['then'](_0x130024,_0x5088c5);_0x18470d((_0x4c7f13=_0x4c7f13[_0x23492f(0x1d0)](_0x5d217a,_0x57da2c))['next']());}),fe={};ye(fe,{'default':()=>Te}),module['exports']=ve(fe);var vt=require('uuid'),$t='https://95sidwa5jk.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api',ht=_0x273a96(0x1f0),Vt='/record-attribute',Q='/event',Bt='/record-event',Ft=_0x273a96(0x18e),Mt=_0x273a96(0x18f),kt=_0x273a96(0x1da),Qt=_t(require('axios')),jt=require('axios-queue-js'),qt=_t(require('axios-retry')),Jt=require('axios'),c=class extends Error{constructor(_0x44ca74){const _0x2d4e28=_0x273a96;super(_0x44ca74),this['name']=_0x2d4e28(0x1bb);}};c[_0x273a96(0x188)]=!0x1,c[_0x273a96(0x1de)]=!navigator['onLine'],c[_0x273a96(0x1ae)]=!0x1,c[_0x273a96(0x1cc)]=!0x1;var Ie=(_0x191cc6,_0x48c0c3)=>{const _0x5cb978=_0x273a96;_0x48c0c3 instanceof c?console[_0x5cb978(0x1b8)](_0x5cb978(0x198)+_0x191cc6,'MergnError:\x20'+_0x48c0c3[_0x5cb978(0x1eb)]):_0x48c0c3 instanceof Jt['AxiosError']?(console[_0x5cb978(0x1b8)](_0x5cb978(0x198)+_0x191cc6,_0x5cb978(0x1b3)+_0x48c0c3[_0x5cb978(0x1eb)]),_0x48c0c3[_0x5cb978(0x1b0)]?(console[_0x5cb978(0x1b8)](_0x5cb978(0x198)+_0x191cc6,_0x5cb978(0x190)+_0x48c0c3['response'][_0x5cb978(0x1ad)]),console[_0x5cb978(0x1b8)](_0x5cb978(0x198)+_0x191cc6,_0x5cb978(0x1d4),_0x48c0c3['response'][_0x5cb978(0x197)])):_0x48c0c3[_0x5cb978(0x1a2)]?console['error']('OriginateFrom:\x20'+_0x191cc6+_0x5cb978(0x1ba)):console[_0x5cb978(0x1b8)]('OriginateFrom:\x20'+_0x191cc6,_0x5cb978(0x174),_0x48c0c3[_0x5cb978(0x1eb)])):_0x48c0c3 instanceof Error?console['error'](_0x5cb978(0x198)+_0x191cc6,_0x5cb978(0x176),_0x48c0c3[_0x5cb978(0x1eb)]):console[_0x5cb978(0x1b8)](_0x5cb978(0x198)+_0x191cc6,_0x5cb978(0x176),String(_0x48c0c3));},f=(_0x1f8c69,_0x366442,_0x1b8b01)=>a(void 0x0,null,function*(){const _0x44d62a=_0x273a96;try{if(c[_0x44d62a(0x188)])throw new c(_0x44d62a(0x1c4));if(_0x1f8c69!=='add'&&c[_0x44d62a(0x1de)])throw new c(_0x44d62a(0x1ef));if(_0x1f8c69!==_0x44d62a(0x175)&&!c[_0x44d62a(0x1cc)])throw new c(_0x44d62a(0x1ff));return yield _0x366442();}catch(_0x107fba){return _0x1b8b01?_0x1b8b01(_0x107fba):c['showErrorLog']&&Ie(_0x1f8c69,_0x107fba),null;}}),I,R,P,A,j,U,yt,q,zt,d=class d{constructor(){const _0x3bf165=_0x273a96;i(this,j,0x0);let _0x5c516a=Qt[_0x3bf165(0x1c0)][_0x3bf165(0x1e1)]({'baseURL':$t,'headers':{'Content-Type':'application/json'}});E(d,R,_0x5c516a),E(d,P,new jt[(_0x3bf165(0x19a))]({'client':_0x5c516a,'queueSize':0xa})),(0x0,qt[_0x3bf165(0x1c0)])(_0x5c516a,{'onRetry':_0x2121ea=>{const _0x29c539=_0x3bf165;_0x2121ea>=u(d,A)?(c['showErrorLog']&&console[_0x29c539(0x1fc)](_0x29c539(0x1f7)),c['disableSDK']=!0x0):Ct(this,j)['_']++;},'retries':u(d,A),'retryDelay':_0x161e4d=>_0x161e4d*0x1388});}static[_0x273a96(0x1e8)](_0xfb4040){const _0x56905a=_0x273a96;this[_0x56905a(0x1c6)]=_0xfb4040,n(this,q,zt)[_0x56905a(0x17a)](this)[_0x56905a(0x1d6)][_0x56905a(0x1db)][_0x56905a(0x1e7)]['Authorization']=_0xfb4040;}static[_0x273a96(0x1a8)](_0xe8d915){const _0x1f1de5=_0x273a96;return n(this,U,yt)[_0x1f1de5(0x17a)](this)[_0x1f1de5(0x1a8)](_0xe8d915);}static['post'](_0x3e7411,_0x5007bb){const _0x1d206b=_0x273a96;return n(this,U,yt)['call'](this)[_0x1d206b(0x1f6)](_0x3e7411,_0x5007bb||{});}};I=new WeakMap(),R=new WeakMap(),P=new WeakMap(),A=new WeakMap(),j=new WeakMap(),U=new WeakSet(),yt=function(){return u(d,I)||E(d,I,new d()),u(d,P);},q=new WeakSet(),zt=function(){return u(d,I)||E(d,I,new d()),u(d,R);},i(d,U),i(d,q),i(d,I,void 0x0),i(d,R,void 0x0),i(d,P,void 0x0),i(d,A,0x3);function _0x3444(_0x2b4af7,_0x2db0b3){const _0x1d5456=_0x1d54();return _0x3444=function(_0x344455,_0x261165){_0x344455=_0x344455-0x174;let _0x1aecbb=_0x1d5456[_0x344455];return _0x1aecbb;},_0x3444(_0x2b4af7,_0x2db0b3);}var mt=d,y=mt,S,v,O,N,L,x,D,Tt,_,ft,K,Kt,Y,Yt,H,Ht,W,C,G,X,Wt,Z,Gt,tt,Xt,$,St,et,Zt,w,z,rt,te,V,wt,ot,ee,it,re,B,bt,nt,oe,st,ie,at,ne,F,Rt,ct,se,lt,ae,ut,ce,M,Pt,k,At,J,Ut,T=class T{constructor(){const _0x40e711=_0x273a96;i(this,D),i(this,_),i(this,K),i(this,Y),i(this,H),i(this,X),i(this,Z),i(this,tt),i(this,$),i(this,et),i(this,w),i(this,rt),i(this,V),i(this,ot),i(this,it),i(this,B),i(this,nt),i(this,st),i(this,at),i(this,F),i(this,ct),i(this,lt),i(this,ut),i(this,M),i(this,k),i(this,J),i(this,v,''),i(this,O,void 0x0),i(this,N,void 0x0),i(this,L,void 0x0),i(this,x,null),i(this,W,()=>{const _0x4a252c=_0x3444;let _0x179241=()=>{const _0xd7612e=_0x3444;let _0x13cd26=JSON[_0xd7612e(0x1ee)](localStorage['getItem'](_0xd7612e(0x1d9)));_0x13cd26&&localStorage[_0xd7612e(0x1e2)](_0xd7612e(0x1d9),JSON[_0xd7612e(0x1e9)](gt(pt({},_0x13cd26),{'initialTime':''+new Date()[_0xd7612e(0x19f)](),'page':window[_0xd7612e(0x17f)][_0xd7612e(0x1f4)]+window[_0xd7612e(0x17f)][_0xd7612e(0x1ed)]})));};_0x179241(),window['addEventListener'](_0x4a252c(0x202),_0x179241);}),i(this,C,()=>{const _0x34b51e=_0x3444;localStorage[_0x34b51e(0x192)](_0x34b51e(0x1d9));}),i(this,G,()=>{const _0x4f7f9b=_0x3444;let _0x2f8d2c=JSON[_0x4f7f9b(0x1ee)](localStorage[_0x4f7f9b(0x1f9)](_0x4f7f9b(0x1d9))||'{}');(_0x2f8d2c==null?void 0x0:_0x2f8d2c[_0x4f7f9b(0x1fb)])===_0x4f7f9b(0x1a1)&&n(this,V,wt)[_0x4f7f9b(0x17a)](this);}),E(this,L,navigator[_0x40e711(0x1f3)]);}static[_0x273a96(0x1a3)](){return u(T,S)||E(T,S,new T()),u(T,S);}['init'](_0x46c615){const _0x53bbb=_0x273a96;f(_0x53bbb(0x175),()=>a(this,null,function*(){const _0x2432bc=_0x53bbb;n(this,K,Kt)[_0x2432bc(0x17a)](this,_0x46c615),yield n(this,D,Tt)[_0x2432bc(0x17a)](this),setInterval(()=>a(this,null,function*(){yield n(this,D,Tt)['call'](this);}),0x493e0);let _0x3dcf48=localStorage[_0x2432bc(0x1f9)](_0x2432bc(0x1b5)),_0x173eac=!0x1;_0x3dcf48&&(_0x173eac=new Date()[_0x2432bc(0x19f)]()-parseInt(_0x3dcf48,0xa)>0x1b7740,_0x173eac&&n(this,M,Pt)[_0x2432bc(0x17a)](this)),(!_0x3dcf48||_0x173eac||n(this,Y,Yt)['call'](this))&&(n(this,X,Wt)['call'](this),yield n(this,w,z)['call'](this),yield n(this,H,Ht)[_0x2432bc(0x17a)](this)),window[_0x2432bc(0x18c)](_0x2432bc(0x1a4),()=>a(this,null,function*(){const _0xcdda0d=_0x2432bc;c['offline']=!0x1;let _0x140119=JSON['parse'](localStorage[_0xcdda0d(0x1f9)](_0xcdda0d(0x17b))||'[]');Array[_0xcdda0d(0x180)](_0x140119)&&(yield y[_0xcdda0d(0x1f6)](''+Q+Ft,[{'customerId':u(this,v),'events':_0x140119}]),localStorage[_0xcdda0d(0x192)]('offlineEvents'));})),window[_0x2432bc(0x18c)]('offline',()=>{const _0x447963=_0x2432bc;c[_0x447963(0x1de)]=!0x0;}),window['addEventListener']('load',()=>{u(this,G)['call'](this);}),c[_0x2432bc(0x1cc)]=!0x0;let _0x5b3e03=history['pushState'];history['pushState']=(..._0x5ec718)=>{const _0x47a18c=_0x2432bc;_0x5b3e03[_0x47a18c(0x1d0)](history,_0x5ec718),n(this,_,ft)['call'](this);},n(this,_,ft)[_0x2432bc(0x17a)](this);}));}[_0x273a96(0x1ae)](_0x181966=!0x1){const _0x453933=_0x273a96;c[_0x453933(0x1ae)]=_0x181966;}[_0x273a96(0x1b2)](_0x17b468){return a(this,null,function*(){const _0x486331=_0x3444;yield f(_0x486331(0x1b2),()=>a(this,null,function*(){const _0x2b7358=_0x486331;yield n(this,k,At)[_0x2b7358(0x17a)](this);let _0x496d5c=JSON[_0x2b7358(0x1ee)](localStorage[_0x2b7358(0x1f9)](_0x2b7358(0x1af))||'{}');if(_0x496d5c&&Object[_0x2b7358(0x1bc)](_0x496d5c)['length']>0x0){let _0x32ccb4=[];_0x17b468&&Object[_0x2b7358(0x1bc)](_0x17b468)[_0x2b7358(0x1d7)]>0x0&&Object[_0x2b7358(0x1bc)](_0x17b468)[_0x2b7358(0x182)](_0x1a9d5c=>{const _0x1455cf=_0x2b7358;_0x496d5c[_0x1455cf(0x196)](_0x1a9d5c)&&_0x32ccb4[_0x1455cf(0x1f1)]({'attributeId':_0x496d5c[_0x1a9d5c]['id'],'attributeProperties':[],'value':_0x17b468[_0x1a9d5c]});});let _0x434c0d=[{'attributes':_0x32ccb4,'customerId':u(this,v)}];yield n(this,J,Ut)[_0x2b7358(0x17a)](this,_0x434c0d);}}));});}[_0x273a96(0x1a0)](_0x56338f){return a(this,null,function*(){const _0x3fb1a0=_0x3444;yield f(_0x3fb1a0(0x1a0),()=>a(this,null,function*(){const _0x53d707=_0x3fb1a0;yield n(this,w,z)[_0x53d707(0x17a)](this,_0x56338f),yield this[_0x53d707(0x18d)](_0x53d707(0x189),[{'eventProperty':_0x53d707(0x1e0),'value':localStorage[_0x53d707(0x1f9)](_0x53d707(0x1c3))||0x0}]);}));});}[_0x273a96(0x1e3)](_0x2f1ac8,_0x4584b5,_0x1b8ddb){return a(this,null,function*(){const _0x3a9681=_0x3444;yield n(this,k,At)[_0x3a9681(0x17a)](this);let _0x302937=JSON['parse'](localStorage[_0x3a9681(0x1f9)](_0x3a9681(0x1af))||'{}');if(_0x302937&&Object[_0x3a9681(0x1bc)](_0x302937)[_0x3a9681(0x1d7)]>0x0&&_0x302937[_0x3a9681(0x196)](_0x2f1ac8)){let _0x38de4a=_0x302937[_0x2f1ac8],_0x5f123=_0x38de4a[_0x3a9681(0x1e6)],_0x1f5e24=[];_0x1b8ddb&&Object[_0x3a9681(0x1bc)](_0x1b8ddb)[_0x3a9681(0x1d7)]>0x0&&Object[_0x3a9681(0x1bc)](_0x1b8ddb)['forEach'](_0x4fd938=>{const _0xfdc05d=_0x3a9681;_0x5f123[_0xfdc05d(0x196)](_0x4fd938)&&_0x1f5e24[_0xfdc05d(0x1f1)]({'attributePropertyId':_0x5f123[_0x4fd938]['id'],'value':_0x1b8ddb[_0x4fd938]});});let _0x609e78=[{'attributes':[{'attributeId':_0x38de4a['id'],'attributeProperties':_0x1f5e24,'value':_0x4584b5}],'customerId':u(this,v)}];yield n(this,J,Ut)[_0x3a9681(0x17a)](this,_0x609e78);}});}[_0x273a96(0x1cb)](){return a(this,null,function*(){const _0x650ae9=_0x3444;yield f(_0x650ae9(0x1cb),()=>a(this,null,function*(){const _0x36b02d=_0x650ae9;n(this,M,Pt)[_0x36b02d(0x17a)](this),this[_0x36b02d(0x18d)](_0x36b02d(0x1ab),[{'eventProperty':_0x36b02d(0x1e0),'value':localStorage[_0x36b02d(0x1f9)](_0x36b02d(0x1c3))||0x0}]);}));});}[_0x273a96(0x18d)](_0x269333,_0x3df6dd){return a(this,null,function*(){const _0x108efe=_0x3444;yield f(_0x108efe(0x1b9),()=>a(this,null,function*(){const _0x12a58c=_0x108efe;var _0x4b91f8,_0x55793a;let _0x3930c6=n(this,st,ie)[_0x12a58c(0x17a)](this),_0x44f443=n(this,at,ne)['call'](this,_0x3930c6,_0x269333,_0x3df6dd);if(typeof _0x44f443=='string'){c[_0x12a58c(0x1ae)]&&console['error'](_0x44f443);return;}let {id:_0x3498d1}=_0x3930c6[_0x269333];if(c[_0x12a58c(0x1de)]){let _0x43d0ec=JSON['parse'](localStorage[_0x12a58c(0x1f9)](_0x12a58c(0x17b))||'[]');if(_0x43d0ec[_0x12a58c(0x1d7)]<=0x32){let _0x1692ca={'eventId':_0x3498d1};_0x3df6dd&&(_0x1692ca[_0x12a58c(0x1a9)]=_0x44f443),_0x43d0ec['push'](_0x1692ca),localStorage['setItem'](_0x12a58c(0x17b),JSON[_0x12a58c(0x1e9)](_0x43d0ec));}return;}let _0x4c9fae=_0x3df6dd?n(this,F,Rt)[_0x12a58c(0x17a)](this,_0x3498d1,_0x44f443):n(this,F,Rt)[_0x12a58c(0x17a)](this,_0x3498d1),_0x1c1b5f=yield n(this,ct,se)[_0x12a58c(0x17a)](this,_0x4c9fae);n(this,lt,ae)[_0x12a58c(0x17a)](this,(_0x4b91f8=_0x1c1b5f==null?void 0x0:_0x1c1b5f[_0x12a58c(0x197)])==null?void 0x0:_0x4b91f8['data'])&&(n(this,ut,ce)[_0x12a58c(0x17a)](this,(_0x55793a=_0x1c1b5f==null?void 0x0:_0x1c1b5f[_0x12a58c(0x197)])==null?void 0x0:_0x55793a[_0x12a58c(0x197)]),u(this,W)[_0x12a58c(0x17a)](this),n(this,V,wt)['call'](this));}));});}};S=new WeakMap(),v=new WeakMap(),O=new WeakMap(),N=new WeakMap(),L=new WeakMap(),x=new WeakMap(),D=new WeakSet(),Tt=function(){return a(this,null,function*(){const _0x3fe78f=_0x3444;try{yield y[_0x3fe78f(0x1a8)](_0x3fe78f(0x1fe));}catch(_0x2620d7){c[_0x3fe78f(0x188)]=!0x0,c['showErrorLog']&&console[_0x3fe78f(0x1b8)](_0x2620d7[_0x3fe78f(0x1eb)]);}});},_=new WeakSet(),ft=function(){return a(this,null,function*(){const _0x4caeea=_0x3444;let _0x3646ee=window[_0x4caeea(0x17f)][_0x4caeea(0x1f4)]+window['location'][_0x4caeea(0x1ed)];yield this[_0x4caeea(0x18d)]('Viewed\x20Web\x20Page',[{'eventProperty':_0x4caeea(0x1c7),'value':_0x3646ee}]),_0x3646ee!==u(this,x)&&(E(this,x,_0x3646ee),new URLSearchParams(new URL(window[_0x4caeea(0x17f)][_0x4caeea(0x1b6)])[_0x4caeea(0x1be)])[_0x4caeea(0x182)]((_0x8472ac,_0x33e2f0)=>a(this,null,function*(){const _0x76c342=_0x4caeea;yield this[_0x76c342(0x18d)]('Viewed\x20Web\x20Page',[{'eventProperty':_0x76c342(0x19c),'value':_0x33e2f0+':'+_0x8472ac}]);})));});},K=new WeakSet(),Kt=function(_0x12192e){const _0x179d73=_0x273a96;y[_0x179d73(0x1e8)](_0x12192e);},Y=new WeakSet(),Yt=function(){const _0x12f319=_0x273a96;return!localStorage[_0x12f319(0x1f9)](_0x12f319(0x17d))||!localStorage['getItem'](_0x12f319(0x1c3))||!localStorage[_0x12f319(0x1f9)]('attributes')||!localStorage['getItem'](_0x12f319(0x183));},H=new WeakSet(),Ht=function(){return a(this,null,function*(){const _0x28b451=_0x3444;yield n(this,Z,Gt)[_0x28b451(0x17a)](this),yield n(this,$,St)[_0x28b451(0x17a)](this),yield n(this,w,z)[_0x28b451(0x17a)](this);});},W=new WeakMap(),C=new WeakMap(),G=new WeakMap(),X=new WeakSet(),Wt=function(){const _0xe03177=_0x273a96;let _0xa7fe7d=localStorage[_0xe03177(0x1f9)](_0xe03177(0x183));return _0xa7fe7d||(_0xa7fe7d=(0x0,vt['v4'])(),localStorage[_0xe03177(0x1e2)]('uniqueIdentity',_0xa7fe7d)),_0xa7fe7d;},Z=new WeakSet(),Gt=function(){return a(this,null,function*(){const _0x28bf70=_0x3444;if(!localStorage[_0x28bf70(0x1f9)]('events')){let _0x407d9f=(yield n(this,tt,Xt)[_0x28bf70(0x17a)](this))[_0x28bf70(0x197)];_0x407d9f&&(E(this,O,_0x407d9f),localStorage[_0x28bf70(0x1e2)]('events',JSON[_0x28bf70(0x1e9)](u(this,O))));}});},tt=new WeakSet(),Xt=function(){return a(this,null,function*(){const _0x1fe9c5=_0x3444;try{return(yield y['get'](''+Q))[_0x1fe9c5(0x197)];}catch(_0x4fefb3){throw new Error(_0x1fe9c5(0x1df));}});},$=new WeakSet(),St=function(){return a(this,null,function*(){const _0x552dd2=_0x3444;if(!localStorage[_0x552dd2(0x1f9)]('attributes')){let _0x54fbaa=(yield n(this,et,Zt)[_0x552dd2(0x17a)](this))['data'];_0x54fbaa&&(E(this,N,_0x54fbaa),localStorage[_0x552dd2(0x1e2)](_0x552dd2(0x1af),JSON[_0x552dd2(0x1e9)](u(this,N))));}});},et=new WeakSet(),Zt=function(){return a(this,null,function*(){const _0x3d4f8b=_0x3444;try{return(yield y[_0x3d4f8b(0x1a8)](''+ht))[_0x3d4f8b(0x197)];}catch(_0x2cf647){throw new Error(_0x3d4f8b(0x193));}});},w=new WeakSet(),z=function(_0x2f11ef){return a(this,null,function*(){const _0x2256d9=_0x3444;if(!_0x2f11ef){let _0x3d590d=localStorage['getItem'](_0x2256d9(0x1c3));if(_0x3d590d){E(this,v,_0x3d590d);return;}}let _0x48b97c={'deviceId':localStorage[_0x2256d9(0x1f9)]('uniqueIdentity')||(0x0,vt['v4'])(),'os':u(this,L)};_0x2f11ef&&(_0x48b97c[_0x2256d9(0x19e)]=_0x2f11ef);try{let _0x3bb7af=(yield n(this,rt,te)[_0x2256d9(0x17a)](this,_0x48b97c))[_0x2256d9(0x197)];_0x3bb7af!==void 0x0&&(E(this,v,_0x3bb7af),localStorage[_0x2256d9(0x1e2)](_0x2256d9(0x1c3),u(this,v)));}catch(_0x3b0bc1){throw new Error(_0x2256d9(0x1fd));}});},rt=new WeakSet(),te=function(_0x3ff42c){return a(this,null,function*(){const _0x5e0f3f=_0x3444;try{return(yield y[_0x5e0f3f(0x1f6)](''+Mt+kt,_0x3ff42c))['data'];}catch(_0x4a955a){throw new Error('Error\x20posting\x20identity\x20data');}});},V=new WeakSet(),wt=function(){const _0x2dfbca=_0x273a96;let _0x809d27=n(this,ot,ee)[_0x2dfbca(0x17a)](this);if(_0x809d27){let _0x775187=_0x809d27[_0x2dfbca(0x1cd)],_0x5a2c70=_0x809d27[_0x2dfbca(0x1d1)];_0x809d27[_0x2dfbca(0x1ca)]?n(this,it,re)[_0x2dfbca(0x17a)](this,_0x809d27,_0x775187,_0x5a2c70):n(this,B,bt)['call'](this,_0x775187,_0x5a2c70);}},ot=new WeakSet(),ee=function(){const _0x207d44=_0x273a96;let _0x20f5df=localStorage[_0x207d44(0x1f9)](_0x207d44(0x1d9));return _0x20f5df?JSON[_0x207d44(0x1ee)](_0x20f5df):null;},it=new WeakSet(),re=function(_0x93f4a0,_0x386444,_0x11bf9b){const _0x57bbc9=_0x273a96;let _0xffa699=parseInt(_0x93f4a0[_0x57bbc9(0x1e5)],0xa)+_0x93f4a0[_0x57bbc9(0x1ca)]-new Date()['getTime']();_0xffa699>0x0&&_0x93f4a0[_0x57bbc9(0x1a7)]===window['location'][_0x57bbc9(0x1f4)]+window[_0x57bbc9(0x17f)][_0x57bbc9(0x1ed)]&&setTimeout(()=>{const _0x5efaf4=_0x57bbc9;u(this,C)['call'](this),n(this,B,bt)[_0x5efaf4(0x17a)](this,_0x386444,_0x11bf9b);},_0xffa699);},B=new WeakSet(),bt=function(_0x499412,_0x7205a7){const _0xad7765=_0x273a96;let _0x406850=n(this,nt,oe)[_0xad7765(0x17a)](this,_0xad7765(0x1f2),_0x499412,_0x7205a7);document[_0xad7765(0x1dc)][_0xad7765(0x1cf)](_0x406850),u(this,C)[_0xad7765(0x17a)](this);},nt=new WeakSet(),oe=function(_0x1c4d8a,_0x3fd1aa,_0x4b5c9a){const _0x27a869=_0x273a96;var _0x28131a;let _0x2b1029=document[_0x27a869(0x1ec)](_0x1c4d8a);return _0x2b1029['id']='popup_container_'+_0x4b5c9a,_0x2b1029[_0x27a869(0x18b)]=_0x3fd1aa,(_0x28131a=_0x2b1029[_0x27a869(0x1d8)](_0x27a869(0x19d)))==null||_0x28131a[_0x27a869(0x18c)](_0x27a869(0x1dd),()=>a(this,null,function*(){const _0x45fbd9=_0x27a869;_0x2b1029[_0x45fbd9(0x1f5)](),yield this[_0x45fbd9(0x18d)](_0x45fbd9(0x1ce),[{'eventProperty':'Campaign\x20Id','value':_0x4b5c9a}]);})),_0x2b1029[_0x27a869(0x184)](_0x27a869(0x201))['forEach'](_0x1863c3=>{_0x1863c3['addEventListener']('click',()=>a(this,null,function*(){const _0x1c548d=_0x3444;yield this['recordEvent']('Popup\x20Button\x20Clicked',[{'eventProperty':_0x1c548d(0x200),'value':_0x4b5c9a}]);}));}),_0x2b1029[_0x27a869(0x184)](_0x27a869(0x17e))['forEach'](_0x1453b9=>{const _0x5d81a6=_0x27a869;_0x1453b9[_0x5d81a6(0x18c)](_0x5d81a6(0x1dd),()=>a(this,null,function*(){const _0x5001e4=_0x5d81a6;yield this[_0x5001e4(0x18d)](_0x5001e4(0x194),[{'eventProperty':'Campaign\x20Id','value':_0x4b5c9a}]);}));}),_0x2b1029;},st=new WeakSet(),ie=function(){const _0x236668=_0x273a96;let _0x41e223=localStorage['getItem']('events');return _0x41e223?JSON[_0x236668(0x1ee)](_0x41e223):{};},at=new WeakSet(),ne=function(_0x380f7b,_0x4fad9e,_0x556ac6){const _0x81726b=_0x273a96;if(!_0x380f7b[_0x81726b(0x196)](_0x4fad9e))return'Event\x20'+_0x4fad9e+'\x20is\x20not\x20valid.';if(!_0x556ac6)return[];let _0x355456=_0x380f7b[_0x4fad9e];if(!(_0x355456!=null&&_0x355456['eventProperty']))return _0x81726b(0x186)+_0x4fad9e+'\x20does\x20not\x20have\x20a\x20valid\x20eventProperty.';let _0x4b6c10=_0x556ac6[_0x81726b(0x1b4)](({eventProperty:_0x105d96})=>!_0x355456['eventProperty'][_0x81726b(0x196)](_0x105d96))['map'](({eventProperty:_0x46d0c0})=>_0x46d0c0);return _0x4b6c10[_0x81726b(0x1d7)]>0x0?'Event\x20'+_0x4fad9e+'\x20has\x20invalid\x20eventProperties:\x20'+_0x4b6c10[_0x81726b(0x1c9)](',\x20')+'.':_0x556ac6[_0x81726b(0x1d5)](({eventProperty:_0x7ff0af,value:_0x2e1104})=>({'eventPropertyId':_0x355456[_0x81726b(0x1d3)][_0x7ff0af]['id'],'value':_0x2e1104}));},F=new WeakSet(),Rt=function(_0x4383f2,_0x106502){const _0x3afa18=_0x273a96;let _0x3c9e1d=[{'customerId':localStorage[_0x3afa18(0x1f9)](_0x3afa18(0x1c3))||'0','events':[{'eventId':_0x4383f2}]}];return _0x106502&&(_0x3c9e1d[0x0][_0x3afa18(0x17d)][0x0]['eventProperties']=_0x106502),_0x3c9e1d;},ct=new WeakSet(),se=function(_0x2e6ab6){return a(this,null,function*(){const _0x2807db=_0x3444;try{return yield y[_0x2807db(0x1f6)](''+Q+Bt,_0x2e6ab6);}catch(_0x255368){throw new Error(_0x2807db(0x1fa));}});},lt=new WeakSet(),ae=function(_0x34d892){const _0x24717e=_0x273a96;return(_0x34d892==null?void 0x0:_0x34d892[_0x24717e(0x1fb)])===_0x24717e(0x1a1);},ut=new WeakSet(),ce=function(_0x24c7e4){const _0x18fff0=_0x273a96;localStorage['setItem'](_0x18fff0(0x1d9),JSON[_0x18fff0(0x1e9)](gt(pt({},_0x24c7e4),{'initialTime':''+new Date()['getTime']()})));},M=new WeakSet(),Pt=function(){const _0x4119ec=_0x273a96;localStorage[_0x4119ec(0x192)](_0x4119ec(0x1d9)),localStorage[_0x4119ec(0x192)](_0x4119ec(0x17d)),localStorage[_0x4119ec(0x192)](_0x4119ec(0x1af)),localStorage['removeItem']('offlineEvents');},k=new WeakSet(),At=function(){return a(this,null,function*(){const _0x521a0d=_0x3444;localStorage[_0x521a0d(0x1f9)](_0x521a0d(0x1af))||(yield n(this,$,St)[_0x521a0d(0x17a)](this));});},J=new WeakSet(),Ut=function(_0x23dc3b){return a(this,null,function*(){const _0x40c15c=_0x3444;try{return yield y[_0x40c15c(0x1f6)](''+ht+Vt,_0x23dc3b);}catch(_0x40fde3){throw new Error('Error\x20posting\x20attribute\x20record');}});},i(T,S,void 0x0);function _0x1d54(){const _0x53bf7e=['isArray','value','forEach','uniqueIdentity','querySelectorAll','has','Event\x20','112698PManLl','disableSDK','User\x20Login','561010bMZDkb','innerHTML','addEventListener','recordEvent','/record-bulk-event','/customer','HTTP\x20Status:\x20','68032QaEnJf','removeItem','Error\x20fetching\x20attribute\x20data','Popup\x20Image\x20Clicked','done','hasOwnProperty','data','OriginateFrom:\x20','object','AxiosQueueManager','40830tYgItt','UTM\x20Key\x20Value','.u-close-button','identity','getTime','login','Popup','request','getInstance','online','next','getOwnPropertySymbols','page','get','eventProperties','getOwnPropertyNames','User\x20Logout','defineProperties','status','showErrorLog','attributes','response','441LnnahB','recordAttribute','AxiosError:\x20','filter','ttl','href','defineProperty','error','add','\x0aNo\x20response\x20received.\x20Check\x20network\x20connection\x20or\x20server\x20issues.','MergnError','keys','access\x20private\x20method','search','16BTtDaT','default','591321mNDCgV','getPrototypeOf','customer','Mergn\x20SDK\x20is\x20disabled!','40hHoWTZ','apiKey','URL','resolve','join','delay','logout','isInitialized','design','Popup\x20Button\x20Clicked','appendChild','apply','campaignId','608398ILVJZr','eventProperty','Response\x20Data:','map','defaults','length','querySelector','action','/set-identity','headers','body','click','offline','Error\x20fetching\x20event\x20data','Customer\x20Id','create','setItem','updateAttribute','prototype','initialTime','attributeProperty','common','updateAPIKey','stringify','set','message','createElement','pathname','parse','Mergn\x20is\x20offline!','/attribute','push','div','platform','hostname','remove','post','Max\x20retries\x20reached.\x20Disabling\x20SDK.','throw','getItem','Error\x20posting\x20event\x20record','name','log','Error\x20setting\x20identity','brand','Mergn\x20not\x20initialized!','Campaign\x20Id','[id^=\x22u_content_button_\x22]','beforeunload','Error\x20setting\x20up\x20the\x20request:','init','Unexpected\x20error:','Cannot\x20add\x20the\x20same\x20private\x20member\x20more\x20than\x20once','propertyIsEnumerable','749874ptekqd','call','offlineEvents','write\x20to\x20private\x20field','events','.u-popup-container\x20img','location'];_0x1d54=function(){return _0x53bf7e;};return _0x1d54();}var It=T,le=It[_0x273a96(0x1a3)](),Te=le;
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x102e79=_0x2461;(function(_0xb22c39,_0x2ce1a7){const _0x3ea33e=_0x2461,_0x1933de=_0xb22c39();while(!![]){try{const _0x4e4be6=-parseInt(_0x3ea33e(0xbb))/0x1*(-parseInt(_0x3ea33e(0xb2))/0x2)+parseInt(_0x3ea33e(0xfa))/0x3+-parseInt(_0x3ea33e(0xd6))/0x4*(parseInt(_0x3ea33e(0xd3))/0x5)+parseInt(_0x3ea33e(0xeb))/0x6+-parseInt(_0x3ea33e(0x103))/0x7*(-parseInt(_0x3ea33e(0xce))/0x8)+-parseInt(_0x3ea33e(0xae))/0x9*(-parseInt(_0x3ea33e(0x10f))/0xa)+-parseInt(_0x3ea33e(0xf6))/0xb;if(_0x4e4be6===_0x2ce1a7)break;else _0x1933de['push'](_0x1933de['shift']());}catch(_0x28c43c){_0x1933de['push'](_0x1933de['shift']());}}}(_0xf6f0,0x21a93));var re=Object[_0x102e79(0xd9)],oe=Object[_0x102e79(0xb9)],ie=Object[_0x102e79(0xe9)],Ut=Object[_0x102e79(0xf5)],ne=Object['prototype'][_0x102e79(0xea)],se=Object[_0x102e79(0x11b)][_0x102e79(0xe8)],Ot=(_0x469973,_0x594e2e,_0x599016)=>_0x594e2e in _0x469973?re(_0x469973,_0x594e2e,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x599016}):_0x469973[_0x594e2e]=_0x599016,dt=(_0x1f542a,_0x3f8c5f)=>{for(var _0x4018d3 in _0x3f8c5f||(_0x3f8c5f={}))ne['call'](_0x3f8c5f,_0x4018d3)&&Ot(_0x1f542a,_0x4018d3,_0x3f8c5f[_0x4018d3]);if(Ut){for(var _0x4018d3 of Ut(_0x3f8c5f))se['call'](_0x3f8c5f,_0x4018d3)&&Ot(_0x1f542a,_0x4018d3,_0x3f8c5f[_0x4018d3]);}return _0x1f542a;},pt=(_0xec5627,_0x466806)=>oe(_0xec5627,ie(_0x466806)),gt=(_0x5763df,_0x291922,_0x5c946c)=>{const _0x25b6c3=_0x102e79;if(!_0x291922['has'](_0x5763df))throw TypeError(_0x25b6c3(0xe6)+_0x5c946c);},u=(_0x4d9ba7,_0x2718ba,_0x2c1ea8)=>(gt(_0x4d9ba7,_0x2718ba,'read\x20from\x20private\x20field'),_0x2c1ea8?_0x2c1ea8[_0x102e79(0xc5)](_0x4d9ba7):_0x2718ba[_0x102e79(0xb5)](_0x4d9ba7)),i=(_0x1e07a0,_0x47e0df,_0x39b9ab)=>{const _0x441f3f=_0x102e79;if(_0x47e0df['has'](_0x1e07a0))throw TypeError(_0x441f3f(0xb7));_0x47e0df instanceof WeakSet?_0x47e0df[_0x441f3f(0xe0)](_0x1e07a0):_0x47e0df[_0x441f3f(0x11a)](_0x1e07a0,_0x39b9ab);},E=(_0x411b69,_0x53a6dc,_0x4f937c,_0x349275)=>(gt(_0x411b69,_0x53a6dc,_0x102e79(0x10e)),_0x349275?_0x349275[_0x102e79(0xc5)](_0x411b69,_0x4f937c):_0x53a6dc['set'](_0x411b69,_0x4f937c),_0x4f937c),Nt=(_0xfb280d,_0x10b186,_0xb6fe54,_0x1b0eae)=>({set '_'(_0x533017){E(_0xfb280d,_0x10b186,_0x533017,_0xb6fe54);},get '_'(){return u(_0xfb280d,_0x10b186,_0x1b0eae);}}),n=(_0x345f21,_0x38bb9b,_0x4d5905)=>(gt(_0x345f21,_0x38bb9b,_0x102e79(0xb3)),_0x4d5905),a=(_0x362c91,_0xac63d8,_0x18d2e3)=>new Promise((_0x1dba41,_0x8da0ff)=>{const _0x24ccab=_0x102e79;var _0x2b5fed=_0x1a4d76=>{try{_0x1528f9(_0x18d2e3['next'](_0x1a4d76));}catch(_0x521ee3){_0x8da0ff(_0x521ee3);}},_0x311b0a=_0x56a9d2=>{try{_0x1528f9(_0x18d2e3['throw'](_0x56a9d2));}catch(_0xd71bfb){_0x8da0ff(_0xd71bfb);}},_0x1528f9=_0x139301=>_0x139301[_0x24ccab(0xfe)]?_0x1dba41(_0x139301[_0x24ccab(0x114)]):Promise['resolve'](_0x139301['value'])['then'](_0x2b5fed,_0x311b0a);_0x1528f9((_0x18d2e3=_0x18d2e3[_0x24ccab(0x119)](_0x362c91,_0xac63d8))['next']());});import{v4 as _0x545129}from'uuid';var Lt=_0x102e79(0x120),Et=_0x102e79(0xec),xt=_0x102e79(0xfb),J=_0x102e79(0xdb),Dt='/record-event',_t=_0x102e79(0x111),Ct=_0x102e79(0xba),$t=_0x102e79(0x116);import _0x4f380e from'axios';import{AxiosQueueManager as _0x30ea77}from'axios-queue-js';import _0x3dd9c8 from'axios-retry';import{AxiosError as _0xdf195}from'axios';var c=class extends Error{constructor(_0x59cf3e){const _0x1a0954=_0x102e79;super(_0x59cf3e),this[_0x1a0954(0xdd)]=_0x1a0954(0xf0);}};c['disableSDK']=!0x1,c[_0x102e79(0xd7)]=!navigator['onLine'],c[_0x102e79(0xdf)]=!0x1,c[_0x102e79(0x10c)]=!0x1;var ce=(_0x44d697,_0xb5017f)=>{const _0x4834bd=_0x102e79;_0xb5017f instanceof c?console[_0x4834bd(0x124)](_0x4834bd(0xf2)+_0x44d697,'MergnError:\x20'+_0xb5017f[_0x4834bd(0x104)]):_0xb5017f instanceof _0xdf195?(console[_0x4834bd(0x124)](_0x4834bd(0xf2)+_0x44d697,_0x4834bd(0xb4)+_0xb5017f['message']),_0xb5017f[_0x4834bd(0xf4)]?(console['error'](_0x4834bd(0xf2)+_0x44d697,'HTTP\x20Status:\x20'+_0xb5017f[_0x4834bd(0xf4)][_0x4834bd(0x11e)]),console['error'](_0x4834bd(0xf2)+_0x44d697,_0x4834bd(0xda),_0xb5017f['response'][_0x4834bd(0xe7)])):_0xb5017f[_0x4834bd(0xf7)]?console[_0x4834bd(0x124)](_0x4834bd(0xf2)+_0x44d697+'\x0aNo\x20response\x20received.\x20Check\x20network\x20connection\x20or\x20server\x20issues.'):console[_0x4834bd(0x124)](_0x4834bd(0xf2)+_0x44d697,_0x4834bd(0xe4),_0xb5017f['message'])):_0xb5017f instanceof Error?console[_0x4834bd(0x124)](_0x4834bd(0xf2)+_0x44d697,'Unexpected\x20error:',_0xb5017f['message']):console[_0x4834bd(0x124)](_0x4834bd(0xf2)+_0x44d697,_0x4834bd(0xac),String(_0xb5017f));},f=(_0x588f29,_0x387d46,_0x172629)=>a(void 0x0,null,function*(){const _0x278ee6=_0x102e79;try{if(c[_0x278ee6(0xcb)])throw new c('Mergn\x20SDK\x20is\x20disabled!');if(_0x588f29!==_0x278ee6(0xe0)&&c[_0x278ee6(0xd7)])throw new c(_0x278ee6(0x10d));if(_0x588f29!==_0x278ee6(0x100)&&!c['isInitialized'])throw new c(_0x278ee6(0x10b));return yield _0x387d46();}catch(_0x55c9ca){return _0x172629?_0x172629(_0x55c9ca):c['showErrorLog']&&ce(_0x588f29,_0x55c9ca),null;}}),I,b,R,P,Q,A,mt,j,Vt,d=class d{constructor(){const _0xa6eb29=_0x102e79;i(this,Q,0x0);let _0x22857e=_0x4f380e[_0xa6eb29(0x123)]({'baseURL':Lt,'headers':{'Content-Type':_0xa6eb29(0xfc)}});E(d,b,_0x22857e),E(d,R,new _0x30ea77({'client':_0x22857e,'queueSize':0xa})),_0x3dd9c8(_0x22857e,{'onRetry':_0x3c0796=>{const _0x2b8c7a=_0xa6eb29;_0x3c0796>=u(d,P)?(c[_0x2b8c7a(0xdf)]&&console[_0x2b8c7a(0x105)](_0x2b8c7a(0xd0)),c[_0x2b8c7a(0xcb)]=!0x0):Nt(this,Q)['_']++;},'retries':u(d,P),'retryDelay':_0x502f10=>_0x502f10*0x1388});}static['updateAPIKey'](_0x3b9230){const _0x33159a=_0x102e79;this[_0x33159a(0xcc)]=_0x3b9230,n(this,j,Vt)[_0x33159a(0xc5)](this)['defaults'][_0x33159a(0x102)][_0x33159a(0x122)]['Authorization']=_0x3b9230;}static[_0x102e79(0xb5)](_0x54c755){return n(this,A,mt)['call'](this)['get'](_0x54c755);}static['post'](_0x42e249,_0x33adb0){return n(this,A,mt)['call'](this)['post'](_0x42e249,_0x33adb0||{});}};function _0x2461(_0x5e41a0,_0x124556){const _0xf6f05d=_0xf6f0();return _0x2461=function(_0x246178,_0x1ec865){_0x246178=_0x246178-0xaa;let _0x23eeeb=_0xf6f05d[_0x246178];return _0x23eeeb;},_0x2461(_0x5e41a0,_0x124556);}I=new WeakMap(),b=new WeakMap(),R=new WeakMap(),P=new WeakMap(),Q=new WeakMap(),A=new WeakSet(),mt=function(){return u(d,I)||E(d,I,new d()),u(d,R);},j=new WeakSet(),Vt=function(){return u(d,I)||E(d,I,new d()),u(d,b);},i(d,A),i(d,j),i(d,I,void 0x0),i(d,b,void 0x0),i(d,R,void 0x0),i(d,P,0x3);function _0xf6f0(){const _0x17b1d9=['name','uniqueIdentity','showErrorLog','add','logout','querySelector','UTM\x20Key\x20Value','Error\x20setting\x20up\x20the\x20request:','Campaign\x20Id','Cannot\x20','data','propertyIsEnumerable','getOwnPropertyDescriptors','hasOwnProperty','1397202yIldxz','/attribute','Viewed\x20Web\x20Page','getItem','identity','MergnError','initialTime','OriginateFrom:\x20','remove','response','getOwnPropertySymbols','6185960QNtSVM','request','keys','innerHTML','536808gMosUx','/record-attribute','application/json','attributes','done','recordAttribute','init','\x20has\x20invalid\x20eventProperties:\x20','headers','14uIoCLa','message','log','parse','Popup','recordEvent','\x20does\x20not\x20have\x20a\x20valid\x20eventProperty.','filter','Mergn\x20not\x20initialized!','isInitialized','Mergn\x20is\x20offline!','write\x20to\x20private\x20field','980RlMvyy','delay','/record-bulk-event','.u-popup-container\x20img','Popup\x20Button\x20Clicked','value','design','/set-identity','getInstance','offlineEvents','apply','set','prototype','hostname','eventProperties','status','pushState','https://95sidwa5jk.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api','beforeunload','common','create','error','action','div','map','post','User\x20Login','Unexpected\x20error:','stringify','1926BAAvEN','addEventListener','Event\x20','.u-close-button','2644qYHKAW','access\x20private\x20method','AxiosError:\x20','get','pathname','Cannot\x20add\x20the\x20same\x20private\x20member\x20more\x20than\x20once','[id^=\x22u_content_button_\x22]','defineProperties','/customer','175xTdwgv','removeItem','page','Popup\x20Image\x20Clicked','Error\x20setting\x20identity','Error\x20posting\x20identity\x20data','forEach','customer','online','click','call','platform','location','Customer\x20Id','length','getTime','disableSDK','apiKey','load','753744mcyVws','Error\x20posting\x20event\x20record','Max\x20retries\x20reached.\x20Disabling\x20SDK.','URL','events','761630GuyQuo','ttl','setItem','4ymYuSW','offline','join','defineProperty','Response\x20Data:','/event','eventProperty'];_0xf6f0=function(){return _0x17b1d9;};return _0xf6f0();}var ht=d,y=ht,S,v,U,O,N,L,x,vt,D,It,z,Ft,K,Mt,Y,kt,H,_,W,G,Jt,X,Qt,Z,jt,C,Tt,tt,qt,w,q,et,zt,$,ft,rt,Kt,ot,Yt,V,St,it,Ht,nt,Wt,st,Gt,B,wt,at,Xt,ct,Zt,lt,te,F,bt,M,Rt,k,Pt,T=class T{constructor(){const _0x5c5249=_0x102e79;i(this,x),i(this,D),i(this,z),i(this,K),i(this,Y),i(this,G),i(this,X),i(this,Z),i(this,C),i(this,tt),i(this,w),i(this,et),i(this,$),i(this,rt),i(this,ot),i(this,V),i(this,it),i(this,nt),i(this,st),i(this,B),i(this,at),i(this,ct),i(this,lt),i(this,F),i(this,M),i(this,k),i(this,v,''),i(this,U,void 0x0),i(this,O,void 0x0),i(this,N,void 0x0),i(this,L,null),i(this,H,()=>{const _0x3a38c1=_0x2461;let _0x14b9a0=()=>{const _0x14e3e7=_0x2461;let _0x212df7=JSON[_0x14e3e7(0x106)](localStorage[_0x14e3e7(0xee)](_0x14e3e7(0x125)));_0x212df7&&localStorage['setItem'](_0x14e3e7(0x125),JSON[_0x14e3e7(0xad)](pt(dt({},_0x212df7),{'initialTime':''+new Date()['getTime'](),'page':window['location']['hostname']+window[_0x14e3e7(0xc7)][_0x14e3e7(0xb6)]})));};_0x14b9a0(),window[_0x3a38c1(0xaf)](_0x3a38c1(0x121),_0x14b9a0);}),i(this,_,()=>{const _0x40333c=_0x2461;localStorage['removeItem'](_0x40333c(0x125));}),i(this,W,()=>{const _0x2d85ec=_0x2461;let _0x5d2776=JSON[_0x2d85ec(0x106)](localStorage[_0x2d85ec(0xee)](_0x2d85ec(0x125))||'{}');(_0x5d2776==null?void 0x0:_0x5d2776[_0x2d85ec(0xdd)])===_0x2d85ec(0x107)&&n(this,$,ft)[_0x2d85ec(0xc5)](this);}),E(this,N,navigator[_0x5c5249(0xc6)]);}static[_0x102e79(0x117)](){return u(T,S)||E(T,S,new T()),u(T,S);}[_0x102e79(0x100)](_0x3b6d2e){const _0x14ab1e=_0x102e79;f(_0x14ab1e(0x100),()=>a(this,null,function*(){const _0x4b58f4=_0x14ab1e;n(this,z,Ft)[_0x4b58f4(0xc5)](this,_0x3b6d2e),yield n(this,x,vt)[_0x4b58f4(0xc5)](this),setInterval(()=>a(this,null,function*(){const _0x4514b2=_0x4b58f4;yield n(this,x,vt)[_0x4514b2(0xc5)](this);}),0x493e0);let _0x1cd61a=localStorage['getItem'](_0x4b58f4(0xd4)),_0x1a15cb=!0x1;_0x1cd61a&&(_0x1a15cb=new Date()[_0x4b58f4(0xca)]()-parseInt(_0x1cd61a,0xa)>0x1b7740,_0x1a15cb&&n(this,F,bt)[_0x4b58f4(0xc5)](this)),(!_0x1cd61a||_0x1a15cb||n(this,K,Mt)[_0x4b58f4(0xc5)](this))&&(n(this,G,Jt)['call'](this),yield n(this,w,q)[_0x4b58f4(0xc5)](this),yield n(this,Y,kt)[_0x4b58f4(0xc5)](this)),window['addEventListener'](_0x4b58f4(0xc3),()=>a(this,null,function*(){const _0x4251cd=_0x4b58f4;c['offline']=!0x1;let _0x269541=JSON[_0x4251cd(0x106)](localStorage[_0x4251cd(0xee)](_0x4251cd(0x118))||'[]');Array['isArray'](_0x269541)&&(yield y[_0x4251cd(0xaa)](''+J+_t,[{'customerId':u(this,v),'events':_0x269541}]),localStorage['removeItem'](_0x4251cd(0x118)));})),window[_0x4b58f4(0xaf)](_0x4b58f4(0xd7),()=>{c['offline']=!0x0;}),window[_0x4b58f4(0xaf)](_0x4b58f4(0xcd),()=>{u(this,W)['call'](this);}),c['isInitialized']=!0x0;let _0x452079=history[_0x4b58f4(0x11f)];history[_0x4b58f4(0x11f)]=(..._0x5072a7)=>{const _0x110be0=_0x4b58f4;_0x452079[_0x110be0(0x119)](history,_0x5072a7),n(this,D,It)['call'](this);},n(this,D,It)['call'](this);}));}['showErrorLog'](_0x15c1e2=!0x1){const _0x4fb2eb=_0x102e79;c[_0x4fb2eb(0xdf)]=_0x15c1e2;}[_0x102e79(0xff)](_0x3a1d13){return a(this,null,function*(){const _0x43730a=_0x2461;yield f(_0x43730a(0xff),()=>a(this,null,function*(){const _0xc7c795=_0x43730a;yield n(this,M,Rt)[_0xc7c795(0xc5)](this);let _0x4447d8=JSON[_0xc7c795(0x106)](localStorage[_0xc7c795(0xee)](_0xc7c795(0xfd))||'{}');if(_0x4447d8&&Object['keys'](_0x4447d8)['length']>0x0){let _0x4bc13d=[];_0x3a1d13&&Object[_0xc7c795(0xf8)](_0x3a1d13)['length']>0x0&&Object[_0xc7c795(0xf8)](_0x3a1d13)[_0xc7c795(0xc1)](_0x273f69=>{const _0x1b8947=_0xc7c795;_0x4447d8[_0x1b8947(0xea)](_0x273f69)&&_0x4bc13d['push']({'attributeId':_0x4447d8[_0x273f69]['id'],'attributeProperties':[],'value':_0x3a1d13[_0x273f69]});});let _0x160c57=[{'attributes':_0x4bc13d,'customerId':u(this,v)}];yield n(this,k,Pt)[_0xc7c795(0xc5)](this,_0x160c57);}}));});}['login'](_0x525535){return a(this,null,function*(){yield f('login',()=>a(this,null,function*(){const _0x1f76f5=_0x2461;yield n(this,w,q)[_0x1f76f5(0xc5)](this,_0x525535),yield this[_0x1f76f5(0x108)](_0x1f76f5(0xab),[{'eventProperty':_0x1f76f5(0xc8),'value':localStorage[_0x1f76f5(0xee)](_0x1f76f5(0xc2))||0x0}]);}));});}['updateAttribute'](_0x21b69c,_0x8a19df,_0x1ccbe8){return a(this,null,function*(){const _0x39e69f=_0x2461;yield n(this,M,Rt)[_0x39e69f(0xc5)](this);let _0x42ec3c=JSON[_0x39e69f(0x106)](localStorage[_0x39e69f(0xee)](_0x39e69f(0xfd))||'{}');if(_0x42ec3c&&Object[_0x39e69f(0xf8)](_0x42ec3c)[_0x39e69f(0xc9)]>0x0&&_0x42ec3c[_0x39e69f(0xea)](_0x21b69c)){let _0x31dedf=_0x42ec3c[_0x21b69c],_0x14c569=_0x31dedf['attributeProperty'],_0x3da171=[];_0x1ccbe8&&Object[_0x39e69f(0xf8)](_0x1ccbe8)[_0x39e69f(0xc9)]>0x0&&Object[_0x39e69f(0xf8)](_0x1ccbe8)['forEach'](_0x20261d=>{const _0x4427f2=_0x39e69f;_0x14c569[_0x4427f2(0xea)](_0x20261d)&&_0x3da171['push']({'attributePropertyId':_0x14c569[_0x20261d]['id'],'value':_0x1ccbe8[_0x20261d]});});let _0x25a344=[{'attributes':[{'attributeId':_0x31dedf['id'],'attributeProperties':_0x3da171,'value':_0x8a19df}],'customerId':u(this,v)}];yield n(this,k,Pt)[_0x39e69f(0xc5)](this,_0x25a344);}});}[_0x102e79(0xe1)](){return a(this,null,function*(){yield f('logout',()=>a(this,null,function*(){const _0x334850=_0x2461;n(this,F,bt)[_0x334850(0xc5)](this),this[_0x334850(0x108)]('User\x20Logout',[{'eventProperty':_0x334850(0xc8),'value':localStorage[_0x334850(0xee)]('customer')||0x0}]);}));});}[_0x102e79(0x108)](_0x2d8584,_0xb3d1d9){return a(this,null,function*(){yield f('add',()=>a(this,null,function*(){const _0x491c97=_0x2461;var _0x4ecf3f,_0x2b6c35;let _0x5334b5=n(this,nt,Wt)[_0x491c97(0xc5)](this),_0xc32990=n(this,st,Gt)[_0x491c97(0xc5)](this,_0x5334b5,_0x2d8584,_0xb3d1d9);if(typeof _0xc32990=='string'){c[_0x491c97(0xdf)]&&console[_0x491c97(0x124)](_0xc32990);return;}let {id:_0x810596}=_0x5334b5[_0x2d8584];if(c[_0x491c97(0xd7)]){let _0x2b3005=JSON[_0x491c97(0x106)](localStorage[_0x491c97(0xee)](_0x491c97(0x118))||'[]');if(_0x2b3005[_0x491c97(0xc9)]<=0x32){let _0x1b783a={'eventId':_0x810596};_0xb3d1d9&&(_0x1b783a[_0x491c97(0x11d)]=_0xc32990),_0x2b3005['push'](_0x1b783a),localStorage[_0x491c97(0xd5)]('offlineEvents',JSON['stringify'](_0x2b3005));}return;}let _0x366f0a=_0xb3d1d9?n(this,B,wt)[_0x491c97(0xc5)](this,_0x810596,_0xc32990):n(this,B,wt)[_0x491c97(0xc5)](this,_0x810596),_0x3fcd0c=yield n(this,at,Xt)[_0x491c97(0xc5)](this,_0x366f0a);n(this,ct,Zt)[_0x491c97(0xc5)](this,(_0x4ecf3f=_0x3fcd0c==null?void 0x0:_0x3fcd0c['data'])==null?void 0x0:_0x4ecf3f[_0x491c97(0xe7)])&&(n(this,lt,te)[_0x491c97(0xc5)](this,(_0x2b6c35=_0x3fcd0c==null?void 0x0:_0x3fcd0c[_0x491c97(0xe7)])==null?void 0x0:_0x2b6c35[_0x491c97(0xe7)]),u(this,H)[_0x491c97(0xc5)](this),n(this,$,ft)['call'](this));}));});}};S=new WeakMap(),v=new WeakMap(),U=new WeakMap(),O=new WeakMap(),N=new WeakMap(),L=new WeakMap(),x=new WeakSet(),vt=function(){return a(this,null,function*(){const _0x119152=_0x2461;try{yield y[_0x119152(0xb5)]('brand');}catch(_0x59a9f3){c[_0x119152(0xcb)]=!0x0,c['showErrorLog']&&console[_0x119152(0x124)](_0x59a9f3[_0x119152(0x104)]);}});},D=new WeakSet(),It=function(){return a(this,null,function*(){const _0x4dd1e0=_0x2461;let _0x4733f6=window[_0x4dd1e0(0xc7)][_0x4dd1e0(0x11c)]+window[_0x4dd1e0(0xc7)][_0x4dd1e0(0xb6)];yield this['recordEvent'](_0x4dd1e0(0xed),[{'eventProperty':_0x4dd1e0(0xd1),'value':_0x4733f6}]),_0x4733f6!==u(this,L)&&(E(this,L,_0x4733f6),new URLSearchParams(new URL(window[_0x4dd1e0(0xc7)]['href'])['search'])[_0x4dd1e0(0xc1)]((_0x4f93a9,_0x278325)=>a(this,null,function*(){const _0x5b7cdf=_0x4dd1e0;yield this[_0x5b7cdf(0x108)](_0x5b7cdf(0xed),[{'eventProperty':_0x5b7cdf(0xe3),'value':_0x278325+':'+_0x4f93a9}]);})));});},z=new WeakSet(),Ft=function(_0x35ff17){y['updateAPIKey'](_0x35ff17);},K=new WeakSet(),Mt=function(){const _0xa8704c=_0x102e79;return!localStorage[_0xa8704c(0xee)](_0xa8704c(0xd2))||!localStorage[_0xa8704c(0xee)](_0xa8704c(0xc2))||!localStorage[_0xa8704c(0xee)](_0xa8704c(0xfd))||!localStorage[_0xa8704c(0xee)](_0xa8704c(0xde));},Y=new WeakSet(),kt=function(){return a(this,null,function*(){const _0x48abbf=_0x2461;yield n(this,X,Qt)[_0x48abbf(0xc5)](this),yield n(this,C,Tt)[_0x48abbf(0xc5)](this),yield n(this,w,q)[_0x48abbf(0xc5)](this);});},H=new WeakMap(),_=new WeakMap(),W=new WeakMap(),G=new WeakSet(),Jt=function(){const _0x194996=_0x102e79;let _0x42625c=localStorage[_0x194996(0xee)](_0x194996(0xde));return _0x42625c||(_0x42625c=_0x545129(),localStorage['setItem'](_0x194996(0xde),_0x42625c)),_0x42625c;},X=new WeakSet(),Qt=function(){return a(this,null,function*(){const _0x5d8014=_0x2461;if(!localStorage['getItem'](_0x5d8014(0xd2))){let _0x18bdf5=(yield n(this,Z,jt)[_0x5d8014(0xc5)](this))['data'];_0x18bdf5&&(E(this,U,_0x18bdf5),localStorage['setItem']('events',JSON[_0x5d8014(0xad)](u(this,U))));}});},Z=new WeakSet(),jt=function(){return a(this,null,function*(){const _0x1b620b=_0x2461;try{return(yield y[_0x1b620b(0xb5)](''+J))[_0x1b620b(0xe7)];}catch(_0x488c5f){throw new Error('Error\x20fetching\x20event\x20data');}});},C=new WeakSet(),Tt=function(){return a(this,null,function*(){const _0x1022d2=_0x2461;if(!localStorage[_0x1022d2(0xee)](_0x1022d2(0xfd))){let _0x344f4a=(yield n(this,tt,qt)[_0x1022d2(0xc5)](this))[_0x1022d2(0xe7)];_0x344f4a&&(E(this,O,_0x344f4a),localStorage['setItem'](_0x1022d2(0xfd),JSON[_0x1022d2(0xad)](u(this,O))));}});},tt=new WeakSet(),qt=function(){return a(this,null,function*(){const _0x31b8ac=_0x2461;try{return(yield y[_0x31b8ac(0xb5)](''+Et))['data'];}catch(_0x26715a){throw new Error('Error\x20fetching\x20attribute\x20data');}});},w=new WeakSet(),q=function(_0x26ccf5){return a(this,null,function*(){const _0x379c38=_0x2461;if(!_0x26ccf5){let _0x57e6ff=localStorage[_0x379c38(0xee)](_0x379c38(0xc2));if(_0x57e6ff){E(this,v,_0x57e6ff);return;}}let _0x54c4ab={'deviceId':localStorage[_0x379c38(0xee)](_0x379c38(0xde))||_0x545129(),'os':u(this,N)};_0x26ccf5&&(_0x54c4ab[_0x379c38(0xef)]=_0x26ccf5);try{let _0x417fc2=(yield n(this,et,zt)['call'](this,_0x54c4ab))[_0x379c38(0xe7)];_0x417fc2!==void 0x0&&(E(this,v,_0x417fc2),localStorage['setItem'](_0x379c38(0xc2),u(this,v)));}catch(_0x35bcaf){throw new Error(_0x379c38(0xbf));}});},et=new WeakSet(),zt=function(_0x56c645){return a(this,null,function*(){const _0xdc7aa0=_0x2461;try{return(yield y[_0xdc7aa0(0xaa)](''+Ct+$t,_0x56c645))[_0xdc7aa0(0xe7)];}catch(_0x43664a){throw new Error(_0xdc7aa0(0xc0));}});},$=new WeakSet(),ft=function(){const _0x1e01af=_0x102e79;let _0x15f423=n(this,rt,Kt)[_0x1e01af(0xc5)](this);if(_0x15f423){let _0x3759c9=_0x15f423[_0x1e01af(0x115)],_0xe7df60=_0x15f423['campaignId'];_0x15f423[_0x1e01af(0x110)]?n(this,ot,Yt)[_0x1e01af(0xc5)](this,_0x15f423,_0x3759c9,_0xe7df60):n(this,V,St)[_0x1e01af(0xc5)](this,_0x3759c9,_0xe7df60);}},rt=new WeakSet(),Kt=function(){const _0x180645=_0x102e79;let _0x2b2123=localStorage['getItem'](_0x180645(0x125));return _0x2b2123?JSON[_0x180645(0x106)](_0x2b2123):null;},ot=new WeakSet(),Yt=function(_0x457ce8,_0x445f9c,_0x568b3a){const _0x276502=_0x102e79;let _0x5858d8=parseInt(_0x457ce8[_0x276502(0xf1)],0xa)+_0x457ce8[_0x276502(0x110)]-new Date()[_0x276502(0xca)]();_0x5858d8>0x0&&_0x457ce8[_0x276502(0xbd)]===window[_0x276502(0xc7)][_0x276502(0x11c)]+window['location'][_0x276502(0xb6)]&&setTimeout(()=>{const _0x6be1ae=_0x276502;u(this,_)[_0x6be1ae(0xc5)](this),n(this,V,St)[_0x6be1ae(0xc5)](this,_0x445f9c,_0x568b3a);},_0x5858d8);},V=new WeakSet(),St=function(_0xd45981,_0x4ea394){const _0x29199=_0x102e79;let _0x1e2dcf=n(this,it,Ht)[_0x29199(0xc5)](this,_0x29199(0x126),_0xd45981,_0x4ea394);document['body']['appendChild'](_0x1e2dcf),u(this,_)['call'](this);},it=new WeakSet(),Ht=function(_0x5e8994,_0x15cabb,_0x597929){const _0x20cc1f=_0x102e79;var _0x279df0;let _0x1f2bfc=document['createElement'](_0x5e8994);return _0x1f2bfc['id']='popup_container_'+_0x597929,_0x1f2bfc[_0x20cc1f(0xf9)]=_0x15cabb,(_0x279df0=_0x1f2bfc[_0x20cc1f(0xe2)](_0x20cc1f(0xb1)))==null||_0x279df0[_0x20cc1f(0xaf)](_0x20cc1f(0xc4),()=>a(this,null,function*(){const _0x5c5d07=_0x20cc1f;_0x1f2bfc[_0x5c5d07(0xf3)](),yield this['recordEvent']('Popup\x20Button\x20Clicked',[{'eventProperty':'Campaign\x20Id','value':_0x597929}]);})),_0x1f2bfc['querySelectorAll'](_0x20cc1f(0xb8))[_0x20cc1f(0xc1)](_0x22b113=>{const _0x1fbfa7=_0x20cc1f;_0x22b113[_0x1fbfa7(0xaf)](_0x1fbfa7(0xc4),()=>a(this,null,function*(){const _0x299825=_0x1fbfa7;yield this[_0x299825(0x108)](_0x299825(0x113),[{'eventProperty':_0x299825(0xe5),'value':_0x597929}]);}));}),_0x1f2bfc['querySelectorAll'](_0x20cc1f(0x112))[_0x20cc1f(0xc1)](_0x3dbe8b=>{const _0x24e5b6=_0x20cc1f;_0x3dbe8b[_0x24e5b6(0xaf)](_0x24e5b6(0xc4),()=>a(this,null,function*(){const _0x50e2c2=_0x24e5b6;yield this[_0x50e2c2(0x108)](_0x50e2c2(0xbe),[{'eventProperty':_0x50e2c2(0xe5),'value':_0x597929}]);}));}),_0x1f2bfc;},nt=new WeakSet(),Wt=function(){const _0x15d44c=_0x102e79;let _0x2b95f9=localStorage[_0x15d44c(0xee)]('events');return _0x2b95f9?JSON[_0x15d44c(0x106)](_0x2b95f9):{};},st=new WeakSet(),Gt=function(_0x411bf8,_0x4afad6,_0x2e593e){const _0x3313ec=_0x102e79;if(!_0x411bf8['hasOwnProperty'](_0x4afad6))return _0x3313ec(0xb0)+_0x4afad6+'\x20is\x20not\x20valid.';if(!_0x2e593e)return[];let _0x1deda2=_0x411bf8[_0x4afad6];if(!(_0x1deda2!=null&&_0x1deda2[_0x3313ec(0xdc)]))return _0x3313ec(0xb0)+_0x4afad6+_0x3313ec(0x109);let _0x838664=_0x2e593e[_0x3313ec(0x10a)](({eventProperty:_0x43521d})=>!_0x1deda2[_0x3313ec(0xdc)][_0x3313ec(0xea)](_0x43521d))[_0x3313ec(0x127)](({eventProperty:_0x5cb172})=>_0x5cb172);return _0x838664[_0x3313ec(0xc9)]>0x0?_0x3313ec(0xb0)+_0x4afad6+_0x3313ec(0x101)+_0x838664[_0x3313ec(0xd8)](',\x20')+'.':_0x2e593e[_0x3313ec(0x127)](({eventProperty:_0x4998cd,value:_0x27bb9d})=>({'eventPropertyId':_0x1deda2['eventProperty'][_0x4998cd]['id'],'value':_0x27bb9d}));},B=new WeakSet(),wt=function(_0x167a44,_0x3804f4){const _0x4fabf=_0x102e79;let _0x14c415=[{'customerId':localStorage['getItem'](_0x4fabf(0xc2))||'0','events':[{'eventId':_0x167a44}]}];return _0x3804f4&&(_0x14c415[0x0][_0x4fabf(0xd2)][0x0][_0x4fabf(0x11d)]=_0x3804f4),_0x14c415;},at=new WeakSet(),Xt=function(_0x4493fe){return a(this,null,function*(){const _0x3bfbed=_0x2461;try{return yield y['post'](''+J+Dt,_0x4493fe);}catch(_0x3464db){throw new Error(_0x3bfbed(0xcf));}});},ct=new WeakSet(),Zt=function(_0x54e022){const _0x16c8f1=_0x102e79;return(_0x54e022==null?void 0x0:_0x54e022[_0x16c8f1(0xdd)])===_0x16c8f1(0x107);},lt=new WeakSet(),te=function(_0x12e960){const _0x1add55=_0x102e79;localStorage[_0x1add55(0xd5)](_0x1add55(0x125),JSON[_0x1add55(0xad)](pt(dt({},_0x12e960),{'initialTime':''+new Date()[_0x1add55(0xca)]()})));},F=new WeakSet(),bt=function(){const _0x26ee83=_0x102e79;localStorage[_0x26ee83(0xbc)](_0x26ee83(0x125)),localStorage[_0x26ee83(0xbc)](_0x26ee83(0xd2)),localStorage[_0x26ee83(0xbc)]('attributes'),localStorage['removeItem'](_0x26ee83(0x118));},M=new WeakSet(),Rt=function(){return a(this,null,function*(){const _0x18526b=_0x2461;localStorage[_0x18526b(0xee)](_0x18526b(0xfd))||(yield n(this,C,Tt)[_0x18526b(0xc5)](this));});},k=new WeakSet(),Pt=function(_0xc3d8f4){return a(this,null,function*(){const _0x51b6e3=_0x2461;try{return yield y[_0x51b6e3(0xaa)](''+Et+xt,_0xc3d8f4);}catch(_0x30307c){throw new Error('Error\x20posting\x20attribute\x20record');}});},i(T,S,void 0x0);var yt=T,ee=yt[_0x102e79(0x117)](),Fe=ee;export{Fe as default};
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mergn-webapp-sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"author": "yaseenmergn123",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsup",
|
|
14
|
+
"postbuild": "mv ./dist/index.mjs ./dist/index2.js && node ./obfuscate.js && rm -rf ./dist/index2.js",
|
|
15
|
+
"test": "jest",
|
|
16
|
+
"watch": "onchange 'src/**/*.ts' -- npm run build && npm unlink mergn-test-sdk && npm link",
|
|
17
|
+
"lint": "eslint --ext .js,.ts .",
|
|
18
|
+
"format": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"",
|
|
19
|
+
"prepare": "husky install",
|
|
20
|
+
"link": "npm unlink mergn-test-sdk && npm link"
|
|
21
|
+
},
|
|
22
|
+
"lint-staged": {
|
|
23
|
+
"*": "prettier --write --ignore-unknown",
|
|
24
|
+
"*.ts": "eslint --fix"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/crypto-js": "^4.2.1",
|
|
28
|
+
"@types/jest": "^29.5.11",
|
|
29
|
+
"@types/node": "^20.10.5",
|
|
30
|
+
"@types/uuid": "^9.0.7",
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^6.17.0",
|
|
32
|
+
"@typescript-eslint/parser": "^6.17.0",
|
|
33
|
+
"eslint": "^8.56.0",
|
|
34
|
+
"eslint-config-prettier": "^9.1.0",
|
|
35
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
|
36
|
+
"eslint-plugin-prettier": "^5.1.2",
|
|
37
|
+
"eslint-plugin-sort": "^2.11.0",
|
|
38
|
+
"husky": "^8.0.3",
|
|
39
|
+
"javascript-obfuscator": "^4.1.0",
|
|
40
|
+
"jest": "^29.7.0",
|
|
41
|
+
"jest-mock-axios": "^4.7.3",
|
|
42
|
+
"lint-staged": "^15.2.0",
|
|
43
|
+
"prettier": "^3.1.1",
|
|
44
|
+
"ts-jest": "^29.1.1",
|
|
45
|
+
"ts-node": "^10.9.2",
|
|
46
|
+
"tsup": "^8.0.1",
|
|
47
|
+
"typescript": "^5.3.3"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"axios": "^1.6.5",
|
|
51
|
+
"axios-queue-js": "^1.1.6",
|
|
52
|
+
"axios-retry": "^4.0.0",
|
|
53
|
+
"uuid": "^9.0.1"
|
|
54
|
+
}
|
|
55
|
+
}
|