@seaverse/track-sdk 0.1.10 → 0.1.12

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/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var t=require("firebase/app"),e=require("firebase/analytics");function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,s.get?s:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var s,i,r=n(require("sa-sdk-javascript"));function o(t,e){return t-=145,a()[t]}function a(){var t=["SENSORS","225DKyxPQ","1502464FQyWRQ","24255YLciCf","sensors","1662324tkBdVJ","4695735fjBJyL","1204390ISTziF","5173850fRWmIG","774eihcpk","FIREBASE","7085888kkNCmb"];return(a=function(){return t})()}function c(){const t=["undefined","noscript","body","10gcwFgn","609348odctAS","[GTM] Injected successfully: ","4TjqvMf","style","script","8OajDnL","gtm.js","from","appendChild","[GoogleTagManager] Pushed to dataLayer:","28937CTSHVr","https://www.googletagmanager.com/gtm.js?id=","[GoogleTagManager] Invalid event name:","parentNode","insertBefore","632360EwSqlL","544460ZTUHUm","https://www.googletagmanager.com/ns.html?id=","[GoogleTagManager] Error pushing to dataLayer:","push","dataLayer","1768382tWjzCv","height","createElement","[GTM] Not in browser environment, skip injection","string","[GTM] Already injected, skip","warn","async","81858FZxIOS","none","display","width","getElementsByTagName","some","DOMContentLoaded","9IwscGy","gtm.js?id=","[GoogleTagManager] dataLayer not initialized","[GTM] Injection failed:","[GTM] GTM ID is empty, skip injection","getTime","error","log","src","362075nmekKO","visibility","includes","firstChild","head"];return(c=function(){return t})()}function l(){const t=p;return typeof window!==t(189)&&typeof document!==t(189)}function p(t,e){t-=144;return c()[t]}function d(t){const e=p,n=document[e(162)](e(190)),s=document[e(162)]("iframe");s[e(183)]=e(156)+t,s[e(161)]="0",s[e(171)]="0",s[e(196)][e(170)]=e(169),s.style[e(185)]="hidden",n[e(147)](s),document[e(191)][e(187)]?document[e(191)][e(153)](n,document[e(191)][e(187)]):document.body[e(147)](n)}function h(t,e=!1){const n=p;if(l())if(t)if(function(t){const e=p;if(!l())return!1;const n=!!window[e(159)],s=document.querySelectorAll(e(197)),i=Array[e(146)](s)[e(173)](n=>n[e(183)][e(186)](e(176)+t));return n&&i}(t))e&&console.log(n(165));else try{(function(t){const e=p;window[e(159)]=window.dataLayer||[],window[e(159)][e(158)]({"gtm.start":(new Date)[e(180)](),event:e(145)});const n=document[e(162)](e(197));n[e(167)]=!0,n[e(183)]=e(150)+t;const s=document[e(172)](e(197))[0];s&&s[e(152)]?s[e(152)].insertBefore(n,s):document[e(188)][e(147)](n)})(t),document[n(191)]?d(t):document.addEventListener(n(174),()=>{d(t)}),e&&console[n(182)](n(194)+t)}catch(t){console[n(181)](n(178),t)}else e&&console.warn(n(179));else e&&console[n(166)](n(163))}!function(){for(var t=o,e=a();;)try{if(971666===-parseInt(t(151))/1+-parseInt(t(149))/2+parseInt(t(150))/3+-parseInt(t(155))/4+-parseInt(t(152))/5+parseInt(t(153))/6*(-parseInt(t(147))/7)+-parseInt(t(146))/8*(-parseInt(t(145))/9))break;e.push(e.shift())}catch(t){e.push(e.shift())}}(),exports.TrackProvider=void 0,(s=exports.TrackProvider||(exports.TrackProvider={}))[(i=o)(154)]="firebase",s[i(156)]=i(148),function(){const t=p,e=c();for(;;)try{if(113668===-parseInt(t(149))/1*(-parseInt(t(144))/2)+-parseInt(t(168))/3*(parseInt(t(195))/4)+-parseInt(t(184))/5+parseInt(t(193))/6+parseInt(t(155))/7+-parseInt(t(154))/8*(-parseInt(t(175))/9)+-parseInt(t(192))/10*(parseInt(t(160))/11))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const f=(t,e)=>{const n=p;if(!t||typeof t!==n(164))return void console[n(181)](n(151),t);(t=>{const e=p;if(typeof window!==e(189)&&window[e(159)])try{window[e(159)][e(158)](t),console[e(182)](e(148),t)}catch(t){console[e(181)](e(157),t)}else console[e(181)](e(177))})({event:t,...e||{}})},u=I;function I(t,e){t-=257;return w()[t]}function w(){const t=["setUserId","5sFuAHL","547688IEGtxf","4012281tImYbC","track","analytics","1197TmPoWV","debug","6773184OmTofs","firebase initialize failed:","config","clearUserId","2516484inCSFz","initialize","initialized","300546ThjMQJ","setUserProperties","404950QLVXne","5840WThhYr","gtmId"];return(w=function(){return t})()}!function(){const t=I,e=w();for(;;)try{if(353415===parseInt(t(258))/1+-parseInt(t(260))/2+-parseInt(t(269))/3*(parseInt(t(261))/4)+parseInt(t(264))/5*(-parseInt(t(275))/6)+parseInt(t(266))/7+-parseInt(t(265))/8+parseInt(t(271))/9)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class m{constructor(t,e,n=!1){const s=I;this[s(268)]=null,this.initialized=!1,this[s(273)]=t,this[s(262)]=e,this[s(270)]=n}async[u(276)](){const n=u;if(!this[n(257)])try{const s=t.initializeApp(this[n(273)]);this[n(268)]=e.getAnalytics(s),this[n(262)]&&h(this[n(262)],this.debug),this[n(257)]=!0}catch(t){throw console.error(n(272),t),t}}async[u(267)](t,e){}async[u(263)](t){}async[u(259)](t){}async[u(274)](){}}function k(t,e){t-=217;return v()[t]}const y=k;!function(){const t=k,e=v();for(;;)try{if(231520===parseInt(t(233))/1+-parseInt(t(221))/2+parseInt(t(218))/3+-parseInt(t(235))/4*(-parseInt(t(243))/5)+-parseInt(t(247))/6*(-parseInt(t(239))/7)+-parseInt(t(253))/8*(-parseInt(t(222))/9)+-parseInt(t(238))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class g{constructor(t,e,n,s,i){const r=k;this.sensors=null,this[r(250)]=!1,this.token=t,this.platform=e,this.version=n,this[r(251)]=s,this[r(225)]=i}async[y(229)](){const t=y;if(!this.initialized)try{if(!r)throw new Error("sensors sdk not found, please install it by running");this.sensors=r;const e=encodeURIComponent(this[t(217)]),n=encodeURIComponent(this[t(246)]),s=encodeURIComponent(this[t(241)]),i=encodeURIComponent(this.env);this[t(224)][t(255)]({server_url:this[t(225)].serverUrl+(t(230)+e+t(227)+n+t(226)+s+"&e=")+i,show_log:this[t(225)].showLog??!1,heatmap:this[t(225)][t(236)]??{},is_track_single_page:!0,send_type:t(242)}),this[t(250)]=!0,this[t(224)].quick(t(249))}catch(e){throw console[t(252)](t(240),e),e}}async[y(219)](t,e){const n=y;if(this[n(250)]&&this[n(224)])try{this[n(224)][n(219)](t,e??{})}catch(t){console[n(252)](n(244),t)}else console[n(237)](n(245))}async setUserId(t){const e=y;if(this[e(250)]&&this[e(224)])try{this[e(224)][e(231)](t)}catch(t){console.error(e(254),t)}else console[e(237)](e(220))}async setUserProperties(t){const e=y;if(this[e(250)]&&this[e(224)])try{this[e(224)][e(248)](t)}catch(t){console[e(252)](e(223),t)}else console[e(237)](e(232))}async clearUserId(){const t=y;if(this[t(250)]&&this[t(224)])try{this.sensors[t(234)]()}catch(e){console[t(252)](t(228),e)}}}function v(){const t=["14zQoHvd","sensors sdk init failed:","version","ajax","255105khKncM","sensors sdk track failed:","sensors sdk not initialized, skip track","platform","282726HFfvFk","setProfile","autoTrack","initialized","env","error","8WcToMS","sensors sdk setUserId failed:","init","token","1347612CauuVl","track","sensors sdk not initialized, skip setUserId","14720hAiWHz","3484917dZpKwy","sensors sdk setUserProperties failed:","sensors","config","&v=","&p=","sensors sdk clearUserId failed:","initialize","?t=","login","sensors sdk not initialized, skip setUserProperties","179659qFsMuu","logout","32kzHqjM","heatmap","warn","12796060oYuXYR"];return(v=function(){return t})()}function z(t,e){return t-=464,M()[t]}function M(){var t=["undefined","from","91497WKggjK","btoa","4468dGlbVi","8371arVtpN","936BSHhes","48VaxXLZ","2465zEsmLo","toString","150YgPPnb","55778fedGdm","atob","4010HmGkQA","333412fJBTxa","utf-8","3159uIaxGh","16720176eXMzhp"];return(M=function(){return t})()}function b(t){var e=z;return typeof window!==e(466)&&window.btoa?window[e(469)](t):Buffer[e(467)](t,"utf-8")[e(475)]("base64")}function T(t){return JSON.parse((e=t,n=z,"undefined"!=typeof window&&window[n(478)]?window[n(478)](e):Buffer[n(467)](e,"base64")[n(475)](n(481))));var e,n}!function(){for(var t=z,e=M();;)try{if(282476===-parseInt(t(480))/1+-parseInt(t(477))/2*(-parseInt(t(473))/3)+parseInt(t(470))/4*(-parseInt(t(474))/5)+parseInt(t(476))/6*(-parseInt(t(468))/7)+-parseInt(t(472))/8*(parseInt(t(464))/9)+parseInt(t(479))/10*(-parseInt(t(471))/11)+parseInt(t(465))/12)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const Z=E;function N(){const t=["595847mXuFFF","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjo2NmI2ZTNmNmEwZjM2MDkwNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctN0gySjFTQ05QRCJ9","548830hCqPdL","1913228ekLxSO","778674UciUxE","SENSORS","1706409PkkiHx","40HzRDuf","3170532agrNch","2qkJbMo","GTM-MJDRW2W4","103303xHtaGf","eyJzZXJ2ZXJVcmwiOiJodHRwczovL3N2LWFuYWx5dGljcy5zZy5zZWF2ZXJzZS5haS9zYSIsImhlYXRtYXAiOnsiY2xpY2ttYXAiOiJkZWZhdWx0Iiwic2Nyb2xsX25vdGljZV9tYXAiOiJkZWZhdWx0In19","FIREBASE"];return(N=function(){return t})()}!function(){const t=E,e=N();for(;;)try{if(292418===-parseInt(t(208))/1*(parseInt(t(220))/2)+parseInt(t(215))/3+-parseInt(t(214))/4+parseInt(t(213))/5+-parseInt(t(219))/6+parseInt(t(211))/7+parseInt(t(218))/8*(parseInt(t(217))/9))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const W={"MDE5YjUzNTEyMWJhNzc1ZmIwYTQ1MzY3Njg1NzU1MTU=":{providers:[exports.TrackProvider.FIREBASE,exports.TrackProvider[Z(216)]],firebaseConfig:T(Z(212)),sensorsConfig:T(Z(209)),gtmId:Z(221)},"MDE5YjUzNTE3ZmFiN2YxZDkwNjg5OWVhMGQyMWJlZGI=":{providers:[exports.TrackProvider[Z(210)],exports.TrackProvider.SENSORS],firebaseConfig:T("eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjpkMTQ4OGM3MzI0MWIyZWMzNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctR0gxNk1CQ1NOVyJ9"),sensorsConfig:T(Z(209))}};function E(t,e){t-=208;return N()[t]}function F(t,e){t-=191;return C()[t]}const S=F;function C(){const t=["Must provide a token","setUserId","initialize","658dntqqX","set","SENSORS","local","[Track] Skip Firebase initialization (initializeFirebase = false)","273482IlEMCo","keys","58458JEEocZ","firebaseConfig","Invalid token: ","from","unknown provider: ","21VIqoRF","[Track] Set User ID:","warn","includes","platform","initialize ","Invalid env: ","Must provide a platform","788227LWntaN","15TFUqlb"," adapter failed:","6996368dupDOt","9RMBIwE","validateConfig","log","setUserProperties","values","env","[Track] ","initialized","Must provide a version","sensorsConfig","app_id","allSettled","Track SDK initialized, enabled providers:","4102020vXutwp","[Track] Set User Properties:","providers","config","10845560HBXtYT","clearUserId","81032vXUKlc","debug","track","adapters","length","initializeFirebase","version","Must provide an env",". Must be one of: local, develop, production","FIREBASE","getInitializedProviders","error","gtmId","track SDK not initialized, please call initialize() first","push","platformConfig"];return(C=function(){return t})()}!function(){const t=F,e=C();for(;;)try{if(681506===-parseInt(t(236))/1+parseInt(t(221))/2*(-parseInt(t(228))/3)+parseInt(t(197))/4*(parseInt(t(237))/5)+-parseInt(t(223))/6*(-parseInt(t(216))/7)+parseInt(t(239))/8*(parseInt(t(240))/9)+-parseInt(t(191))/10+parseInt(t(195))/11)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class TrackClient{constructor(t){const e=F;this.adapters=new Map,this[e(247)]=!1,this[e(194)]=t,this[e(241)](),this[e(212)]=function(t){const e=b(t),n=W[e];if(!n)throw new Error("invalid token: "+t);return n}(t.token)}validateConfig(){const t=F;if(!this[t(194)].token)throw new Error(t(213));if(!this[t(194)][t(232)])throw new Error(t(235));if(!this[t(194)][t(203)])throw new Error(t(248));if(!this[t(194)][t(245)])throw new Error(t(204));if(![t(219),"develop","production"][t(231)](this.config.env))throw new Error(t(234)+this[t(194)][t(245)]+t(205));if(!this[t(194)].app_id)throw new Error("Must provide an app_id");if(this[t(194)][t(250)][t(201)]>36)throw new Error("app_id length cannot exceed 36 characters, got "+this[t(194)][t(250)][t(201)]);if(!(b(this[t(194)].token)in W))throw new Error(t(225)+this[t(194)].token)}async[S(215)](){const t=S;if(this[t(247)])return;const e=[],n=!1!==this.config[t(202)];for(const s of this[t(212)][t(193)])try{if(s===exports.TrackProvider[t(206)]&&!n){this[t(194)][t(198)]&&console[t(242)](t(220));continue}let i;switch(s){case exports.TrackProvider[t(206)]:i=new m(this[t(212)][t(224)],this.platformConfig[t(209)],this[t(194)][t(198)]);break;case exports.TrackProvider[t(218)]:i=new g(this.config.token,this[t(194)][t(232)],this[t(194)][t(203)],this[t(194)].env,this[t(212)][t(249)]);break;default:console[t(230)](t(227)+s);continue}this[t(200)][t(217)](s,i),e[t(211)](i.initialize())}catch(e){console[t(208)](t(233)+s+t(238),e)}await Promise[t(251)](e),this.initialized=!0,await this[t(243)]({app_id:this[t(194)][t(250)]}),this[t(194)].debug&&console[t(242)](t(252),Array[t(226)](this[t(200)][t(222)]()))}async[S(199)](t,e){const n=S;if(!this[n(247)])return void console.warn("track SDK not initialized, please call initialize() first");this.config[n(198)]&&console[n(242)](n(246)+t,e);const s=[];for(const i of this[n(200)][n(244)]())s[n(211)](i[n(199)](t,e));await Promise[n(251)](s)}async[S(214)](t){const e=S;if(!this[e(247)])return void console[e(230)](e(210));this[e(194)][e(198)]&&console.log(e(229),t);const n=[];for(const s of this[e(200)][e(244)]())n.push(s[e(214)](t));await Promise[e(251)](n)}async[S(243)](t){const e=S;if(!this[e(247)])return void console.warn(e(210));this[e(194)][e(198)]&&console[e(242)](e(192),t);const n=[];for(const s of this[e(200)][e(244)]())n[e(211)](s[e(243)](t));await Promise[e(251)](n)}async clearUserId(){const t=S;if(!this.initialized)return void console[t(230)]("track SDK not initialized, please call initialize() first");this.config.debug&&console.log("[Track] Clear User ID");const e=[];for(const n of this[t(200)][t(244)]())e[t(211)](n[t(196)]());await Promise[t(251)](e)}[S(207)](){return Array[S(226)](this.adapters.keys())}trackGTMEvent(t,e){f(t,e)}}function j(){var t=["18402AZDXSt","22NYcgcs","2VLpCbj","4906782rHYynK","163150eqfZWN","698056YvvtfR","1005756QORGNx","1400408YAwWrP","7eypPnq","2599860VXANwm","520MNmoFn"];return(j=function(){return t})()}function J(t,e){return t-=414,j()[t]}!function(){for(var t=J,e=j();;)try{if(315719===-parseInt(t(416))/1+parseInt(t(414))/2*(parseInt(t(418))/3)+parseInt(t(419))/4+-parseInt(t(422))/5*(parseInt(t(423))/6)+-parseInt(t(420))/7*(-parseInt(t(417))/8)+parseInt(t(415))/9+-parseInt(t(421))/10*(parseInt(t(424))/11))break;e.push(e.shift())}catch(t){e.push(e.shift())}}(),exports.TrackClient=TrackClient;
1
+ "use strict";var t=require("firebase/app"),e=require("firebase/analytics");function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,s.get?s:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var s,r,i=n(require("sa-sdk-javascript"));function o(){var t=["44CyMlgb","5062914Ezugap","firebase","218559KWbOJZ","308426hLKLXV","FIREBASE","15107552uFLDTB","3143280SKhgjT","1145672pyJqXf","sensors","5892068CpRmgI"];return(o=function(){return t})()}function a(t,e){return t-=273,o()[t]}function c(){const t=d;return typeof window!==t(335)&&typeof document!==t(335)}function p(t){const e=d,n=document[e(346)](e(327)),s=document[e(346)](e(325));s[e(324)]=e(356)+t,s[e(339)]="0",s[e(333)]="0",s[e(361)][e(367)]=e(352),s[e(361)][e(371)]="hidden",n[e(348)](s),document[e(364)].firstChild?document[e(364)][e(334)](n,document[e(364)][e(360)]):document[e(364)][e(348)](n)}function l(t,e=!1){const n=d;if(c())if(t)if(function(t){const e=d;if(!c())return!1;const n=!!window[e(345)],s=document[e(347)](e(373)),r=Array[e(337)](s)[e(336)](n=>n.src[e(358)](e(370)+t));return n&&r}(t))e&&console.log("[GTM] Already injected, skip");else try{(function(t){const e=d;window[e(345)]=window[e(345)]||[],window[e(345)][e(331)]({"gtm.start":(new Date)[e(342)](),event:"gtm.js"});const n=document[e(346)](e(373));n[e(368)]=!0,n[e(324)]=e(350)+t;const s=document.getElementsByTagName(e(373))[0];s&&s.parentNode?s[e(343)][e(334)](n,s):document.head[e(348)](n)})(t),document[n(364)]?p(t):document[n(332)](n(326),()=>{p(t)}),e&&console[n(341)](n(328)+t)}catch(t){console[n(340)](n(330),t)}else e&&console[n(374)](n(323));else e&&console[n(374)](n(359))}function h(){const t=["[GoogleTagManager] Invalid event name:","[GoogleTagManager] Pushed to dataLayer:","body","8FuYthL","8juwNcG","display","async","48634uGtbug","gtm.js?id=","visibility","568546HsvYvj","script","warn","[GTM] GTM ID is empty, skip injection","src","iframe","DOMContentLoaded","noscript","[GTM] Injected successfully: ","577602IyxTFm","[GTM] Injection failed:","push","addEventListener","width","insertBefore","undefined","some","from","1720496mxEBNk","height","error","log","getTime","parentNode","2972334uKAvXq","dataLayer","createElement","querySelectorAll","appendChild","1316435CxAjnP","https://www.googletagmanager.com/gtm.js?id=","string","none","70tYukmS","7plMUXV","1461429VDTCbf","https://www.googletagmanager.com/ns.html?id=","[GoogleTagManager] Error pushing to dataLayer:","includes","[GTM] Not in browser environment, skip injection","firstChild","style"];return(h=function(){return t})()}!function(){for(var t=a,e=o();;)try{if(505634===parseInt(t(279))/1+parseInt(t(283))/2+parseInt(t(278))/3*(-parseInt(t(275))/4)+parseInt(t(282))/5+parseInt(t(276))/6+parseInt(t(274))/7+-parseInt(t(281))/8)break;e.push(e.shift())}catch(t){e.push(e.shift())}}(),exports.TrackProvider=void 0,(s=exports.TrackProvider||(exports.TrackProvider={}))[(r=a)(280)]=r(277),s.SENSORS=r(273),function(){const t=d,e=h();for(;;)try{if(272338===parseInt(t(369))/1*(parseInt(t(366))/2)+parseInt(t(355))/3+-parseInt(t(365))/4*(parseInt(t(349))/5)+parseInt(t(344))/6*(-parseInt(t(354))/7)+parseInt(t(338))/8+-parseInt(t(329))/9*(-parseInt(t(353))/10)+-parseInt(t(372))/11)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();function d(t,e){t-=323;return h()[t]}const f=(t,e)=>{const n=d;if(!t||typeof t!==n(351))return void console[n(340)](n(362),t);(t=>{const e=d;if(typeof window!==e(335)&&window[e(345)])try{window.dataLayer.push(t),console[e(341)](e(363),t)}catch(t){console[e(340)](e(357),t)}else console[e(340)]("[GoogleTagManager] dataLayer not initialized")})({event:t,...e||{}})};function u(t,e){t-=450;return m()[t]}const I=u;function m(){const t=["gtmId","1576074megqxt","track","config","16256650SHrnCN","5301567iSWEpt","setUserProperties","setUserId","analytics","4602368mijOlC","6208705WnCKiG","firebase initialize failed:","debug","clearUserId","821018ZwoVvx","42hAYmVa","52602DfKbEs","initialized","7qYxxRx","4bqoUpP"];return(m=function(){return t})()}!function(){const t=u,e=m();for(;;)try{if(671476===parseInt(t(451))/1+parseInt(t(452))/2*(parseInt(t(453))/3)+-parseInt(t(456))/4*(parseInt(t(467))/5)+-parseInt(t(458))/6*(-parseInt(t(455))/7)+-parseInt(t(466))/8+-parseInt(t(462))/9+parseInt(t(461))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class w{constructor(t,e,n=!1){const s=u;this.analytics=null,this[s(454)]=!1,this.config=t,this[s(457)]=e,this[s(469)]=n}async initialize(){const n=u;if(!this[n(454)])try{const s=t.initializeApp(this[n(460)]);this[n(465)]=e.getAnalytics(s),this[n(457)]&&l(this.gtmId,this[n(469)]),this[n(454)]=!0}catch(t){throw console.error(n(468),t),t}}async[I(459)](t,e){}async[I(464)](t){}async[I(463)](t){}async[I(450)](){}}const g=y;function y(t,e){t-=289;return v()[t]}!function(){const t=y,e=v();for(;;)try{if(205539===-parseInt(t(313))/1*(parseInt(t(311))/2)+parseInt(t(322))/3*(-parseInt(t(307))/4)+-parseInt(t(304))/5+-parseInt(t(319))/6*(parseInt(t(317))/7)+parseInt(t(306))/8+parseInt(t(321))/9+parseInt(t(301))/10*(-parseInt(t(295))/11))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class k{constructor(t,e,n,s,r,i){const o=y;this[o(302)]=null,this.initialized=!1,this[o(325)]=t,this[o(297)]=e,this.version=n,this.env=s,this[o(293)]=r,this[o(298)]=i}async initialize(){const t=y;if(!this[t(299)])try{if(!i)throw new Error(t(310));this[t(302)]=i;const e=encodeURIComponent(this.token),n=encodeURIComponent(this.platform),s=encodeURIComponent(this[t(323)]),r=encodeURIComponent(this.env);this.sensors[t(324)]({server_url:this[t(298)][t(327)]+(t(314)+e+"&p=")+n+t(290)+s+t(320)+r,show_log:this[t(298)].showLog??!1,heatmap:this[t(298)][t(296)]??{},is_track_single_page:!0,send_type:t(316)}),this[t(299)]=!0,this.sensors.registerPage({app_id:this[t(293)]}),this[t(302)][t(294)]("autoTrack")}catch(t){throw console.error("sensors sdk init failed:",t),t}}async[g(289)](t,e){const n=g;if(this[n(299)]&&this[n(302)])try{this[n(302)][n(289)](t,e??{})}catch(t){console[n(309)](n(305),t)}else console[n(326)](n(292))}async[g(308)](t){const e=g;if(this[e(299)]&&this[e(302)])try{this[e(302)][e(303)](t)}catch(t){console.error(e(300),t)}else console[e(326)]("sensors sdk not initialized, skip setUserId")}async[g(318)](t){const e=g;if(this[e(299)]&&this.sensors)try{this[e(302)][e(312)](t)}catch(t){console[e(309)]("sensors sdk setUserProperties failed:",t)}else console[e(326)](e(291))}async clearUserId(){const t=g;if(this[t(299)]&&this[t(302)])try{this[t(302)].logout()}catch(e){console.error(t(315),e)}}}function v(){const t=["ajax","15603AZFrYb","setUserProperties","42KrppEC","&e=","2998404rCTxaK","3117yEGXzE","version","init","token","warn","serverUrl","track","&v=","sensors sdk not initialized, skip setUserProperties","sensors sdk not initialized, skip track","appID","quick","121IPDNCL","heatmap","platform","config","initialized","sensors sdk setUserId failed:","21580bdZSNM","sensors","login","291260QqjoDR","sensors sdk track failed:","2624208cTGfls","804fPpoRN","setUserId","error","sensors sdk not found, please install it by running","99474sfAhtD","setProfile","3iwcZOX","?t=","sensors sdk clearUserId failed:"];return(v=function(){return t})()}function b(){var t=["4875556pmzxgQ","3gFKezu","toString","1626916sUaern","2711400JGaXhs","571606OJrDEp","utf-8","base64","1150210jabUZk","undefined","from","parse","5843592lHJecC","btoa","1139624ceumfj","atob"];return(b=function(){return t})()}function z(t,e){return t-=376,b()[t]}function T(t){var e=z;return"undefined"!=typeof window&&window.btoa?window[e(378)](t):Buffer[e(391)](t,e(387))[e(383)]("base64")}function M(t){var e,n;return JSON[z(376)]((e=t,n=z,typeof window!==n(390)&&window[n(380)]?window[n(380)](e):Buffer[n(391)](e,n(388))[n(383)](n(387))))}!function(){for(var t=z,e=b();;)try{if(593885===parseInt(t(389))/1+-parseInt(t(386))/2+parseInt(t(382))/3*(parseInt(t(384))/4)+-parseInt(t(385))/5+-parseInt(t(377))/6+parseInt(t(381))/7+parseInt(t(379))/8)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const N=C;function C(t,e){t-=411;return Z()[t]}!function(){const t=C,e=Z();for(;;)try{if(873177===-parseInt(t(421))/1*(parseInt(t(422))/2)+parseInt(t(416))/3*(parseInt(t(428))/4)+-parseInt(t(420))/5*(-parseInt(t(425))/6)+parseInt(t(411))/7*(parseInt(t(426))/8)+parseInt(t(413))/9+parseInt(t(418))/10*(parseInt(t(417))/11)+-parseInt(t(419))/12)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const E={"MDE5YjUzNTEyMWJhNzc1ZmIwYTQ1MzY3Njg1NzU1MTU=":{providers:[exports.TrackProvider[N(415)],exports.TrackProvider[N(427)]],firebaseConfig:M(N(412)),sensorsConfig:M(N(423)),gtmId:"GTM-MJDRW2W4"},"MDE5YjUzNTE3ZmFiN2YxZDkwNjg5OWVhMGQyMWJlZGI=":{providers:[exports.TrackProvider.FIREBASE,exports.TrackProvider[N(427)]],firebaseConfig:M(N(424)),sensorsConfig:M(N(423))}};function Z(){const t=["11352bKyNdQ","eyJzZXJ2ZXJVcmwiOiJodHRwczovL3NlYXF1ZXJ5LnNlYXZlcnNlLmFpL3NhIiwiaGVhdG1hcCI6eyJjbGlja21hcCI6ImRlZmF1bHQiLCJzY3JvbGxfbm90aWNlX21hcCI6ImRlZmF1bHQifX0=","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjpkMTQ4OGM3MzI0MWIyZWMzNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctR0gxNk1CQ1NOVyJ9","37932ezKCTE","9470056jWTXeW","SENSORS","4248380ZzKHcW","7SnuYiE","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjo2NmI2ZTNmNmEwZjM2MDkwNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctN0gySjFTQ05QRCJ9","15090372RhPKUf","invalid token: ","FIREBASE","3QWrwBb","297ubycod","613210MHNJvA","67686744RPYvFV","1310aPGqxj","127KRdSrU"];return(Z=function(){return t})()}function j(){const t=["env","config","validateConfig","17eFwjXn","1264467mixELx","debug","push","5TrRfvY","SENSORS","initialized","set","length","platformConfig","13641705jHsoUq","3522996LqqIhY","setUserId","warn","Track SDK initialized, enabled providers:","token","error","initialize ","unknown provider: ","getInitializedProviders","clearUserId","[Track] Clear User ID","platform","initialize","[Track] Set User Properties:","[Track] Set User ID:","setUserProperties","version","gtmId","log","sensorsConfig","Must provide a token","[Track] ","keys","Invalid token: ","Must provide an env","Must provide an app_id","allSettled","local","4690254JJBfFK","Must provide a version","values","adapters","8563247naQNZh","[Track] Skip Firebase initialization (initializeFirebase = false)","Must provide a platform","from","8231600KvhNNS","142510YCtKUd","FIREBASE","Invalid env: ",". Must be one of: local, develop, production","track","track SDK not initialized, please call initialize() first"];return(j=function(){return t})()}const J=F;function F(t,e){t-=250;return j()[t]}!function(){const t=F,e=j();for(;;)try{if(797258===parseInt(t(275))/1*(parseInt(t(266))/2)+parseInt(t(276))/3+parseInt(t(286))/4*(-parseInt(t(279))/5)+parseInt(t(257))/6+-parseInt(t(261))/7+-parseInt(t(265))/8+parseInt(t(285))/9)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class TrackClient{constructor(t){const e=F;this.adapters=new Map,this[e(281)]=!1,this[e(273)]=t,this.validateConfig(),this[e(284)]=function(t){const e=N,n=T(t),s=E[n];if(!s)throw new Error(e(414)+t);return s}(t[e(290)])}[J(274)](){const t=J;if(!this[t(273)][t(290)])throw new Error(t(306));if(!this.config[t(297)])throw new Error(t(263));if(!this[t(273)][t(302)])throw new Error(t(258));if(!this[t(273)][t(272)])throw new Error(t(253));if(![t(256),"develop","production"].includes(this[t(273)][t(272)]))throw new Error(t(268)+this[t(273)][t(272)]+t(269));if(!this[t(273)].app_id)throw new Error(t(254));if(this[t(273)].app_id[t(283)]>36)throw new Error("app_id length cannot exceed 36 characters, got "+this.config.app_id[t(283)]);if(!(T(this[t(273)][t(290)])in E))throw new Error(t(252)+this[t(273)][t(290)])}async initialize(){const t=J;if(this.initialized)return;const e=[],n=!1!==this[t(273)].initializeFirebase;for(const s of this[t(284)].providers)try{if(s===exports.TrackProvider.FIREBASE&&!n){this.config[t(277)]&&console[t(304)](t(262));continue}let r;switch(s){case exports.TrackProvider[t(267)]:r=new w(this[t(284)].firebaseConfig,this.platformConfig[t(303)],this[t(273)].debug);break;case exports.TrackProvider[t(280)]:r=new k(this[t(273)][t(290)],this[t(273)][t(297)],this[t(273)][t(302)],this[t(273)][t(272)],this[t(273)].app_id,this.platformConfig[t(305)]);break;default:console[t(288)](t(293)+s);continue}this[t(260)][t(282)](s,r),e.push(r[t(298)]())}catch(e){console[t(291)](t(292)+s+" adapter failed:",e)}await Promise[t(255)](e),this[t(281)]=!0,await this.setUserProperties({app_id:this[t(273)].app_id}),this[t(273)][t(277)]&&console.log(t(289),Array[t(264)](this.adapters[t(251)]()))}async[J(270)](t,e){const n=J;if(!this[n(281)])return void console[n(288)](n(271));this[n(273)][n(277)]&&console[n(304)](n(250)+t,e);const s=[];for(const r of this[n(260)][n(259)]())s[n(278)](r[n(270)](t,e));await Promise.allSettled(s)}async[J(287)](t){const e=J;if(!this[e(281)])return void console[e(288)](e(271));this.config[e(277)]&&console[e(304)](e(300),t);const n=[];for(const s of this.adapters[e(259)]())n[e(278)](s[e(287)](t));await Promise.allSettled(n)}async[J(301)](t){const e=J;if(!this[e(281)])return void console.warn(e(271));this[e(273)][e(277)]&&console.log(e(299),t);const n=[];for(const s of this.adapters[e(259)]())n[e(278)](s[e(301)](t));await Promise[e(255)](n)}async[J(295)](){const t=J;if(!this[t(281)])return void console.warn(t(271));this[t(273)].debug&&console[t(304)](t(296));const e=[];for(const n of this.adapters[t(259)]())e[t(278)](n[t(295)]());await Promise[t(255)](e)}[J(294)](){const t=J;return Array.from(this[t(260)][t(251)]())}trackGTMEvent(t,e){f(t,e)}}function W(){var t=["1udoVST","49204NYgVAd","232zlNjfg","3824577PdqEKQ","1320666hDTIal","10283thQlrh","3150085cHWrNd","10cyEToN","3685099YCfMKp","7982436SFsHOy","6jTxzLU","156WYWJII"];return(W=function(){return t})()}function S(t,e){return t-=238,W()[t]}!function(){for(var t=S,e=W();;)try{if(462236===parseInt(t(239))/1*(parseInt(t(243))/2)+parseInt(t(238))/3*(parseInt(t(240))/4)+parseInt(t(245))/5*(parseInt(t(249))/6)+-parseInt(t(244))/7*(parseInt(t(241))/8)+-parseInt(t(242))/9+-parseInt(t(246))/10*(parseInt(t(247))/11)+-parseInt(t(248))/12)break;e.push(e.shift())}catch(t){e.push(e.shift())}}(),exports.TrackClient=TrackClient;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{initializeApp as t}from"firebase/app";import{getAnalytics as n}from"firebase/analytics";import*as e from"sa-sdk-javascript";function s(t,n){return t-=145,i()[t]}function i(){var t=["SENSORS","225DKyxPQ","1502464FQyWRQ","24255YLciCf","sensors","1662324tkBdVJ","4695735fjBJyL","1204390ISTziF","5173850fRWmIG","774eihcpk","FIREBASE","7085888kkNCmb"];return(i=function(){return t})()}var r,o,a;function c(){const t=["undefined","noscript","body","10gcwFgn","609348odctAS","[GTM] Injected successfully: ","4TjqvMf","style","script","8OajDnL","gtm.js","from","appendChild","[GoogleTagManager] Pushed to dataLayer:","28937CTSHVr","https://www.googletagmanager.com/gtm.js?id=","[GoogleTagManager] Invalid event name:","parentNode","insertBefore","632360EwSqlL","544460ZTUHUm","https://www.googletagmanager.com/ns.html?id=","[GoogleTagManager] Error pushing to dataLayer:","push","dataLayer","1768382tWjzCv","height","createElement","[GTM] Not in browser environment, skip injection","string","[GTM] Already injected, skip","warn","async","81858FZxIOS","none","display","width","getElementsByTagName","some","DOMContentLoaded","9IwscGy","gtm.js?id=","[GoogleTagManager] dataLayer not initialized","[GTM] Injection failed:","[GTM] GTM ID is empty, skip injection","getTime","error","log","src","362075nmekKO","visibility","includes","firstChild","head"];return(c=function(){return t})()}function l(){const t=h;return typeof window!==t(189)&&typeof document!==t(189)}function h(t,n){t-=144;return c()[t]}function p(t){const n=h,e=document[n(162)](n(190)),s=document[n(162)]("iframe");s[n(183)]=n(156)+t,s[n(161)]="0",s[n(171)]="0",s[n(196)][n(170)]=n(169),s.style[n(185)]="hidden",e[n(147)](s),document[n(191)][n(187)]?document[n(191)][n(153)](e,document[n(191)][n(187)]):document.body[n(147)](e)}function d(t,n=!1){const e=h;if(l())if(t)if(function(t){const n=h;if(!l())return!1;const e=!!window[n(159)],s=document.querySelectorAll(n(197)),i=Array[n(146)](s)[n(173)](e=>e[n(183)][n(186)](n(176)+t));return e&&i}(t))n&&console.log(e(165));else try{(function(t){const n=h;window[n(159)]=window.dataLayer||[],window[n(159)][n(158)]({"gtm.start":(new Date)[n(180)](),event:n(145)});const e=document[n(162)](n(197));e[n(167)]=!0,e[n(183)]=n(150)+t;const s=document[n(172)](n(197))[0];s&&s[n(152)]?s[n(152)].insertBefore(e,s):document[n(188)][n(147)](e)})(t),document[e(191)]?p(t):document.addEventListener(e(174),()=>{p(t)}),n&&console[e(182)](e(194)+t)}catch(t){console[e(181)](e(178),t)}else n&&console.warn(e(179));else n&&console[e(166)](e(163))}!function(){for(var t=s,n=i();;)try{if(971666===-parseInt(t(151))/1+-parseInt(t(149))/2+parseInt(t(150))/3+-parseInt(t(155))/4+-parseInt(t(152))/5+parseInt(t(153))/6*(-parseInt(t(147))/7)+-parseInt(t(146))/8*(-parseInt(t(145))/9))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(),(o=r||(r={}))[(a=s)(154)]="firebase",o[a(156)]=a(148),function(){const t=h,n=c();for(;;)try{if(113668===-parseInt(t(149))/1*(-parseInt(t(144))/2)+-parseInt(t(168))/3*(parseInt(t(195))/4)+-parseInt(t(184))/5+parseInt(t(193))/6+parseInt(t(155))/7+-parseInt(t(154))/8*(-parseInt(t(175))/9)+-parseInt(t(192))/10*(parseInt(t(160))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}();const f=(t,n)=>{const e=h;if(!t||typeof t!==e(164))return void console[e(181)](e(151),t);(t=>{const n=h;if(typeof window!==n(189)&&window[n(159)])try{window[n(159)][n(158)](t),console[n(182)](n(148),t)}catch(t){console[n(181)](n(157),t)}else console[n(181)](n(177))})({event:t,...n||{}})},u=I;function I(t,n){t-=257;return m()[t]}function m(){const t=["setUserId","5sFuAHL","547688IEGtxf","4012281tImYbC","track","analytics","1197TmPoWV","debug","6773184OmTofs","firebase initialize failed:","config","clearUserId","2516484inCSFz","initialize","initialized","300546ThjMQJ","setUserProperties","404950QLVXne","5840WThhYr","gtmId"];return(m=function(){return t})()}!function(){const t=I,n=m();for(;;)try{if(353415===parseInt(t(258))/1+-parseInt(t(260))/2+-parseInt(t(269))/3*(parseInt(t(261))/4)+parseInt(t(264))/5*(-parseInt(t(275))/6)+parseInt(t(266))/7+-parseInt(t(265))/8+parseInt(t(271))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}();class w{constructor(t,n,e=!1){const s=I;this[s(268)]=null,this.initialized=!1,this[s(273)]=t,this[s(262)]=n,this[s(270)]=e}async[u(276)](){const e=u;if(!this[e(257)])try{const s=t(this[e(273)]);this[e(268)]=n(s),this[e(262)]&&d(this[e(262)],this.debug),this[e(257)]=!0}catch(t){throw console.error(e(272),t),t}}async[u(267)](t,n){}async[u(263)](t){}async[u(259)](t){}async[u(274)](){}}function y(t,n){t-=217;return v()[t]}const k=y;!function(){const t=y,n=v();for(;;)try{if(231520===parseInt(t(233))/1+-parseInt(t(221))/2+parseInt(t(218))/3+-parseInt(t(235))/4*(-parseInt(t(243))/5)+-parseInt(t(247))/6*(-parseInt(t(239))/7)+-parseInt(t(253))/8*(-parseInt(t(222))/9)+-parseInt(t(238))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}();class g{constructor(t,n,e,s,i){const r=y;this.sensors=null,this[r(250)]=!1,this.token=t,this.platform=n,this.version=e,this[r(251)]=s,this[r(225)]=i}async[k(229)](){const t=k;if(!this.initialized)try{if(!e)throw new Error("sensors sdk not found, please install it by running");this.sensors=e;const n=encodeURIComponent(this[t(217)]),s=encodeURIComponent(this[t(246)]),i=encodeURIComponent(this[t(241)]),r=encodeURIComponent(this.env);this[t(224)][t(255)]({server_url:this[t(225)].serverUrl+(t(230)+n+t(227)+s+t(226)+i+"&e=")+r,show_log:this[t(225)].showLog??!1,heatmap:this[t(225)][t(236)]??{},is_track_single_page:!0,send_type:t(242)}),this[t(250)]=!0,this[t(224)].quick(t(249))}catch(n){throw console[t(252)](t(240),n),n}}async[k(219)](t,n){const e=k;if(this[e(250)]&&this[e(224)])try{this[e(224)][e(219)](t,n??{})}catch(t){console[e(252)](e(244),t)}else console[e(237)](e(245))}async setUserId(t){const n=k;if(this[n(250)]&&this[n(224)])try{this[n(224)][n(231)](t)}catch(t){console.error(n(254),t)}else console[n(237)](n(220))}async setUserProperties(t){const n=k;if(this[n(250)]&&this[n(224)])try{this[n(224)][n(248)](t)}catch(t){console[n(252)](n(223),t)}else console[n(237)](n(232))}async clearUserId(){const t=k;if(this[t(250)]&&this[t(224)])try{this.sensors[t(234)]()}catch(n){console[t(252)](t(228),n)}}}function v(){const t=["14zQoHvd","sensors sdk init failed:","version","ajax","255105khKncM","sensors sdk track failed:","sensors sdk not initialized, skip track","platform","282726HFfvFk","setProfile","autoTrack","initialized","env","error","8WcToMS","sensors sdk setUserId failed:","init","token","1347612CauuVl","track","sensors sdk not initialized, skip setUserId","14720hAiWHz","3484917dZpKwy","sensors sdk setUserProperties failed:","sensors","config","&v=","&p=","sensors sdk clearUserId failed:","initialize","?t=","login","sensors sdk not initialized, skip setUserProperties","179659qFsMuu","logout","32kzHqjM","heatmap","warn","12796060oYuXYR"];return(v=function(){return t})()}function z(t,n){return t-=464,M()[t]}function M(){var t=["undefined","from","91497WKggjK","btoa","4468dGlbVi","8371arVtpN","936BSHhes","48VaxXLZ","2465zEsmLo","toString","150YgPPnb","55778fedGdm","atob","4010HmGkQA","333412fJBTxa","utf-8","3159uIaxGh","16720176eXMzhp"];return(M=function(){return t})()}function b(t){var n=z;return typeof window!==n(466)&&window.btoa?window[n(469)](t):Buffer[n(467)](t,"utf-8")[n(475)]("base64")}function Z(t){return JSON.parse((n=t,e=z,"undefined"!=typeof window&&window[e(478)]?window[e(478)](n):Buffer[e(467)](n,"base64")[e(475)](e(481))));var n,e}!function(){for(var t=z,n=M();;)try{if(282476===-parseInt(t(480))/1+-parseInt(t(477))/2*(-parseInt(t(473))/3)+parseInt(t(470))/4*(-parseInt(t(474))/5)+parseInt(t(476))/6*(-parseInt(t(468))/7)+-parseInt(t(472))/8*(parseInt(t(464))/9)+parseInt(t(479))/10*(-parseInt(t(471))/11)+parseInt(t(465))/12)break;n.push(n.shift())}catch(t){n.push(n.shift())}}();const N=E;function T(){const t=["595847mXuFFF","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjo2NmI2ZTNmNmEwZjM2MDkwNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctN0gySjFTQ05QRCJ9","548830hCqPdL","1913228ekLxSO","778674UciUxE","SENSORS","1706409PkkiHx","40HzRDuf","3170532agrNch","2qkJbMo","GTM-MJDRW2W4","103303xHtaGf","eyJzZXJ2ZXJVcmwiOiJodHRwczovL3N2LWFuYWx5dGljcy5zZy5zZWF2ZXJzZS5haS9zYSIsImhlYXRtYXAiOnsiY2xpY2ttYXAiOiJkZWZhdWx0Iiwic2Nyb2xsX25vdGljZV9tYXAiOiJkZWZhdWx0In19","FIREBASE"];return(T=function(){return t})()}!function(){const t=E,n=T();for(;;)try{if(292418===-parseInt(t(208))/1*(parseInt(t(220))/2)+parseInt(t(215))/3+-parseInt(t(214))/4+parseInt(t(213))/5+-parseInt(t(219))/6+parseInt(t(211))/7+parseInt(t(218))/8*(parseInt(t(217))/9))break;n.push(n.shift())}catch(t){n.push(n.shift())}}();const W={"MDE5YjUzNTEyMWJhNzc1ZmIwYTQ1MzY3Njg1NzU1MTU=":{providers:[r.FIREBASE,r[N(216)]],firebaseConfig:Z(N(212)),sensorsConfig:Z(N(209)),gtmId:N(221)},"MDE5YjUzNTE3ZmFiN2YxZDkwNjg5OWVhMGQyMWJlZGI=":{providers:[r[N(210)],r.SENSORS],firebaseConfig:Z("eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjpkMTQ4OGM3MzI0MWIyZWMzNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctR0gxNk1CQ1NOVyJ9"),sensorsConfig:Z(N(209))}};function E(t,n){t-=208;return T()[t]}function F(t,n){t-=191;return C()[t]}const S=F;function C(){const t=["Must provide a token","setUserId","initialize","658dntqqX","set","SENSORS","local","[Track] Skip Firebase initialization (initializeFirebase = false)","273482IlEMCo","keys","58458JEEocZ","firebaseConfig","Invalid token: ","from","unknown provider: ","21VIqoRF","[Track] Set User ID:","warn","includes","platform","initialize ","Invalid env: ","Must provide a platform","788227LWntaN","15TFUqlb"," adapter failed:","6996368dupDOt","9RMBIwE","validateConfig","log","setUserProperties","values","env","[Track] ","initialized","Must provide a version","sensorsConfig","app_id","allSettled","Track SDK initialized, enabled providers:","4102020vXutwp","[Track] Set User Properties:","providers","config","10845560HBXtYT","clearUserId","81032vXUKlc","debug","track","adapters","length","initializeFirebase","version","Must provide an env",". Must be one of: local, develop, production","FIREBASE","getInitializedProviders","error","gtmId","track SDK not initialized, please call initialize() first","push","platformConfig"];return(C=function(){return t})()}!function(){const t=F,n=C();for(;;)try{if(681506===-parseInt(t(236))/1+parseInt(t(221))/2*(-parseInt(t(228))/3)+parseInt(t(197))/4*(parseInt(t(237))/5)+-parseInt(t(223))/6*(-parseInt(t(216))/7)+parseInt(t(239))/8*(parseInt(t(240))/9)+-parseInt(t(191))/10+parseInt(t(195))/11)break;n.push(n.shift())}catch(t){n.push(n.shift())}}();class TrackClient{constructor(t){const n=F;this.adapters=new Map,this[n(247)]=!1,this[n(194)]=t,this[n(241)](),this[n(212)]=function(t){const n=b(t),e=W[n];if(!e)throw new Error("invalid token: "+t);return e}(t.token)}validateConfig(){const t=F;if(!this[t(194)].token)throw new Error(t(213));if(!this[t(194)][t(232)])throw new Error(t(235));if(!this[t(194)][t(203)])throw new Error(t(248));if(!this[t(194)][t(245)])throw new Error(t(204));if(![t(219),"develop","production"][t(231)](this.config.env))throw new Error(t(234)+this[t(194)][t(245)]+t(205));if(!this[t(194)].app_id)throw new Error("Must provide an app_id");if(this[t(194)][t(250)][t(201)]>36)throw new Error("app_id length cannot exceed 36 characters, got "+this[t(194)][t(250)][t(201)]);if(!(b(this[t(194)].token)in W))throw new Error(t(225)+this[t(194)].token)}async[S(215)](){const t=S;if(this[t(247)])return;const n=[],e=!1!==this.config[t(202)];for(const s of this[t(212)][t(193)])try{if(s===r[t(206)]&&!e){this[t(194)][t(198)]&&console[t(242)](t(220));continue}let i;switch(s){case r[t(206)]:i=new w(this[t(212)][t(224)],this.platformConfig[t(209)],this[t(194)][t(198)]);break;case r[t(218)]:i=new g(this.config.token,this[t(194)][t(232)],this[t(194)][t(203)],this[t(194)].env,this[t(212)][t(249)]);break;default:console[t(230)](t(227)+s);continue}this[t(200)][t(217)](s,i),n[t(211)](i.initialize())}catch(n){console[t(208)](t(233)+s+t(238),n)}await Promise[t(251)](n),this.initialized=!0,await this[t(243)]({app_id:this[t(194)][t(250)]}),this[t(194)].debug&&console[t(242)](t(252),Array[t(226)](this[t(200)][t(222)]()))}async[S(199)](t,n){const e=S;if(!this[e(247)])return void console.warn("track SDK not initialized, please call initialize() first");this.config[e(198)]&&console[e(242)](e(246)+t,n);const s=[];for(const i of this[e(200)][e(244)]())s[e(211)](i[e(199)](t,n));await Promise[e(251)](s)}async[S(214)](t){const n=S;if(!this[n(247)])return void console[n(230)](n(210));this[n(194)][n(198)]&&console.log(n(229),t);const e=[];for(const s of this[n(200)][n(244)]())e.push(s[n(214)](t));await Promise[n(251)](e)}async[S(243)](t){const n=S;if(!this[n(247)])return void console.warn(n(210));this[n(194)][n(198)]&&console[n(242)](n(192),t);const e=[];for(const s of this[n(200)][n(244)]())e[n(211)](s[n(243)](t));await Promise[n(251)](e)}async clearUserId(){const t=S;if(!this.initialized)return void console[t(230)]("track SDK not initialized, please call initialize() first");this.config.debug&&console.log("[Track] Clear User ID");const n=[];for(const e of this[t(200)][t(244)]())n[t(211)](e[t(196)]());await Promise[t(251)](n)}[S(207)](){return Array[S(226)](this.adapters.keys())}trackGTMEvent(t,n){f(t,n)}}function J(){var t=["18402AZDXSt","22NYcgcs","2VLpCbj","4906782rHYynK","163150eqfZWN","698056YvvtfR","1005756QORGNx","1400408YAwWrP","7eypPnq","2599860VXANwm","520MNmoFn"];return(J=function(){return t})()}function Y(t,n){return t-=414,J()[t]}!function(){for(var t=Y,n=J();;)try{if(315719===-parseInt(t(416))/1+parseInt(t(414))/2*(parseInt(t(418))/3)+parseInt(t(419))/4+-parseInt(t(422))/5*(parseInt(t(423))/6)+-parseInt(t(420))/7*(-parseInt(t(417))/8)+parseInt(t(415))/9+-parseInt(t(421))/10*(parseInt(t(424))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}();export{TrackClient,r as TrackProvider};
1
+ import{initializeApp as t}from"firebase/app";import{getAnalytics as n}from"firebase/analytics";import*as s from"sa-sdk-javascript";function e(){var t=["44CyMlgb","5062914Ezugap","firebase","218559KWbOJZ","308426hLKLXV","FIREBASE","15107552uFLDTB","3143280SKhgjT","1145672pyJqXf","sensors","5892068CpRmgI"];return(e=function(){return t})()}var i,r,o;function a(t,n){return t-=273,e()[t]}function c(){const t=d;return typeof window!==t(335)&&typeof document!==t(335)}function p(t){const n=d,s=document[n(346)](n(327)),e=document[n(346)](n(325));e[n(324)]=n(356)+t,e[n(339)]="0",e[n(333)]="0",e[n(361)][n(367)]=n(352),e[n(361)][n(371)]="hidden",s[n(348)](e),document[n(364)].firstChild?document[n(364)][n(334)](s,document[n(364)][n(360)]):document[n(364)][n(348)](s)}function h(t,n=!1){const s=d;if(c())if(t)if(function(t){const n=d;if(!c())return!1;const s=!!window[n(345)],e=document[n(347)](n(373)),i=Array[n(337)](e)[n(336)](s=>s.src[n(358)](n(370)+t));return s&&i}(t))n&&console.log("[GTM] Already injected, skip");else try{(function(t){const n=d;window[n(345)]=window[n(345)]||[],window[n(345)][n(331)]({"gtm.start":(new Date)[n(342)](),event:"gtm.js"});const s=document[n(346)](n(373));s[n(368)]=!0,s[n(324)]=n(350)+t;const e=document.getElementsByTagName(n(373))[0];e&&e.parentNode?e[n(343)][n(334)](s,e):document.head[n(348)](s)})(t),document[s(364)]?p(t):document[s(332)](s(326),()=>{p(t)}),n&&console[s(341)](s(328)+t)}catch(t){console[s(340)](s(330),t)}else n&&console[s(374)](s(323));else n&&console[s(374)](s(359))}function l(){const t=["[GoogleTagManager] Invalid event name:","[GoogleTagManager] Pushed to dataLayer:","body","8FuYthL","8juwNcG","display","async","48634uGtbug","gtm.js?id=","visibility","568546HsvYvj","script","warn","[GTM] GTM ID is empty, skip injection","src","iframe","DOMContentLoaded","noscript","[GTM] Injected successfully: ","577602IyxTFm","[GTM] Injection failed:","push","addEventListener","width","insertBefore","undefined","some","from","1720496mxEBNk","height","error","log","getTime","parentNode","2972334uKAvXq","dataLayer","createElement","querySelectorAll","appendChild","1316435CxAjnP","https://www.googletagmanager.com/gtm.js?id=","string","none","70tYukmS","7plMUXV","1461429VDTCbf","https://www.googletagmanager.com/ns.html?id=","[GoogleTagManager] Error pushing to dataLayer:","includes","[GTM] Not in browser environment, skip injection","firstChild","style"];return(l=function(){return t})()}!function(){for(var t=a,n=e();;)try{if(505634===parseInt(t(279))/1+parseInt(t(283))/2+parseInt(t(278))/3*(-parseInt(t(275))/4)+parseInt(t(282))/5+parseInt(t(276))/6+parseInt(t(274))/7+-parseInt(t(281))/8)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(),(r=i||(i={}))[(o=a)(280)]=o(277),r.SENSORS=o(273),function(){const t=d,n=l();for(;;)try{if(272338===parseInt(t(369))/1*(parseInt(t(366))/2)+parseInt(t(355))/3+-parseInt(t(365))/4*(parseInt(t(349))/5)+parseInt(t(344))/6*(-parseInt(t(354))/7)+parseInt(t(338))/8+-parseInt(t(329))/9*(-parseInt(t(353))/10)+-parseInt(t(372))/11)break;n.push(n.shift())}catch(t){n.push(n.shift())}}();function d(t,n){t-=323;return l()[t]}const f=(t,n)=>{const s=d;if(!t||typeof t!==s(351))return void console[s(340)](s(362),t);(t=>{const n=d;if(typeof window!==n(335)&&window[n(345)])try{window.dataLayer.push(t),console[n(341)](n(363),t)}catch(t){console[n(340)](n(357),t)}else console[n(340)]("[GoogleTagManager] dataLayer not initialized")})({event:t,...n||{}})};function u(t,n){t-=450;return m()[t]}const I=u;function m(){const t=["gtmId","1576074megqxt","track","config","16256650SHrnCN","5301567iSWEpt","setUserProperties","setUserId","analytics","4602368mijOlC","6208705WnCKiG","firebase initialize failed:","debug","clearUserId","821018ZwoVvx","42hAYmVa","52602DfKbEs","initialized","7qYxxRx","4bqoUpP"];return(m=function(){return t})()}!function(){const t=u,n=m();for(;;)try{if(671476===parseInt(t(451))/1+parseInt(t(452))/2*(parseInt(t(453))/3)+-parseInt(t(456))/4*(parseInt(t(467))/5)+-parseInt(t(458))/6*(-parseInt(t(455))/7)+-parseInt(t(466))/8+-parseInt(t(462))/9+parseInt(t(461))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}();class w{constructor(t,n,s=!1){const e=u;this.analytics=null,this[e(454)]=!1,this.config=t,this[e(457)]=n,this[e(469)]=s}async initialize(){const s=u;if(!this[s(454)])try{const e=t(this[s(460)]);this[s(465)]=n(e),this[s(457)]&&h(this.gtmId,this[s(469)]),this[s(454)]=!0}catch(t){throw console.error(s(468),t),t}}async[I(459)](t,n){}async[I(464)](t){}async[I(463)](t){}async[I(450)](){}}const g=y;function y(t,n){t-=289;return v()[t]}!function(){const t=y,n=v();for(;;)try{if(205539===-parseInt(t(313))/1*(parseInt(t(311))/2)+parseInt(t(322))/3*(-parseInt(t(307))/4)+-parseInt(t(304))/5+-parseInt(t(319))/6*(parseInt(t(317))/7)+parseInt(t(306))/8+parseInt(t(321))/9+parseInt(t(301))/10*(-parseInt(t(295))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}();class k{constructor(t,n,s,e,i,r){const o=y;this[o(302)]=null,this.initialized=!1,this[o(325)]=t,this[o(297)]=n,this.version=s,this.env=e,this[o(293)]=i,this[o(298)]=r}async initialize(){const t=y;if(!this[t(299)])try{if(!s)throw new Error(t(310));this[t(302)]=s;const n=encodeURIComponent(this.token),e=encodeURIComponent(this.platform),i=encodeURIComponent(this[t(323)]),r=encodeURIComponent(this.env);this.sensors[t(324)]({server_url:this[t(298)][t(327)]+(t(314)+n+"&p=")+e+t(290)+i+t(320)+r,show_log:this[t(298)].showLog??!1,heatmap:this[t(298)][t(296)]??{},is_track_single_page:!0,send_type:t(316)}),this[t(299)]=!0,this.sensors.registerPage({app_id:this[t(293)]}),this[t(302)][t(294)]("autoTrack")}catch(t){throw console.error("sensors sdk init failed:",t),t}}async[g(289)](t,n){const s=g;if(this[s(299)]&&this[s(302)])try{this[s(302)][s(289)](t,n??{})}catch(t){console[s(309)](s(305),t)}else console[s(326)](s(292))}async[g(308)](t){const n=g;if(this[n(299)]&&this[n(302)])try{this[n(302)][n(303)](t)}catch(t){console.error(n(300),t)}else console[n(326)]("sensors sdk not initialized, skip setUserId")}async[g(318)](t){const n=g;if(this[n(299)]&&this.sensors)try{this[n(302)][n(312)](t)}catch(t){console[n(309)]("sensors sdk setUserProperties failed:",t)}else console[n(326)](n(291))}async clearUserId(){const t=g;if(this[t(299)]&&this[t(302)])try{this[t(302)].logout()}catch(n){console.error(t(315),n)}}}function v(){const t=["ajax","15603AZFrYb","setUserProperties","42KrppEC","&e=","2998404rCTxaK","3117yEGXzE","version","init","token","warn","serverUrl","track","&v=","sensors sdk not initialized, skip setUserProperties","sensors sdk not initialized, skip track","appID","quick","121IPDNCL","heatmap","platform","config","initialized","sensors sdk setUserId failed:","21580bdZSNM","sensors","login","291260QqjoDR","sensors sdk track failed:","2624208cTGfls","804fPpoRN","setUserId","error","sensors sdk not found, please install it by running","99474sfAhtD","setProfile","3iwcZOX","?t=","sensors sdk clearUserId failed:"];return(v=function(){return t})()}function b(){var t=["4875556pmzxgQ","3gFKezu","toString","1626916sUaern","2711400JGaXhs","571606OJrDEp","utf-8","base64","1150210jabUZk","undefined","from","parse","5843592lHJecC","btoa","1139624ceumfj","atob"];return(b=function(){return t})()}function z(t,n){return t-=376,b()[t]}function M(t){var n=z;return"undefined"!=typeof window&&window.btoa?window[n(378)](t):Buffer[n(391)](t,n(387))[n(383)]("base64")}function N(t){var n,s;return JSON[z(376)]((n=t,s=z,typeof window!==s(390)&&window[s(380)]?window[s(380)](n):Buffer[s(391)](n,s(388))[s(383)](s(387))))}!function(){for(var t=z,n=b();;)try{if(593885===parseInt(t(389))/1+-parseInt(t(386))/2+parseInt(t(382))/3*(parseInt(t(384))/4)+-parseInt(t(385))/5+-parseInt(t(377))/6+parseInt(t(381))/7+parseInt(t(379))/8)break;n.push(n.shift())}catch(t){n.push(n.shift())}}();const C=E;function E(t,n){t-=411;return Z()[t]}!function(){const t=E,n=Z();for(;;)try{if(873177===-parseInt(t(421))/1*(parseInt(t(422))/2)+parseInt(t(416))/3*(parseInt(t(428))/4)+-parseInt(t(420))/5*(-parseInt(t(425))/6)+parseInt(t(411))/7*(parseInt(t(426))/8)+parseInt(t(413))/9+parseInt(t(418))/10*(parseInt(t(417))/11)+-parseInt(t(419))/12)break;n.push(n.shift())}catch(t){n.push(n.shift())}}();const T={"MDE5YjUzNTEyMWJhNzc1ZmIwYTQ1MzY3Njg1NzU1MTU=":{providers:[i[C(415)],i[C(427)]],firebaseConfig:N(C(412)),sensorsConfig:N(C(423)),gtmId:"GTM-MJDRW2W4"},"MDE5YjUzNTE3ZmFiN2YxZDkwNjg5OWVhMGQyMWJlZGI=":{providers:[i.FIREBASE,i[C(427)]],firebaseConfig:N(C(424)),sensorsConfig:N(C(423))}};function Z(){const t=["11352bKyNdQ","eyJzZXJ2ZXJVcmwiOiJodHRwczovL3NlYXF1ZXJ5LnNlYXZlcnNlLmFpL3NhIiwiaGVhdG1hcCI6eyJjbGlja21hcCI6ImRlZmF1bHQiLCJzY3JvbGxfbm90aWNlX21hcCI6ImRlZmF1bHQifX0=","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjpkMTQ4OGM3MzI0MWIyZWMzNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctR0gxNk1CQ1NOVyJ9","37932ezKCTE","9470056jWTXeW","SENSORS","4248380ZzKHcW","7SnuYiE","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjo2NmI2ZTNmNmEwZjM2MDkwNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctN0gySjFTQ05QRCJ9","15090372RhPKUf","invalid token: ","FIREBASE","3QWrwBb","297ubycod","613210MHNJvA","67686744RPYvFV","1310aPGqxj","127KRdSrU"];return(Z=function(){return t})()}function J(){const t=["env","config","validateConfig","17eFwjXn","1264467mixELx","debug","push","5TrRfvY","SENSORS","initialized","set","length","platformConfig","13641705jHsoUq","3522996LqqIhY","setUserId","warn","Track SDK initialized, enabled providers:","token","error","initialize ","unknown provider: ","getInitializedProviders","clearUserId","[Track] Clear User ID","platform","initialize","[Track] Set User Properties:","[Track] Set User ID:","setUserProperties","version","gtmId","log","sensorsConfig","Must provide a token","[Track] ","keys","Invalid token: ","Must provide an env","Must provide an app_id","allSettled","local","4690254JJBfFK","Must provide a version","values","adapters","8563247naQNZh","[Track] Skip Firebase initialization (initializeFirebase = false)","Must provide a platform","from","8231600KvhNNS","142510YCtKUd","FIREBASE","Invalid env: ",". Must be one of: local, develop, production","track","track SDK not initialized, please call initialize() first"];return(J=function(){return t})()}const F=j;function j(t,n){t-=250;return J()[t]}!function(){const t=j,n=J();for(;;)try{if(797258===parseInt(t(275))/1*(parseInt(t(266))/2)+parseInt(t(276))/3+parseInt(t(286))/4*(-parseInt(t(279))/5)+parseInt(t(257))/6+-parseInt(t(261))/7+-parseInt(t(265))/8+parseInt(t(285))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}();class TrackClient{constructor(t){const n=j;this.adapters=new Map,this[n(281)]=!1,this[n(273)]=t,this.validateConfig(),this[n(284)]=function(t){const n=C,s=M(t),e=T[s];if(!e)throw new Error(n(414)+t);return e}(t[n(290)])}[F(274)](){const t=F;if(!this[t(273)][t(290)])throw new Error(t(306));if(!this.config[t(297)])throw new Error(t(263));if(!this[t(273)][t(302)])throw new Error(t(258));if(!this[t(273)][t(272)])throw new Error(t(253));if(![t(256),"develop","production"].includes(this[t(273)][t(272)]))throw new Error(t(268)+this[t(273)][t(272)]+t(269));if(!this[t(273)].app_id)throw new Error(t(254));if(this[t(273)].app_id[t(283)]>36)throw new Error("app_id length cannot exceed 36 characters, got "+this.config.app_id[t(283)]);if(!(M(this[t(273)][t(290)])in T))throw new Error(t(252)+this[t(273)][t(290)])}async initialize(){const t=F;if(this.initialized)return;const n=[],s=!1!==this[t(273)].initializeFirebase;for(const e of this[t(284)].providers)try{if(e===i.FIREBASE&&!s){this.config[t(277)]&&console[t(304)](t(262));continue}let r;switch(e){case i[t(267)]:r=new w(this[t(284)].firebaseConfig,this.platformConfig[t(303)],this[t(273)].debug);break;case i[t(280)]:r=new k(this[t(273)][t(290)],this[t(273)][t(297)],this[t(273)][t(302)],this[t(273)][t(272)],this[t(273)].app_id,this.platformConfig[t(305)]);break;default:console[t(288)](t(293)+e);continue}this[t(260)][t(282)](e,r),n.push(r[t(298)]())}catch(n){console[t(291)](t(292)+e+" adapter failed:",n)}await Promise[t(255)](n),this[t(281)]=!0,await this.setUserProperties({app_id:this[t(273)].app_id}),this[t(273)][t(277)]&&console.log(t(289),Array[t(264)](this.adapters[t(251)]()))}async[F(270)](t,n){const s=F;if(!this[s(281)])return void console[s(288)](s(271));this[s(273)][s(277)]&&console[s(304)](s(250)+t,n);const e=[];for(const i of this[s(260)][s(259)]())e[s(278)](i[s(270)](t,n));await Promise.allSettled(e)}async[F(287)](t){const n=F;if(!this[n(281)])return void console[n(288)](n(271));this.config[n(277)]&&console[n(304)](n(300),t);const s=[];for(const e of this.adapters[n(259)]())s[n(278)](e[n(287)](t));await Promise.allSettled(s)}async[F(301)](t){const n=F;if(!this[n(281)])return void console.warn(n(271));this[n(273)][n(277)]&&console.log(n(299),t);const s=[];for(const e of this.adapters[n(259)]())s[n(278)](e[n(301)](t));await Promise[n(255)](s)}async[F(295)](){const t=F;if(!this[t(281)])return void console.warn(t(271));this[t(273)].debug&&console[t(304)](t(296));const n=[];for(const s of this.adapters[t(259)]())n[t(278)](s[t(295)]());await Promise[t(255)](n)}[F(294)](){const t=F;return Array.from(this[t(260)][t(251)]())}trackGTMEvent(t,n){f(t,n)}}function W(){var t=["1udoVST","49204NYgVAd","232zlNjfg","3824577PdqEKQ","1320666hDTIal","10283thQlrh","3150085cHWrNd","10cyEToN","3685099YCfMKp","7982436SFsHOy","6jTxzLU","156WYWJII"];return(W=function(){return t})()}function S(t,n){return t-=238,W()[t]}!function(){for(var t=S,n=W();;)try{if(462236===parseInt(t(239))/1*(parseInt(t(243))/2)+parseInt(t(238))/3*(parseInt(t(240))/4)+parseInt(t(245))/5*(parseInt(t(249))/6)+-parseInt(t(244))/7*(parseInt(t(241))/8)+-parseInt(t(242))/9+-parseInt(t(246))/10*(parseInt(t(247))/11)+-parseInt(t(248))/12)break;n.push(n.shift())}catch(t){n.push(n.shift())}}();export{TrackClient,i as TrackProvider};