dishub-analytics.dashboard 1.0.2 → 1.0.4
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/components/HeatmapVisualizer.d.ts +4 -1
- package/dist/index.es.js +936 -897
- package/dist/index.umd.js +22 -22
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(W,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],O):(W=typeof globalThis<"u"?globalThis:W||self,O(W.DishubAnalyticsDashboard={},W.React))})(this,function(W,O){"use strict";function dt(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var
|
|
1
|
+
(function(W,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],O):(W=typeof globalThis<"u"?globalThis:W||self,O(W.DishubAnalyticsDashboard={},W.React))})(this,function(W,O){"use strict";function dt(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ge={exports:{}},Se={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ht;function cr(){if(ht)return Se;ht=1;var i=Symbol.for("react.transitional.element"),d=Symbol.for("react.fragment");function c(o,l,h){var u=null;if(h!==void 0&&(u=""+h),l.key!==void 0&&(u=""+l.key),"key"in l){h={};for(var
|
|
9
|
+
*/var ht;function cr(){if(ht)return Se;ht=1;var i=Symbol.for("react.transitional.element"),d=Symbol.for("react.fragment");function c(o,l,h){var u=null;if(h!==void 0&&(u=""+h),l.key!==void 0&&(u=""+l.key),"key"in l){h={};for(var b in l)b!=="key"&&(h[b]=l[b])}else h=l;return l=h.ref,{$$typeof:i,type:o,key:u,ref:l!==void 0?l:null,props:h}}return Se.Fragment=d,Se.jsx=c,Se.jsxs=c,Se}var Ce={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var ut;function dr(){return ut||(ut=1,process.env.NODE_ENV!=="production"&&function(){function i(g){if(g==null)return null;if(typeof g=="function")return g.$$typeof===te?null:g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case m:return"Fragment";case
|
|
17
|
+
*/var ut;function dr(){return ut||(ut=1,process.env.NODE_ENV!=="production"&&function(){function i(g){if(g==null)return null;if(typeof g=="function")return g.$$typeof===te?null:g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case m:return"Fragment";case _:return"Profiler";case x:return"StrictMode";case L:return"Suspense";case j:return"SuspenseList";case X:return"Activity"}if(typeof g=="object")switch(typeof g.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),g.$$typeof){case y:return"Portal";case E:return g.displayName||"Context";case P:return(g._context.displayName||"Context")+".Consumer";case H:var R=g.render;return g=g.displayName,g||(g=R.displayName||R.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case A:return R=g.displayName||null,R!==null?R:i(g.type)||"Memo";case G:R=g._payload,g=g._init;try{return i(g(R))}catch{}}return null}function d(g){return""+g}function c(g){try{d(g);var R=!1}catch{R=!0}if(R){R=console;var q=R.error,K=typeof Symbol=="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object";return q.call(R,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",K),d(g)}}function o(g){if(g===m)return"<>";if(typeof g=="object"&&g!==null&&g.$$typeof===G)return"<...>";try{var R=i(g);return R?"<"+R+">":"<...>"}catch{return"<...>"}}function l(){var g=U.A;return g===null?null:g.getOwner()}function h(){return Error("react-stack-top-frame")}function u(g){if(se.call(g,"key")){var R=Object.getOwnPropertyDescriptor(g,"key").get;if(R&&R.isReactWarning)return!1}return g.key!==void 0}function b(g,R){function q(){le||(le=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",R))}q.isReactWarning=!0,Object.defineProperty(g,"key",{get:q,configurable:!0})}function w(){var g=i(this.type);return xe[g]||(xe[g]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),g=this.props.ref,g!==void 0?g:null}function D(g,R,q,K,$,ee){var Z=q.ref;return g={$$typeof:T,type:g,key:R,props:q,_owner:K},(Z!==void 0?Z:null)!==null?Object.defineProperty(g,"ref",{enumerable:!1,get:w}):Object.defineProperty(g,"ref",{enumerable:!1,value:null}),g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(g,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(g,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:$}),Object.defineProperty(g,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g}function N(g,R,q,K,$,ee){var Z=R.children;if(Z!==void 0)if(K)if(fe(Z)){for(K=0;K<Z.length;K++)C(Z[K]);Object.freeze&&Object.freeze(Z)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else C(Z);if(se.call(R,"key")){Z=i(g);var ce=Object.keys(R).filter(function(ze){return ze!=="key"});K=0<ce.length?"{key: someKey, "+ce.join(": ..., ")+": ...}":"{key: someKey}",be[Z+K]||(ce=0<ce.length?"{"+ce.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,K,Z,ce,Z),be[Z+K]=!0)}if(Z=null,q!==void 0&&(c(q),Z=""+q),u(
|
|
22
|
+
<%s key={someKey} {...props} />`,K,Z,ce,Z),be[Z+K]=!0)}if(Z=null,q!==void 0&&(c(q),Z=""+q),u(R)&&(c(R.key),Z=""+R.key),"key"in R){q={};for(var ie in R)ie!=="key"&&(q[ie]=R[ie])}else q=R;return Z&&b(q,typeof g=="function"?g.displayName||g.name||"Unknown":g),D(g,Z,q,l(),$,ee)}function C(g){p(g)?g._store&&(g._store.validated=1):typeof g=="object"&&g!==null&&g.$$typeof===G&&(g._payload.status==="fulfilled"?p(g._payload.value)&&g._payload.value._store&&(g._payload.value._store.validated=1):g._store&&(g._store.validated=1))}function p(g){return typeof g=="object"&&g!==null&&g.$$typeof===T}var k=O,T=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),E=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),te=Symbol.for("react.client.reference"),U=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=Object.prototype.hasOwnProperty,fe=Array.isArray,me=console.createTask?console.createTask:function(){return null};k={react_stack_bottom_frame:function(g){return g()}};var le,xe={},ge=k.react_stack_bottom_frame.bind(k,h)(),ae=me(o(h)),be={};Ce.Fragment=m,Ce.jsx=function(g,R,q){var K=1e4>U.recentlyCreatedOwnerStacks++;return N(g,R,q,!1,K?Error("react-stack-top-frame"):ge,K?me(o(g)):ae)},Ce.jsxs=function(g,R,q){var K=1e4>U.recentlyCreatedOwnerStacks++;return N(g,R,q,!0,K?Error("react-stack-top-frame"):ge,K?me(o(g)):ae)}}()),Ce}process.env.NODE_ENV==="production"?Ge.exports=cr():Ge.exports=dr();var n=Ge.exports;/**
|
|
23
23
|
* @license lucide-react v0.344.0 - ISC
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the ISC license.
|
|
@@ -29,22 +29,22 @@ React keys must be passed directly to JSX without using spread:
|
|
|
29
29
|
*
|
|
30
30
|
* This source code is licensed under the ISC license.
|
|
31
31
|
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/const ur=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Y=(i,d)=>{const c=O.forwardRef(({color:o="currentColor",size:l=24,strokeWidth:h=2,absoluteStrokeWidth:u,className:
|
|
32
|
+
*/const ur=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Y=(i,d)=>{const c=O.forwardRef(({color:o="currentColor",size:l=24,strokeWidth:h=2,absoluteStrokeWidth:u,className:b="",children:w,...D},N)=>O.createElement("svg",{ref:N,...hr,width:l,height:l,stroke:o,strokeWidth:u?Number(h)*24/Number(l):h,className:["lucide",`lucide-${ur(i)}`,b].join(" "),...D},[...d.map(([C,p])=>O.createElement(C,p)),...Array.isArray(w)?w:[w]]));return c.displayName=`${i}`,c};/**
|
|
33
33
|
* @license lucide-react v0.344.0 - ISC
|
|
34
34
|
*
|
|
35
35
|
* This source code is licensed under the ISC license.
|
|
36
36
|
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/const
|
|
37
|
+
*/const Te=Y("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/**
|
|
38
38
|
* @license lucide-react v0.344.0 - ISC
|
|
39
39
|
*
|
|
40
40
|
* This source code is licensed under the ISC license.
|
|
41
41
|
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/const
|
|
42
|
+
*/const pt=Y("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
43
43
|
* @license lucide-react v0.344.0 - ISC
|
|
44
44
|
*
|
|
45
45
|
* This source code is licensed under the ISC license.
|
|
46
46
|
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
-
*/const
|
|
47
|
+
*/const pr=Y("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
48
48
|
* @license lucide-react v0.344.0 - ISC
|
|
49
49
|
*
|
|
50
50
|
* This source code is licensed under the ISC license.
|
|
@@ -54,52 +54,52 @@ React keys must be passed directly to JSX without using spread:
|
|
|
54
54
|
*
|
|
55
55
|
* This source code is licensed under the ISC license.
|
|
56
56
|
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/const
|
|
57
|
+
*/const fr=Y("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
58
58
|
* @license lucide-react v0.344.0 - ISC
|
|
59
59
|
*
|
|
60
60
|
* This source code is licensed under the ISC license.
|
|
61
61
|
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/const
|
|
62
|
+
*/const ft=Y("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
63
63
|
* @license lucide-react v0.344.0 - ISC
|
|
64
64
|
*
|
|
65
65
|
* This source code is licensed under the ISC license.
|
|
66
66
|
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/const
|
|
67
|
+
*/const mr=Y("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
68
68
|
* @license lucide-react v0.344.0 - ISC
|
|
69
69
|
*
|
|
70
70
|
* This source code is licensed under the ISC license.
|
|
71
71
|
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
-
*/const
|
|
72
|
+
*/const gr=Y("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
73
73
|
* @license lucide-react v0.344.0 - ISC
|
|
74
74
|
*
|
|
75
75
|
* This source code is licensed under the ISC license.
|
|
76
76
|
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/const
|
|
77
|
+
*/const mt=Y("Compass",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76",key:"m9r19z"}]]);/**
|
|
78
78
|
* @license lucide-react v0.344.0 - ISC
|
|
79
79
|
*
|
|
80
80
|
* This source code is licensed under the ISC license.
|
|
81
81
|
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
-
*/const
|
|
82
|
+
*/const xr=Y("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
83
83
|
* @license lucide-react v0.344.0 - ISC
|
|
84
84
|
*
|
|
85
85
|
* This source code is licensed under the ISC license.
|
|
86
86
|
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/const
|
|
87
|
+
*/const Ve=Y("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
88
88
|
* @license lucide-react v0.344.0 - ISC
|
|
89
89
|
*
|
|
90
90
|
* This source code is licensed under the ISC license.
|
|
91
91
|
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/const
|
|
92
|
+
*/const br=Y("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
|
|
93
93
|
* @license lucide-react v0.344.0 - ISC
|
|
94
94
|
*
|
|
95
95
|
* This source code is licensed under the ISC license.
|
|
96
96
|
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/const
|
|
97
|
+
*/const vr=Y("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/**
|
|
98
98
|
* @license lucide-react v0.344.0 - ISC
|
|
99
99
|
*
|
|
100
100
|
* This source code is licensed under the ISC license.
|
|
101
101
|
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const
|
|
102
|
+
*/const wr=Y("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
103
103
|
* @license lucide-react v0.344.0 - ISC
|
|
104
104
|
*
|
|
105
105
|
* This source code is licensed under the ISC license.
|
|
@@ -114,7 +114,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
114
114
|
*
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const
|
|
117
|
+
*/const Oe=Y("MousePointer2",[["path",{d:"m4 4 7.07 17 2.51-7.39L21 11.07z",key:"1vqm48"}]]);/**
|
|
118
118
|
* @license lucide-react v0.344.0 - ISC
|
|
119
119
|
*
|
|
120
120
|
* This source code is licensed under the ISC license.
|
|
@@ -140,7 +140,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
140
140
|
*
|
|
141
141
|
* Copyright 2020, Pusher
|
|
142
142
|
* Released under the MIT licence.
|
|
143
|
-
*/(function(i,d){(function(o,l){i.exports=l()})(window,function(){return function(c){var o={};function l(h){if(o[h])return o[h].exports;var u=o[h]={i:h,l:!1,exports:{}};return c[h].call(u.exports,u,u.exports,l),u.l=!0,u.exports}return l.m=c,l.c=o,l.d=function(h,u,x){l.o(h,u)||Object.defineProperty(h,u,{enumerable:!0,get:x})},l.r=function(h){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(h,"__esModule",{value:!0})},l.t=function(h,u){if(u&1&&(h=l(h)),u&8||u&4&&typeof h=="object"&&h&&h.__esModule)return h;var x=Object.create(null);if(l.r(x),Object.defineProperty(x,"default",{enumerable:!0,value:h}),u&2&&typeof h!="string")for(var y in h)l.d(x,y,(function(D){return h[D]}).bind(null,y));return x},l.n=function(h){var u=h&&h.__esModule?function(){return h.default}:function(){return h};return l.d(u,"a",u),u},l.o=function(h,u){return Object.prototype.hasOwnProperty.call(h,u)},l.p="",l(l.s=2)}([function(c,o,l){var h=this&&this.__extends||function(){var v=function(m,b){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,R){k.__proto__=R}||function(k,R){for(var U in R)R.hasOwnProperty(U)&&(k[U]=R[U])},v(m,b)};return function(m,b){v(m,b);function k(){this.constructor=m}m.prototype=b===null?Object.create(b):(k.prototype=b.prototype,new k)}}();Object.defineProperty(o,"__esModule",{value:!0});var u=256,x=function(){function v(m){m===void 0&&(m="="),this._paddingCharacter=m}return v.prototype.encodedLength=function(m){return this._paddingCharacter?(m+2)/3*4|0:(m*8+5)/6|0},v.prototype.encode=function(m){for(var b="",k=0;k<m.length-2;k+=3){var R=m[k]<<16|m[k+1]<<8|m[k+2];b+=this._encodeByte(R>>>3*6&63),b+=this._encodeByte(R>>>2*6&63),b+=this._encodeByte(R>>>1*6&63),b+=this._encodeByte(R>>>0*6&63)}var U=m.length-k;if(U>0){var R=m[k]<<16|(U===2?m[k+1]<<8:0);b+=this._encodeByte(R>>>3*6&63),b+=this._encodeByte(R>>>2*6&63),U===2?b+=this._encodeByte(R>>>1*6&63):b+=this._paddingCharacter||"",b+=this._paddingCharacter||""}return b},v.prototype.maxDecodedLength=function(m){return this._paddingCharacter?m/4*3|0:(m*6+7)/8|0},v.prototype.decodedLength=function(m){return this.maxDecodedLength(m.length-this._getPaddingLength(m))},v.prototype.decode=function(m){if(m.length===0)return new Uint8Array(0);for(var b=this._getPaddingLength(m),k=m.length-b,R=new Uint8Array(this.maxDecodedLength(k)),U=0,H=0,L=0,j=0,P=0,G=0,X=0;H<k-4;H+=4)j=this._decodeChar(m.charCodeAt(H+0)),P=this._decodeChar(m.charCodeAt(H+1)),G=this._decodeChar(m.charCodeAt(H+2)),X=this._decodeChar(m.charCodeAt(H+3)),R[U++]=j<<2|P>>>4,R[U++]=P<<4|G>>>2,R[U++]=G<<6|X,L|=j&u,L|=P&u,L|=G&u,L|=X&u;if(H<k-1&&(j=this._decodeChar(m.charCodeAt(H)),P=this._decodeChar(m.charCodeAt(H+1)),R[U++]=j<<2|P>>>4,L|=j&u,L|=P&u),H<k-2&&(G=this._decodeChar(m.charCodeAt(H+2)),R[U++]=P<<4|G>>>2,L|=G&u),H<k-3&&(X=this._decodeChar(m.charCodeAt(H+3)),R[U++]=G<<6|X,L|=X&u),L!==0)throw new Error("Base64Coder: incorrect characters for decoding");return R},v.prototype._encodeByte=function(m){var b=m;return b+=65,b+=25-m>>>8&6,b+=51-m>>>8&-75,b+=61-m>>>8&-15,b+=62-m>>>8&3,String.fromCharCode(b)},v.prototype._decodeChar=function(m){var b=u;return b+=(42-m&m-44)>>>8&-u+m-43+62,b+=(46-m&m-48)>>>8&-u+m-47+63,b+=(47-m&m-58)>>>8&-u+m-48+52,b+=(64-m&m-91)>>>8&-u+m-65+0,b+=(96-m&m-123)>>>8&-u+m-97+26,b},v.prototype._getPaddingLength=function(m){var b=0;if(this._paddingCharacter){for(var k=m.length-1;k>=0&&m[k]===this._paddingCharacter;k--)b++;if(m.length<4||b>2)throw new Error("Base64Coder: incorrect padding")}return b},v}();o.Coder=x;var y=new x;function D(v){return y.encode(v)}o.encode=D;function _(v){return y.decode(v)}o.decode=_;var T=function(v){h(m,v);function m(){return v!==null&&v.apply(this,arguments)||this}return m.prototype._encodeByte=function(b){var k=b;return k+=65,k+=25-b>>>8&6,k+=51-b>>>8&-75,k+=61-b>>>8&-13,k+=62-b>>>8&49,String.fromCharCode(k)},m.prototype._decodeChar=function(b){var k=u;return k+=(44-b&b-46)>>>8&-u+b-45+62,k+=(94-b&b-96)>>>8&-u+b-95+63,k+=(47-b&b-58)>>>8&-u+b-48+52,k+=(64-b&b-91)>>>8&-u+b-65+0,k+=(96-b&b-123)>>>8&-u+b-97+26,k},m}(x);o.URLSafeCoder=T;var p=new T;function S(v){return p.encode(v)}o.encodeURLSafe=S;function N(v){return p.decode(v)}o.decodeURLSafe=N,o.encodedLength=function(v){return y.encodedLength(v)},o.maxDecodedLength=function(v){return y.maxDecodedLength(v)},o.decodedLength=function(v){return y.decodedLength(v)}},function(c,o,l){Object.defineProperty(o,"__esModule",{value:!0});var h="utf8: invalid string",u="utf8: invalid source encoding";function x(_){for(var T=new Uint8Array(y(_)),p=0,S=0;S<_.length;S++){var N=_.charCodeAt(S);N<128?T[p++]=N:N<2048?(T[p++]=192|N>>6,T[p++]=128|N&63):N<55296?(T[p++]=224|N>>12,T[p++]=128|N>>6&63,T[p++]=128|N&63):(S++,N=(N&1023)<<10,N|=_.charCodeAt(S)&1023,N+=65536,T[p++]=240|N>>18,T[p++]=128|N>>12&63,T[p++]=128|N>>6&63,T[p++]=128|N&63)}return T}o.encode=x;function y(_){for(var T=0,p=0;p<_.length;p++){var S=_.charCodeAt(p);if(S<128)T+=1;else if(S<2048)T+=2;else if(S<55296)T+=3;else if(S<=57343){if(p>=_.length-1)throw new Error(h);p++,T+=4}else throw new Error(h)}return T}o.encodedLength=y;function D(_){for(var T=[],p=0;p<_.length;p++){var S=_[p];if(S&128){var N=void 0;if(S<224){if(p>=_.length)throw new Error(u);var v=_[++p];if((v&192)!==128)throw new Error(u);S=(S&31)<<6|v&63,N=128}else if(S<240){if(p>=_.length-1)throw new Error(u);var v=_[++p],m=_[++p];if((v&192)!==128||(m&192)!==128)throw new Error(u);S=(S&15)<<12|(v&63)<<6|m&63,N=2048}else if(S<248){if(p>=_.length-2)throw new Error(u);var v=_[++p],m=_[++p],b=_[++p];if((v&192)!==128||(m&192)!==128||(b&192)!==128)throw new Error(u);S=(S&15)<<18|(v&63)<<12|(m&63)<<6|b&63,N=65536}else throw new Error(u);if(S<N||S>=55296&&S<=57343)throw new Error(u);if(S>=65536){if(S>1114111)throw new Error(u);S-=65536,T.push(String.fromCharCode(55296|S>>10)),S=56320|S&1023}}T.push(String.fromCharCode(S))}return T.join("")}o.decode=D},function(c,o,l){c.exports=l(3).default},function(c,o,l){l.r(o);class h{constructor(e,t){this.lastId=0,this.prefix=e,this.name=t}create(e){this.lastId++;var t=this.lastId,s=this.prefix+t,a=this.name+"["+t+"]",f=!1,w=function(){f||(e.apply(null,arguments),f=!0)};return this[t]=w,{number:t,id:s,name:a,callback:w}}remove(e){delete this[e.number]}}var u=new h("_pusher_script_","Pusher.ScriptReceivers"),x={VERSION:"8.4.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},y=x;class D{constructor(e){this.options=e,this.receivers=e.receivers||u,this.loading={}}load(e,t,s){var a=this;if(a.loading[e]&&a.loading[e].length>0)a.loading[e].push(s);else{a.loading[e]=[s];var f=I.createScriptRequest(a.getPath(e,t)),w=a.receivers.create(function(C){if(a.receivers.remove(w),a.loading[e]){var E=a.loading[e];delete a.loading[e];for(var B=function(Q){Q||f.cleanup()},F=0;F<E.length;F++)E[F](C,B)}});f.send(w)}}getRoot(e){var t,s=I.getDocument().location.protocol;return e&&e.useTLS||s==="https:"?t=this.options.cdn_https:t=this.options.cdn_http,t.replace(/\/*$/,"")+"/"+this.options.version}getPath(e,t){return this.getRoot(t)+"/"+e+this.options.suffix+".js"}}var _=new h("_pusher_dependencies","Pusher.DependenciesReceivers"),T=new D({cdn_http:y.cdn_http,cdn_https:y.cdn_https,version:y.VERSION,suffix:y.dependency_suffix,receivers:_});const p={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}};var N={buildLogSuffix:function(r){const e="See:",t=p.urls[r];if(!t)return"";let s;return t.fullUrl?s=t.fullUrl:t.path&&(s=p.baseUrl+t.path),s?`${e} ${s}`:""}},v;(function(r){r.UserAuthentication="user-authentication",r.ChannelAuthorization="channel-authorization"})(v||(v={}));class m extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class b extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class k extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class R extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class U extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class H extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class L extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class j extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class P extends Error{constructor(e,t){super(t),this.status=e,Object.setPrototypeOf(this,new.target.prototype)}}var X=function(r,e,t,s,a){const f=I.createXHR();f.open("POST",t.endpoint,!0),f.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var w in t.headers)f.setRequestHeader(w,t.headers[w]);if(t.headersProvider!=null){let C=t.headersProvider();for(var w in C)f.setRequestHeader(w,C[w])}return f.onreadystatechange=function(){if(f.readyState===4)if(f.status===200){let C,E=!1;try{C=JSON.parse(f.responseText),E=!0}catch{a(new P(200,`JSON returned from ${s.toString()} endpoint was invalid, yet status code was 200. Data was: ${f.responseText}`),null)}E&&a(null,C)}else{let C="";switch(s){case v.UserAuthentication:C=N.buildLogSuffix("authenticationEndpoint");break;case v.ChannelAuthorization:C=`Clients must be authorized to join private or presence channels. ${N.buildLogSuffix("authorizationEndpoint")}`;break}a(new P(f.status,`Unable to retrieve auth string from ${s.toString()} endpoint - received status: ${f.status} from ${t.endpoint}. ${C}`),null)}},f.send(e),f};function te(r){return xe(me(r))}var z=String.fromCharCode,ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fe=function(r){var e=r.charCodeAt(0);return e<128?r:e<2048?z(192|e>>>6)+z(128|e&63):z(224|e>>>12&15)+z(128|e>>>6&63)+z(128|e&63)},me=function(r){return r.replace(/[^\x00-\x7F]/g,fe)},le=function(r){var e=[0,2,1][r.length%3],t=r.charCodeAt(0)<<16|(r.length>1?r.charCodeAt(1):0)<<8|(r.length>2?r.charCodeAt(2):0),s=[ne.charAt(t>>>18),ne.charAt(t>>>12&63),e>=2?"=":ne.charAt(t>>>6&63),e>=1?"=":ne.charAt(t&63)];return s.join("")},xe=window.btoa||function(r){return r.replace(/[\s\S]{1,3}/g,le)};class ge{constructor(e,t,s,a){this.clear=t,this.timer=e(()=>{this.timer&&(this.timer=a(this.timer))},s)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var ae=ge;function be(r){window.clearTimeout(r)}function g(r){window.clearInterval(r)}class A extends ae{constructor(e,t){super(setTimeout,be,e,function(s){return t(),null})}}class q extends ae{constructor(e,t){super(setInterval,g,e,function(s){return t(),s})}}var K={now(){return Date.now?Date.now():new Date().valueOf()},defer(r){return new A(0,r)},method(r,...e){var t=Array.prototype.slice.call(arguments,1);return function(s){return s[r].apply(s,t.concat(arguments))}}},$=K;function ee(r,...e){for(var t=0;t<e.length;t++){var s=e[t];for(var a in s)s[a]&&s[a].constructor&&s[a].constructor===Object?r[a]=ee(r[a]||{},s[a]):r[a]=s[a]}return r}function Z(){for(var r=["Pusher"],e=0;e<arguments.length;e++)typeof arguments[e]=="string"?r.push(arguments[e]):r.push(ze(arguments[e]));return r.join(" : ")}function ce(r,e){var t=Array.prototype.indexOf;if(r===null)return-1;if(t&&r.indexOf===t)return r.indexOf(e);for(var s=0,a=r.length;s<a;s++)if(r[s]===e)return s;return-1}function se(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&e(r[t],t,r)}function Me(r){var e=[];return se(r,function(t,s){e.push(s)}),e}function dn(r){var e=[];return se(r,function(t){e.push(t)}),e}function Ae(r,e,t){for(var s=0;s<r.length;s++)e.call(t||window,r[s],s,r)}function Ut(r,e){for(var t=[],s=0;s<r.length;s++)t.push(e(r[s],s,r,t));return t}function hn(r,e){var t={};return se(r,function(s,a){t[a]=e(s)}),t}function Ht(r,e){e=e||function(a){return!!a};for(var t=[],s=0;s<r.length;s++)e(r[s],s,r,t)&&t.push(r[s]);return t}function Bt(r,e){var t={};return se(r,function(s,a){(e&&e(s,a,r,t)||s)&&(t[a]=s)}),t}function un(r){var e=[];return se(r,function(t,s){e.push([s,t])}),e}function Ft(r,e){for(var t=0;t<r.length;t++)if(e(r[t],t,r))return!0;return!1}function pn(r,e){for(var t=0;t<r.length;t++)if(!e(r[t],t,r))return!1;return!0}function fn(r){return hn(r,function(e){return typeof e=="object"&&(e=ze(e)),encodeURIComponent(te(e.toString()))})}function mn(r){var e=Bt(r,function(s){return s!==void 0}),t=Ut(un(fn(e)),$.method("join","=")).join("&");return t}function gn(r){var e=[],t=[];return function s(a,f){var w,C,E;switch(typeof a){case"object":if(!a)return null;for(w=0;w<e.length;w+=1)if(e[w]===a)return{$ref:t[w]};if(e.push(a),t.push(f),Object.prototype.toString.apply(a)==="[object Array]")for(E=[],w=0;w<a.length;w+=1)E[w]=s(a[w],f+"["+w+"]");else{E={};for(C in a)Object.prototype.hasOwnProperty.call(a,C)&&(E[C]=s(a[C],f+"["+JSON.stringify(C)+"]"))}return E;case"number":case"string":case"boolean":return a}}(r,"$")}function ze(r){try{return JSON.stringify(r)}catch{return JSON.stringify(gn(r))}}class xn{constructor(){this.globalLog=e=>{window.console&&window.console.log&&window.console.log(e)}}debug(...e){this.log(this.globalLog,e)}warn(...e){this.log(this.globalLogWarn,e)}error(...e){this.log(this.globalLogError,e)}globalLogWarn(e){window.console&&window.console.warn?window.console.warn(e):this.globalLog(e)}globalLogError(e){window.console&&window.console.error?window.console.error(e):this.globalLogWarn(e)}log(e,...t){var s=Z.apply(this,arguments);ot.log?ot.log(s):ot.logToConsole&&e.bind(this)(s)}}var J=new xn,bn=function(r,e,t,s,a){(t.headers!==void 0||t.headersProvider!=null)&&J.warn(`To send headers with the ${s.toString()} request, you must use AJAX, rather than JSONP.`);var f=r.nextAuthCallbackID.toString();r.nextAuthCallbackID++;var w=r.getDocument(),C=w.createElement("script");r.auth_callbacks[f]=function(F){a(null,F)};var E="Pusher.auth_callbacks['"+f+"']";C.src=t.endpoint+"?callback="+encodeURIComponent(E)+"&"+e;var B=w.getElementsByTagName("head")[0]||w.documentElement;B.insertBefore(C,B.firstChild)},vn=bn;class wn{constructor(e){this.src=e}send(e){var t=this,s="Error loading "+t.src;t.script=document.createElement("script"),t.script.id=e.id,t.script.src=t.src,t.script.type="text/javascript",t.script.charset="UTF-8",t.script.addEventListener?(t.script.onerror=function(){e.callback(s)},t.script.onload=function(){e.callback(null)}):t.script.onreadystatechange=function(){(t.script.readyState==="loaded"||t.script.readyState==="complete")&&e.callback(null)},t.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(t.errorScript=document.createElement("script"),t.errorScript.id=e.id+"_error",t.errorScript.text=e.name+"('"+s+"');",t.script.async=t.errorScript.async=!1):t.script.async=!0;var a=document.getElementsByTagName("head")[0];a.insertBefore(t.script,a.firstChild),t.errorScript&&a.insertBefore(t.errorScript,t.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class yn{constructor(e,t){this.url=e,this.data=t}send(e){if(!this.request){var t=mn(this.data),s=this.url+"/"+e.number+"?"+t;this.request=I.createScriptRequest(s),this.request.send(e)}}cleanup(){this.request&&this.request.cleanup()}}var jn=function(r,e){return function(t,s){var a="http"+(e?"s":"")+"://",f=a+(r.host||r.options.host)+r.options.path,w=I.createJSONPRequest(f,t),C=I.ScriptReceivers.create(function(E,B){u.remove(C),w.cleanup(),B&&B.host&&(r.host=B.host),s&&s(E,B)});w.send(C)}},_n={name:"jsonp",getAgent:jn},kn=_n;function $e(r,e,t){var s=r+(e.useTLS?"s":""),a=e.useTLS?e.hostTLS:e.hostNonTLS;return s+"://"+a+t}function Ze(r,e){var t="/app/"+r,s="?protocol="+y.PROTOCOL+"&client=js&version="+y.VERSION+(e?"&"+e:"");return t+s}var Nn={getInitial:function(r,e){var t=(e.httpPath||"")+Ze(r,"flash=false");return $e("ws",e,t)}},Sn={getInitial:function(r,e){var t=(e.httpPath||"/pusher")+Ze(r);return $e("http",e,t)}},Cn={getInitial:function(r,e){return $e("http",e,e.httpPath||"/pusher")},getPath:function(r,e){return Ze(r)}};class Tn{constructor(){this._callbacks={}}get(e){return this._callbacks[Qe(e)]}add(e,t,s){var a=Qe(e);this._callbacks[a]=this._callbacks[a]||[],this._callbacks[a].push({fn:t,context:s})}remove(e,t,s){if(!e&&!t&&!s){this._callbacks={};return}var a=e?[Qe(e)]:Me(this._callbacks);t||s?this.removeCallback(a,t,s):this.removeAllCallbacks(a)}removeCallback(e,t,s){Ae(e,function(a){this._callbacks[a]=Ht(this._callbacks[a]||[],function(f){return t&&t!==f.fn||s&&s!==f.context}),this._callbacks[a].length===0&&delete this._callbacks[a]},this)}removeAllCallbacks(e){Ae(e,function(t){delete this._callbacks[t]},this)}}function Qe(r){return"_"+r}class de{constructor(e){this.callbacks=new Tn,this.global_callbacks=[],this.failThrough=e}bind(e,t,s){return this.callbacks.add(e,t,s),this}bind_global(e){return this.global_callbacks.push(e),this}unbind(e,t,s){return this.callbacks.remove(e,t,s),this}unbind_global(e){return e?(this.global_callbacks=Ht(this.global_callbacks||[],t=>t!==e),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(e,t,s){for(var a=0;a<this.global_callbacks.length;a++)this.global_callbacks[a](e,t);var f=this.callbacks.get(e),w=[];if(s?w.push(t,s):t&&w.push(t),f&&f.length>0)for(var a=0;a<f.length;a++)f[a].fn.apply(f[a].context||window,w);else this.failThrough&&this.failThrough(e,t);return this}}class Pn extends de{constructor(e,t,s,a,f){super(),this.initialize=I.transportConnectionInitializer,this.hooks=e,this.name=t,this.priority=s,this.key=a,this.options=f,this.state="new",this.timeline=f.timeline,this.activityTimeout=f.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var e=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(e,this.options)}catch(t){return $.defer(()=>{this.onError(t),this.changeState("closed")}),!1}return this.bindListeners(),J.debug("Connecting",{transport:this.name,url:e}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(e){return this.state==="open"?($.defer(()=>{this.socket&&this.socket.send(e)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(e){this.emit("error",{type:"WebSocketError",error:e}),this.timeline.error(this.buildTimelineMessage({error:e.toString()}))}onClose(e){e?this.changeState("closed",{code:e.code,reason:e.reason,wasClean:e.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(e){this.emit("message",e)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=e=>{this.onError(e)},this.socket.onclose=e=>{this.onClose(e)},this.socket.onmessage=e=>{this.onMessage(e)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(e,t){this.state=e,this.timeline.info(this.buildTimelineMessage({state:e,params:t})),this.emit(e,t)}buildTimelineMessage(e){return ee({cid:this.id},e)}}class Ne{constructor(e){this.hooks=e}isSupported(e){return this.hooks.isSupported(e)}createConnection(e,t,s,a){return new Pn(this.hooks,e,t,s,a)}}var An=new Ne({urls:Nn,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!I.getWebSocketAPI()},isSupported:function(){return!!I.getWebSocketAPI()},getSocket:function(r){return I.createWebSocket(r)}}),Gt={urls:Sn,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},Vt=ee({getSocket:function(r){return I.HTTPFactory.createStreamingSocket(r)}},Gt),qt=ee({getSocket:function(r){return I.HTTPFactory.createPollingSocket(r)}},Gt),Wt={isSupported:function(){return I.isXHRSupported()}},En=new Ne(ee({},Vt,Wt)),Rn=new Ne(ee({},qt,Wt)),Ln={ws:An,xhr_streaming:En,xhr_polling:Rn},De=Ln,In=new Ne({file:"sockjs",urls:Cn,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(r,e){return new window.SockJS(r,null,{js_path:T.getPath("sockjs",{useTLS:e.useTLS}),ignore_null_origin:e.ignoreNullOrigin})},beforeOpen:function(r,e){r.send(JSON.stringify({path:e}))}}),Jt={isSupported:function(r){var e=I.isXDRSupported(r.useTLS);return e}},On=new Ne(ee({},Vt,Jt)),Mn=new Ne(ee({},qt,Jt));De.xdr_streaming=On,De.xdr_polling=Mn,De.sockjs=In;var zn=De;class Dn extends de{constructor(){super();var e=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){e.emit("online")},!1),window.addEventListener("offline",function(){e.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var Un=new Dn;class Hn{constructor(e,t,s){this.manager=e,this.transport=t,this.minPingDelay=s.minPingDelay,this.maxPingDelay=s.maxPingDelay,this.pingDelay=void 0}createConnection(e,t,s,a){a=ee({},a,{activityTimeout:this.pingDelay});var f=this.transport.createConnection(e,t,s,a),w=null,C=function(){f.unbind("open",C),f.bind("closed",E),w=$.now()},E=B=>{if(f.unbind("closed",E),B.code===1002||B.code===1003)this.manager.reportDeath();else if(!B.wasClean&&w){var F=$.now()-w;F<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(F/2,this.minPingDelay))}};return f.bind("open",C),f}isSupported(e){return this.manager.isAlive()&&this.transport.isSupported(e)}}const Xt={decodeMessage:function(r){try{var e=JSON.parse(r.data),t=e.data;if(typeof t=="string")try{t=JSON.parse(e.data)}catch{}var s={event:e.event,channel:e.channel,data:t};return e.user_id&&(s.user_id=e.user_id),s}catch(a){throw{type:"MessageParseError",error:a,data:r.data}}},encodeMessage:function(r){return JSON.stringify(r)},processHandshake:function(r){var e=Xt.decodeMessage(r);if(e.event==="pusher:connection_established"){if(!e.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:e.data.socket_id,activityTimeout:e.data.activity_timeout*1e3}}else{if(e.event==="pusher:error")return{action:this.getCloseAction(e.data),error:this.getCloseError(e.data)};throw"Invalid handshake"}},getCloseAction:function(r){return r.code<4e3?r.code>=1002&&r.code<=1004?"backoff":null:r.code===4e3?"tls_only":r.code<4100?"refused":r.code<4200?"backoff":r.code<4300?"retry":"refused"},getCloseError:function(r){return r.code!==1e3&&r.code!==1001?{type:"PusherError",data:{code:r.code,message:r.reason||r.message}}:null}};var ve=Xt;class Bn extends de{constructor(e,t){super(),this.id=e,this.transport=t,this.activityTimeout=t.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(e){return this.transport.send(e)}send_event(e,t,s){var a={event:e,data:t};return s&&(a.channel=s),J.debug("Event sent",a),this.send(ve.encodeMessage(a))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var e={message:s=>{var a;try{a=ve.decodeMessage(s)}catch(f){this.emit("error",{type:"MessageParseError",error:f,data:s.data})}if(a!==void 0){switch(J.debug("Event recd",a),a.event){case"pusher:error":this.emit("error",{type:"PusherError",data:a.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",a)}},activity:()=>{this.emit("activity")},error:s=>{this.emit("error",s)},closed:s=>{t(),s&&s.code&&this.handleCloseEvent(s),this.transport=null,this.emit("closed")}},t=()=>{se(e,(s,a)=>{this.transport.unbind(a,s)})};se(e,(s,a)=>{this.transport.bind(a,s)})}handleCloseEvent(e){var t=ve.getCloseAction(e),s=ve.getCloseError(e);s&&this.emit("error",s),t&&this.emit(t,{action:t,error:s})}}class Fn{constructor(e,t){this.transport=e,this.callback=t,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=e=>{this.unbindListeners();var t;try{t=ve.processHandshake(e)}catch(s){this.finish("error",{error:s}),this.transport.close();return}t.action==="connected"?this.finish("connected",{connection:new Bn(t.id,this.transport),activityTimeout:t.activityTimeout}):(this.finish(t.action,{error:t.error}),this.transport.close())},this.onClosed=e=>{this.unbindListeners();var t=ve.getCloseAction(e)||"backoff",s=ve.getCloseError(e);this.finish(t,{error:s})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(e,t){this.callback(ee({transport:this.transport,action:e},t))}}class Gn{constructor(e,t){this.timeline=e,this.options=t||{}}send(e,t){this.timeline.isEmpty()||this.timeline.send(I.TimelineTransport.getAgent(this,e),t)}}class et extends de{constructor(e,t){super(function(s,a){J.debug("No callbacks on "+e+" for "+s)}),this.name=e,this.pusher=t,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(e,t){return t(null,{auth:""})}trigger(e,t){if(e.indexOf("client-")!==0)throw new m("Event '"+e+"' does not start with 'client-'");if(!this.subscribed){var s=N.buildLogSuffix("triggeringClientEvents");J.warn(`Client event triggered before channel 'subscription_succeeded' event . ${s}`)}return this.pusher.send_event(e,t,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(e){var t=e.event,s=e.data;if(t==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(e);else if(t==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(e);else if(t.indexOf("pusher_internal:")!==0){var a={};this.emit(t,s,a)}}handleSubscriptionSucceededEvent(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",e.data)}handleSubscriptionCountEvent(e){e.data.subscription_count&&(this.subscriptionCount=e.data.subscription_count),this.emit("pusher:subscription_count",e.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(e,t)=>{e?(this.subscriptionPending=!1,J.error(e.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:e.message},e instanceof P?{status:e.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:t.auth,channel_data:t.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class tt extends et{authorize(e,t){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:e},t)}}class Vn{constructor(){this.reset()}get(e){return Object.prototype.hasOwnProperty.call(this.members,e)?{id:e,info:this.members[e]}:null}each(e){se(this.members,(t,s)=>{e(this.get(s))})}setMyID(e){this.myID=e}onSubscription(e){this.members=e.presence.hash,this.count=e.presence.count,this.me=this.get(this.myID)}addMember(e){return this.get(e.user_id)===null&&this.count++,this.members[e.user_id]=e.user_info,this.get(e.user_id)}removeMember(e){var t=this.get(e.user_id);return t&&(delete this.members[e.user_id],this.count--),t}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var qn=function(r,e,t,s){function a(f){return f instanceof t?f:new t(function(w){w(f)})}return new(t||(t=Promise))(function(f,w){function C(F){try{B(s.next(F))}catch(Q){w(Q)}}function E(F){try{B(s.throw(F))}catch(Q){w(Q)}}function B(F){F.done?f(F.value):a(F.value).then(C,E)}B((s=s.apply(r,e||[])).next())})};class Wn extends tt{constructor(e,t){super(e,t),this.members=new Vn}authorize(e,t){super.authorize(e,(s,a)=>qn(this,void 0,void 0,function*(){if(!s)if(a=a,a.channel_data!=null){var f=JSON.parse(a.channel_data);this.members.setMyID(f.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let w=N.buildLogSuffix("authorizationEndpoint");J.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${w}, or the user should be signed in.`),t("Invalid auth response");return}t(s,a)}))}handleEvent(e){var t=e.event;if(t.indexOf("pusher_internal:")===0)this.handleInternalEvent(e);else{var s=e.data,a={};e.user_id&&(a.user_id=e.user_id),this.emit(t,s,a)}}handleInternalEvent(e){var t=e.event,s=e.data;switch(t){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(e);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(e);break;case"pusher_internal:member_added":var a=this.members.addMember(s);this.emit("pusher:member_added",a);break;case"pusher_internal:member_removed":var f=this.members.removeMember(s);f&&this.emit("pusher:member_removed",f);break}}handleSubscriptionSucceededEvent(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(e.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var Jn=l(1),rt=l(0);class Xn extends tt{constructor(e,t,s){super(e,t),this.key=null,this.nacl=s}authorize(e,t){super.authorize(e,(s,a)=>{if(s){t(s,a);return}let f=a.shared_secret;if(!f){t(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(rt.decode)(f),delete a.shared_secret,t(null,a)})}trigger(e,t){throw new H("Client events are not currently supported for encrypted channels")}handleEvent(e){var t=e.event,s=e.data;if(t.indexOf("pusher_internal:")===0||t.indexOf("pusher:")===0){super.handleEvent(e);return}this.handleEncryptedEvent(t,s)}handleEncryptedEvent(e,t){if(!this.key){J.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!t.ciphertext||!t.nonce){J.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+t);return}let s=Object(rt.decode)(t.ciphertext);if(s.length<this.nacl.secretbox.overheadLength){J.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${s.length}`);return}let a=Object(rt.decode)(t.nonce);if(a.length<this.nacl.secretbox.nonceLength){J.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${a.length}`);return}let f=this.nacl.secretbox.open(s,a,this.key);if(f===null){J.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(w,C)=>{if(w){J.error(`Failed to make a request to the authEndpoint: ${C}. Unable to fetch new key, so dropping encrypted event`);return}if(f=this.nacl.secretbox.open(s,a,this.key),f===null){J.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(e,this.getDataToEmit(f))});return}this.emit(e,this.getDataToEmit(f))}getDataToEmit(e){let t=Object(Jn.decode)(e);try{return JSON.parse(t)}catch{return t}}}class Yn extends de{constructor(e,t){super(),this.state="initialized",this.connection=null,this.key=e,this.options=t,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var s=I.getNetwork();s.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),s.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(e){return this.connection?this.connection.send(e):!1}send_event(e,t,s){return this.connection?this.connection.send_event(e,t,s):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var e=(t,s)=>{t?this.runner=this.strategy.connect(0,e):s.action==="error"?(this.emit("error",{type:"HandshakeError",error:s.error}),this.timeline.error({handshakeError:s.error})):(this.abortConnecting(),this.handshakeCallbacks[s.action](s))};this.runner=this.strategy.connect(0,e)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var e=this.abandonConnection();e.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(e){this.timeline.info({action:"retry",delay:e}),e>0&&this.emit("connecting_in",Math.round(e/1e3)),this.retryTimer=new A(e||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new A(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new A(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new A(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(e){return ee({},e,{message:t=>{this.resetActivityCheck(),this.emit("message",t)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:t=>{this.emit("error",t)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(e){return ee({},e,{connected:t=>{this.activityTimeout=Math.min(this.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(t.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let e=t=>s=>{s.error&&this.emit("error",{type:"WebSocketError",error:s.error}),t(s)};return{tls_only:e(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:e(()=>{this.disconnect()}),backoff:e(()=>{this.retryIn(1e3)}),retry:e(()=>{this.retryIn(0)})}}setConnection(e){this.connection=e;for(var t in this.connectionCallbacks)this.connection.bind(t,this.connectionCallbacks[t]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var e in this.connectionCallbacks)this.connection.unbind(e,this.connectionCallbacks[e]);var t=this.connection;return this.connection=null,t}}updateState(e,t){var s=this.state;if(this.state=e,s!==e){var a=e;a==="connected"&&(a+=" with new socket ID "+t.socket_id),J.debug("State changed",s+" -> "+a),this.timeline.info({state:e,params:t}),this.emit("state_change",{previous:s,current:e}),this.emit(e,t)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class Kn{constructor(){this.channels={}}add(e,t){return this.channels[e]||(this.channels[e]=$n(e,t)),this.channels[e]}all(){return dn(this.channels)}find(e){return this.channels[e]}remove(e){var t=this.channels[e];return delete this.channels[e],t}disconnect(){se(this.channels,function(e){e.disconnect()})}}function $n(r,e){if(r.indexOf("private-encrypted-")===0){if(e.config.nacl)return he.createEncryptedChannel(r,e,e.config.nacl);let t="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",s=N.buildLogSuffix("encryptedChannelSupport");throw new H(`${t}. ${s}`)}else{if(r.indexOf("private-")===0)return he.createPrivateChannel(r,e);if(r.indexOf("presence-")===0)return he.createPresenceChannel(r,e);if(r.indexOf("#")===0)throw new b('Cannot create a channel with name "'+r+'".');return he.createChannel(r,e)}}var Zn={createChannels(){return new Kn},createConnectionManager(r,e){return new Yn(r,e)},createChannel(r,e){return new et(r,e)},createPrivateChannel(r,e){return new tt(r,e)},createPresenceChannel(r,e){return new Wn(r,e)},createEncryptedChannel(r,e,t){return new Xn(r,e,t)},createTimelineSender(r,e){return new Gn(r,e)},createHandshake(r,e){return new Fn(r,e)},createAssistantToTheTransportManager(r,e,t){return new Hn(r,e,t)}},he=Zn;class Yt{constructor(e){this.options=e||{},this.livesLeft=this.options.lives||1/0}getAssistant(e){return he.createAssistantToTheTransportManager(this,e,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class we{constructor(e,t){this.strategies=e,this.loop=!!t.loop,this.failFast=!!t.failFast,this.timeout=t.timeout,this.timeoutLimit=t.timeoutLimit}isSupported(){return Ft(this.strategies,$.method("isSupported"))}connect(e,t){var s=this.strategies,a=0,f=this.timeout,w=null,C=(E,B)=>{B?t(null,B):(a=a+1,this.loop&&(a=a%s.length),a<s.length?(f&&(f=f*2,this.timeoutLimit&&(f=Math.min(f,this.timeoutLimit))),w=this.tryStrategy(s[a],e,{timeout:f,failFast:this.failFast},C)):t(!0))};return w=this.tryStrategy(s[a],e,{timeout:f,failFast:this.failFast},C),{abort:function(){w.abort()},forceMinPriority:function(E){e=E,w&&w.forceMinPriority(E)}}}tryStrategy(e,t,s,a){var f=null,w=null;return s.timeout>0&&(f=new A(s.timeout,function(){w.abort(),a(!0)})),w=e.connect(t,function(C,E){C&&f&&f.isRunning()&&!s.failFast||(f&&f.ensureAborted(),a(C,E))}),{abort:function(){f&&f.ensureAborted(),w.abort()},forceMinPriority:function(C){w.forceMinPriority(C)}}}}class nt{constructor(e){this.strategies=e}isSupported(){return Ft(this.strategies,$.method("isSupported"))}connect(e,t){return Qn(this.strategies,e,function(s,a){return function(f,w){if(a[s].error=f,f){es(a)&&t(!0);return}Ae(a,function(C){C.forceMinPriority(w.transport.priority)}),t(null,w)}})}}function Qn(r,e,t){var s=Ut(r,function(a,f,w,C){return a.connect(e,t(f,C))});return{abort:function(){Ae(s,ts)},forceMinPriority:function(a){Ae(s,function(f){f.forceMinPriority(a)})}}}function es(r){return pn(r,function(e){return!!e.error})}function ts(r){!r.error&&!r.aborted&&(r.abort(),r.aborted=!0)}class rs{constructor(e,t,s){this.strategy=e,this.transports=t,this.ttl=s.ttl||1800*1e3,this.usingTLS=s.useTLS,this.timeline=s.timeline}isSupported(){return this.strategy.isSupported()}connect(e,t){var s=this.usingTLS,a=ns(s),f=a&&a.cacheSkipCount?a.cacheSkipCount:0,w=[this.strategy];if(a&&a.timestamp+this.ttl>=$.now()){var C=this.transports[a.transport];C&&(["ws","wss"].includes(a.transport)||f>3?(this.timeline.info({cached:!0,transport:a.transport,latency:a.latency}),w.push(new we([C],{timeout:a.latency*2+1e3,failFast:!0}))):f++)}var E=$.now(),B=w.pop().connect(e,function F(Q,Be){Q?(Kt(s),w.length>0?(E=$.now(),B=w.pop().connect(e,F)):t(Q)):(ss(s,Be.transport.name,$.now()-E,f),t(null,Be))});return{abort:function(){B.abort()},forceMinPriority:function(F){e=F,B&&B.forceMinPriority(F)}}}}function st(r){return"pusherTransport"+(r?"TLS":"NonTLS")}function ns(r){var e=I.getLocalStorage();if(e)try{var t=e[st(r)];if(t)return JSON.parse(t)}catch{Kt(r)}return null}function ss(r,e,t,s){var a=I.getLocalStorage();if(a)try{a[st(r)]=ze({timestamp:$.now(),transport:e,latency:t,cacheSkipCount:s})}catch{}}function Kt(r){var e=I.getLocalStorage();if(e)try{delete e[st(r)]}catch{}}class Ue{constructor(e,{delay:t}){this.strategy=e,this.options={delay:t}}isSupported(){return this.strategy.isSupported()}connect(e,t){var s=this.strategy,a,f=new A(this.options.delay,function(){a=s.connect(e,t)});return{abort:function(){f.ensureAborted(),a&&a.abort()},forceMinPriority:function(w){e=w,a&&a.forceMinPriority(w)}}}}class Ee{constructor(e,t,s){this.test=e,this.trueBranch=t,this.falseBranch=s}isSupported(){var e=this.test()?this.trueBranch:this.falseBranch;return e.isSupported()}connect(e,t){var s=this.test()?this.trueBranch:this.falseBranch;return s.connect(e,t)}}class is{constructor(e){this.strategy=e}isSupported(){return this.strategy.isSupported()}connect(e,t){var s=this.strategy.connect(e,function(a,f){f&&s.abort(),t(a,f)});return s}}function Re(r){return function(){return r.isSupported()}}var as=function(r,e,t){var s={};function a(or,ii,ai,oi,li){var lr=t(r,or,ii,ai,oi,li);return s[or]=lr,lr}var f=Object.assign({},e,{hostNonTLS:r.wsHost+":"+r.wsPort,hostTLS:r.wsHost+":"+r.wssPort,httpPath:r.wsPath}),w=Object.assign({},f,{useTLS:!0}),C=Object.assign({},e,{hostNonTLS:r.httpHost+":"+r.httpPort,hostTLS:r.httpHost+":"+r.httpsPort,httpPath:r.httpPath}),E={loop:!0,timeout:15e3,timeoutLimit:6e4},B=new Yt({minPingDelay:1e4,maxPingDelay:r.activityTimeout}),F=new Yt({lives:2,minPingDelay:1e4,maxPingDelay:r.activityTimeout}),Q=a("ws","ws",3,f,B),Be=a("wss","ws",3,w,B),ei=a("sockjs","sockjs",1,C),tr=a("xhr_streaming","xhr_streaming",1,C,F),ti=a("xdr_streaming","xdr_streaming",1,C,F),rr=a("xhr_polling","xhr_polling",1,C),ri=a("xdr_polling","xdr_polling",1,C),nr=new we([Q],E),ni=new we([Be],E),si=new we([ei],E),sr=new we([new Ee(Re(tr),tr,ti)],E),ir=new we([new Ee(Re(rr),rr,ri)],E),ar=new we([new Ee(Re(sr),new nt([sr,new Ue(ir,{delay:4e3})]),ir)],E),lt=new Ee(Re(ar),ar,si),ct;return e.useTLS?ct=new nt([nr,new Ue(lt,{delay:2e3})]):ct=new nt([nr,new Ue(ni,{delay:2e3}),new Ue(lt,{delay:5e3})]),new rs(new is(new Ee(Re(Q),ct,lt)),s,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})},os=as,ls=function(){var r=this;r.timeline.info(r.buildTimelineMessage({transport:r.name+(r.options.useTLS?"s":"")})),r.hooks.isInitialized()?r.changeState("initialized"):r.hooks.file?(r.changeState("initializing"),T.load(r.hooks.file,{useTLS:r.options.useTLS},function(e,t){r.hooks.isInitialized()?(r.changeState("initialized"),t(!0)):(e&&r.onError(e),r.onClose(),t(!1))})):r.onClose()},cs={getRequest:function(r){var e=new window.XDomainRequest;return e.ontimeout=function(){r.emit("error",new k),r.close()},e.onerror=function(t){r.emit("error",t),r.close()},e.onprogress=function(){e.responseText&&e.responseText.length>0&&r.onChunk(200,e.responseText)},e.onload=function(){e.responseText&&e.responseText.length>0&&r.onChunk(200,e.responseText),r.emit("finished",200),r.close()},e},abortRequest:function(r){r.ontimeout=r.onerror=r.onprogress=r.onload=null,r.abort()}},ds=cs;const hs=256*1024;class us extends de{constructor(e,t,s){super(),this.hooks=e,this.method=t,this.url=s}start(e){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},I.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(e)}close(){this.unloader&&(I.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(e,t){for(;;){var s=this.advanceBuffer(t);if(s)this.emit("chunk",{status:e,data:s});else break}this.isBufferTooLong(t)&&this.emit("buffer_too_long")}advanceBuffer(e){var t=e.slice(this.position),s=t.indexOf(`
|
|
144
|
-
`);return s!==-1?(this.position+=s+1,t.slice(0,s)):null}isBufferTooLong(e){return this.position===e.length&&e.length>hs}}var it;(function(r){r[r.CONNECTING=0]="CONNECTING",r[r.OPEN=1]="OPEN",r[r.CLOSED=3]="CLOSED"})(it||(it={}));var ye=it,ps=1;class fs{constructor(e,t){this.hooks=e,this.session=Zt(1e3)+"/"+bs(8),this.location=ms(t),this.readyState=ye.CONNECTING,this.openStream()}send(e){return this.sendRaw(JSON.stringify([e]))}ping(){this.hooks.sendHeartbeat(this)}close(e,t){this.onClose(e,t,!0)}sendRaw(e){if(this.readyState===ye.OPEN)try{return I.createSocketRequest("POST",$t(gs(this.location,this.session))).start(e),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(e,t,s){this.closeStream(),this.readyState=ye.CLOSED,this.onclose&&this.onclose({code:e,reason:t,wasClean:s})}onChunk(e){if(e.status===200){this.readyState===ye.OPEN&&this.onActivity();var t,s=e.data.slice(0,1);switch(s){case"o":t=JSON.parse(e.data.slice(1)||"{}"),this.onOpen(t);break;case"a":t=JSON.parse(e.data.slice(1)||"[]");for(var a=0;a<t.length;a++)this.onEvent(t[a]);break;case"m":t=JSON.parse(e.data.slice(1)||"null"),this.onEvent(t);break;case"h":this.hooks.onHeartbeat(this);break;case"c":t=JSON.parse(e.data.slice(1)||"[]"),this.onClose(t[0],t[1],!0);break}}}onOpen(e){this.readyState===ye.CONNECTING?(e&&e.hostname&&(this.location.base=xs(this.location.base,e.hostname)),this.readyState=ye.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(e){this.readyState===ye.OPEN&&this.onmessage&&this.onmessage({data:e})}onActivity(){this.onactivity&&this.onactivity()}onError(e){this.onerror&&this.onerror(e)}openStream(){this.stream=I.createSocketRequest("POST",$t(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",e=>{this.onChunk(e)}),this.stream.bind("finished",e=>{this.hooks.onFinished(this,e)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(e){$.defer(()=>{this.onError(e),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function ms(r){var e=/([^\?]*)\/*(\??.*)/.exec(r);return{base:e[1],queryString:e[2]}}function gs(r,e){return r.base+"/"+e+"/xhr_send"}function $t(r){var e=r.indexOf("?")===-1?"?":"&";return r+e+"t="+ +new Date+"&n="+ps++}function xs(r,e){var t=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(r);return t[1]+e+t[3]}function Zt(r){return I.randomInt(r)}function bs(r){for(var e=[],t=0;t<r;t++)e.push(Zt(32).toString(32));return e.join("")}var vs=fs,ws={getReceiveURL:function(r,e){return r.base+"/"+e+"/xhr_streaming"+r.queryString},onHeartbeat:function(r){r.sendRaw("[]")},sendHeartbeat:function(r){r.sendRaw("[]")},onFinished:function(r,e){r.onClose(1006,"Connection interrupted ("+e+")",!1)}},ys=ws,js={getReceiveURL:function(r,e){return r.base+"/"+e+"/xhr"+r.queryString},onHeartbeat:function(){},sendHeartbeat:function(r){r.sendRaw("[]")},onFinished:function(r,e){e===200?r.reconnect():r.onClose(1006,"Connection interrupted ("+e+")",!1)}},_s=js,ks={getRequest:function(r){var e=I.getXHRAPI(),t=new e;return t.onreadystatechange=t.onprogress=function(){switch(t.readyState){case 3:t.responseText&&t.responseText.length>0&&r.onChunk(t.status,t.responseText);break;case 4:t.responseText&&t.responseText.length>0&&r.onChunk(t.status,t.responseText),r.emit("finished",t.status),r.close();break}},t},abortRequest:function(r){r.onreadystatechange=null,r.abort()}},Ns=ks,Ss={createStreamingSocket(r){return this.createSocket(ys,r)},createPollingSocket(r){return this.createSocket(_s,r)},createSocket(r,e){return new vs(r,e)},createXHR(r,e){return this.createRequest(Ns,r,e)},createRequest(r,e,t){return new us(r,e,t)}},Qt=Ss;Qt.createXDR=function(r,e){return this.createRequest(ds,r,e)};var Cs=Qt,Ts={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:u,DependenciesReceivers:_,getDefaultStrategy:os,Transports:zn,transportConnectionInitializer:ls,HTTPFactory:Cs,TimelineTransport:kn,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(r){window.Pusher=r;var e=()=>{this.onDocumentBody(r.ready)};window.JSON?e():T.load("json2",{},e)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:X,jsonp:vn}},onDocumentBody(r){document.body?r():setTimeout(()=>{this.onDocumentBody(r)},0)},createJSONPRequest(r,e){return new yn(r,e)},createScriptRequest(r){return new wn(r)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var r=this.getXHRAPI();return new r},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return Un},createWebSocket(r){var e=this.getWebSocketAPI();return new e(r)},createSocketRequest(r,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(r,e);if(this.isXDRSupported(e.indexOf("https:")===0))return this.HTTPFactory.createXDR(r,e);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var r=this.getXHRAPI();return!!r&&new r().withCredentials!==void 0},isXDRSupported(r){var e=r?"https:":"http:",t=this.getProtocol();return!!window.XDomainRequest&&t===e},addUnloadListener(r){window.addEventListener!==void 0?window.addEventListener("unload",r,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",r)},removeUnloadListener(r){window.addEventListener!==void 0?window.removeEventListener("unload",r,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",r)},randomInt(r){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*r)}},I=Ts,at;(function(r){r[r.ERROR=3]="ERROR",r[r.INFO=6]="INFO",r[r.DEBUG=7]="DEBUG"})(at||(at={}));var He=at;class Ps{constructor(e,t,s){this.key=e,this.session=t,this.events=[],this.options=s||{},this.sent=0,this.uniqueID=0}log(e,t){e<=this.options.level&&(this.events.push(ee({},t,{timestamp:$.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(e){this.log(He.ERROR,e)}info(e){this.log(He.INFO,e)}debug(e){this.log(He.DEBUG,e)}isEmpty(){return this.events.length===0}send(e,t){var s=ee({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],e(s,(a,f)=>{a||this.sent++,t&&t(a,f)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class As{constructor(e,t,s,a){this.name=e,this.priority=t,this.transport=s,this.options=a||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(e,t){if(this.isSupported()){if(this.priority<e)return er(new R,t)}else return er(new j,t);var s=!1,a=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),f=null,w=function(){a.unbind("initialized",w),a.connect()},C=function(){f=he.createHandshake(a,function(Q){s=!0,F(),t(null,Q)})},E=function(Q){F(),t(Q)},B=function(){F();var Q;Q=ze(a),t(new U(Q))},F=function(){a.unbind("initialized",w),a.unbind("open",C),a.unbind("error",E),a.unbind("closed",B)};return a.bind("initialized",w),a.bind("open",C),a.bind("error",E),a.bind("closed",B),a.initialize(),{abort:()=>{s||(F(),f?f.close():a.close())},forceMinPriority:Q=>{s||this.priority<Q&&(f?f.close():a.close())}}}}function er(r,e){return $.defer(function(){e(r)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Es}=I;var Rs=function(r,e,t,s,a,f){var w=Es[t];if(!w)throw new L(t);var C=(!r.enabledTransports||ce(r.enabledTransports,e)!==-1)&&(!r.disabledTransports||ce(r.disabledTransports,e)===-1),E;return C?(a=Object.assign({ignoreNullOrigin:r.ignoreNullOrigin},a),E=new As(e,s,f?f.getAssistant(w):w,a)):E=Ls,E},Ls={isSupported:function(){return!1},connect:function(r,e){var t=$.defer(function(){e(new j)});return{abort:function(){t.ensureAborted()},forceMinPriority:function(){}}}};function Is(r){if(r==null)throw"You must pass an options object";if(r.cluster==null)throw"Options object must provide a cluster";"disableStats"in r&&J.warn("The disableStats option is deprecated in favor of enableStats")}const Os=(r,e)=>{var t="socket_id="+encodeURIComponent(r.socketId);for(var s in e.params)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(e.params[s]);if(e.paramsProvider!=null){let a=e.paramsProvider();for(var s in a)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(a[s])}return t};var Ms=r=>{if(typeof I.getAuthorizers()[r.transport]>"u")throw`'${r.transport}' is not a recognized auth transport`;return(e,t)=>{const s=Os(e,r);I.getAuthorizers()[r.transport](I,s,r,v.UserAuthentication,t)}};const zs=(r,e)=>{var t="socket_id="+encodeURIComponent(r.socketId);t+="&channel_name="+encodeURIComponent(r.channelName);for(var s in e.params)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(e.params[s]);if(e.paramsProvider!=null){let a=e.paramsProvider();for(var s in a)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(a[s])}return t};var Ds=r=>{if(typeof I.getAuthorizers()[r.transport]>"u")throw`'${r.transport}' is not a recognized auth transport`;return(e,t)=>{const s=zs(e,r);I.getAuthorizers()[r.transport](I,s,r,v.ChannelAuthorization,t)}};const Us=(r,e,t)=>{const s={authTransport:e.transport,authEndpoint:e.endpoint,auth:{params:e.params,headers:e.headers}};return(a,f)=>{const w=r.channel(a.channelName);t(w,s).authorize(a.socketId,f)}};function Hs(r,e){let t={activityTimeout:r.activityTimeout||y.activityTimeout,cluster:r.cluster,httpPath:r.httpPath||y.httpPath,httpPort:r.httpPort||y.httpPort,httpsPort:r.httpsPort||y.httpsPort,pongTimeout:r.pongTimeout||y.pongTimeout,statsHost:r.statsHost||y.stats_host,unavailableTimeout:r.unavailableTimeout||y.unavailableTimeout,wsPath:r.wsPath||y.wsPath,wsPort:r.wsPort||y.wsPort,wssPort:r.wssPort||y.wssPort,enableStats:qs(r),httpHost:Bs(r),useTLS:Vs(r),wsHost:Fs(r),userAuthenticator:Ws(r),channelAuthorizer:Xs(r,e)};return"disabledTransports"in r&&(t.disabledTransports=r.disabledTransports),"enabledTransports"in r&&(t.enabledTransports=r.enabledTransports),"ignoreNullOrigin"in r&&(t.ignoreNullOrigin=r.ignoreNullOrigin),"timelineParams"in r&&(t.timelineParams=r.timelineParams),"nacl"in r&&(t.nacl=r.nacl),t}function Bs(r){return r.httpHost?r.httpHost:r.cluster?`sockjs-${r.cluster}.pusher.com`:y.httpHost}function Fs(r){return r.wsHost?r.wsHost:Gs(r.cluster)}function Gs(r){return`ws-${r}.pusher.com`}function Vs(r){return I.getProtocol()==="https:"?!0:r.forceTLS!==!1}function qs(r){return"enableStats"in r?r.enableStats:"disableStats"in r?!r.disableStats:!1}function Ws(r){const e=Object.assign(Object.assign({},y.userAuthentication),r.userAuthentication);return"customHandler"in e&&e.customHandler!=null?e.customHandler:Ms(e)}function Js(r,e){let t;return"channelAuthorization"in r?t=Object.assign(Object.assign({},y.channelAuthorization),r.channelAuthorization):(t={transport:r.authTransport||y.authTransport,endpoint:r.authEndpoint||y.authEndpoint},"auth"in r&&("params"in r.auth&&(t.params=r.auth.params),"headers"in r.auth&&(t.headers=r.auth.headers)),"authorizer"in r&&(t.customHandler=Us(e,t,r.authorizer))),t}function Xs(r,e){const t=Js(r,e);return"customHandler"in t&&t.customHandler!=null?t.customHandler:Ds(t)}class Ys extends de{constructor(e){super(function(t,s){J.debug(`No callbacks on watchlist events for ${t}`)}),this.pusher=e,this.bindWatchlistInternalEvent()}handleEvent(e){e.data.events.forEach(t=>{this.emit(t.name,t)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",e=>{var t=e.event;t==="pusher_internal:watchlist_events"&&this.handleEvent(e)})}}function Ks(){let r,e;return{promise:new Promise((s,a)=>{r=s,e=a}),resolve:r,reject:e}}var $s=Ks;class Zs extends de{constructor(e){super(function(t,s){J.debug("No callbacks on user for "+t)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(t,s)=>{if(t){J.warn(`Error during signin: ${t}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:s.auth,user_data:s.user_data})},this.pusher=e,this.pusher.connection.bind("state_change",({previous:t,current:s})=>{t!=="connected"&&s==="connected"&&this._signin(),t==="connected"&&s!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new Ys(e),this.pusher.connection.bind("message",t=>{var s=t.event;s==="pusher:signin_success"&&this._onSigninSuccess(t.data),this.serverToUserChannel&&this.serverToUserChannel.name===t.channel&&this.serverToUserChannel.handleEvent(t)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(e){try{this.user_data=JSON.parse(e.user_data)}catch{J.error(`Failed parsing user data after signin: ${e.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){J.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const e=t=>{t.subscriptionPending&&t.subscriptionCancelled?t.reinstateSubscription():!t.subscriptionPending&&this.pusher.connection.state==="connected"&&t.subscribe()};this.serverToUserChannel=new et(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((t,s)=>{t.indexOf("pusher_internal:")===0||t.indexOf("pusher:")===0||this.emit(t,s)}),e(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:e,resolve:t}=$s();e.done=!1;const s=()=>{e.done=!0};e.then(s).catch(s),this.signinDonePromise=e,this._signinDoneResolve=t}}class re{static ready(){re.isReady=!0;for(var e=0,t=re.instances.length;e<t;e++)re.instances[e].connect()}static getClientFeatures(){return Me(Bt({ws:I.Transports.ws},function(e){return e.isSupported({})}))}constructor(e,t){Qs(e),Is(t),this.key=e,this.config=Hs(t,this),this.channels=he.createChannels(),this.global_emitter=new de,this.sessionID=I.randomInt(1e9),this.timeline=new Ps(this.key,this.sessionID,{cluster:this.config.cluster,features:re.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:He.INFO,version:y.VERSION}),this.config.enableStats&&(this.timelineSender=he.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+I.TimelineTransport.name}));var s=a=>I.getDefaultStrategy(this.config,a,Rs);this.connection=he.createConnectionManager(this.key,{getStrategy:s,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",a=>{var f=a.event,w=f.indexOf("pusher_internal:")===0;if(a.channel){var C=this.channel(a.channel);C&&C.handleEvent(a)}w||this.global_emitter.emit(a.event,a.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",a=>{J.warn(a)}),re.instances.push(this),this.timeline.info({instances:re.instances.length}),this.user=new Zs(this),re.isReady&&this.connect()}channel(e){return this.channels.find(e)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var e=this.connection.isUsingTLS(),t=this.timelineSender;this.timelineSenderTimer=new q(6e4,function(){t.send(e)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(e,t,s){return this.global_emitter.bind(e,t,s),this}unbind(e,t,s){return this.global_emitter.unbind(e,t,s),this}bind_global(e){return this.global_emitter.bind_global(e),this}unbind_global(e){return this.global_emitter.unbind_global(e),this}unbind_all(e){return this.global_emitter.unbind_all(),this}subscribeAll(){var e;for(e in this.channels.channels)this.channels.channels.hasOwnProperty(e)&&this.subscribe(e)}subscribe(e){var t=this.channels.add(e,this);return t.subscriptionPending&&t.subscriptionCancelled?t.reinstateSubscription():!t.subscriptionPending&&this.connection.state==="connected"&&t.subscribe(),t}unsubscribe(e){var t=this.channels.find(e);t&&t.subscriptionPending?t.cancelSubscription():(t=this.channels.remove(e),t&&t.subscribed&&t.unsubscribe())}send_event(e,t,s){return this.connection.send_event(e,t,s)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}re.instances=[],re.isReady=!1,re.logToConsole=!1,re.Runtime=I,re.ScriptReceivers=I.ScriptReceivers,re.DependenciesReceivers=I.DependenciesReceivers,re.auth_callbacks=I.auth_callbacks;var ot=o.default=re;function Qs(r){if(r==null)throw"You must pass your app key when you instantiate Pusher."}I.setup(re)}])})})(bt);var kr=bt.exports;const Nr=dt(kr);function vt(i,d,c,o,l){const[h,u]=O.useState(null),[x,y]=O.useState(null),[D,_]=O.useState([]),[T,p]=O.useState(!0),[S,N]=O.useState(null),v=O.useCallback(async()=>{try{p(!0);const L=c!=="all"?`&segment=${c}`:"",j=`&trafficType=${o}`;let P=`${i.endpoint}/stats?`;d==="custom"&&(l!=null&&l.start)&&(l!=null&&l.end)?P+=`startDate=${l.start}&endDate=${l.end}${L}${j}`:P+=`timeframe=${d}${L}${j}`;const G=await fetch(P,{headers:{"x-tenant-key":i.apiKey,"x-tenant-secret":i.adminSecret,"Cache-Control":"no-cache"}});if(G.ok){const X=await G.json();u(X),N(null)}else throw new Error("Failed to fetch stats")}catch(L){N(L.message)}finally{p(!1)}},[i.endpoint,i.apiKey,i.adminSecret,d,c,o,l]),m=O.useCallback(async()=>{try{const L=c!=="all"?`&segment=${c}`:"",j=`&trafficType=${o}`;let P=l==null?void 0:l.start,G=l==null?void 0:l.end;if(!P||!G){const te=new Date,z=new Date;d==="7d"?z.setDate(te.getDate()-7):d==="30d"?z.setDate(te.getDate()-30):z.setHours(te.getHours()-24),P=z.toISOString().split("T")[0],G=te.toISOString().split("T")[0]}const X=await fetch(`${i.endpoint}/funnel?startDate=${P}&endDate=${G}${L}${j}`,{headers:{"x-tenant-key":i.apiKey,"x-tenant-secret":i.adminSecret,"Cache-Control":"no-cache"}});if(X.ok){const te=await X.json();y(te)}}catch(L){console.error("[Dashboard] funnel fetch error:",L)}},[i.endpoint,i.apiKey,i.adminSecret,d,c,o,l]),b=O.useCallback(async()=>{try{const L=await fetch(`${i.endpoint}/heatmap/pages`,{headers:{"x-tenant-key":i.apiKey,"x-tenant-secret":i.adminSecret,"Cache-Control":"no-cache"}});if(L.ok){const j=await L.json();_(j)}}catch(L){console.error("[Dashboard] heatmap pages fetch error:",L)}},[i.endpoint,i.apiKey,i.adminSecret]),k=O.useRef(0),R=O.useRef(null),U=O.useCallback(()=>{v(),m(),b()},[v,m,b]),H=O.useCallback(()=>{R.current&&clearTimeout(R.current);const L=Date.now(),j=L-k.current;j>2e3?(U(),k.current=L):R.current=setTimeout(()=>{U(),k.current=Date.now()},2e3-j)},[U]);return O.useEffect(()=>{if(v(),m(),b(),i.realtimeEnabled){const L=new Nr(i.soketiKey||"infrabricks_key",{wsHost:i.soketiHost||"127.0.0.1",wsPort:i.soketiPort||443,forceTLS:i.soketiUseTLS!==!1,enabledTransports:["ws","wss"],cluster:"mt1"}),j=`analytics-${i.apiKey}`,P=L.subscribe(j);return P.bind("new-session",H),P.bind("new-pageview",H),P.bind("new-event",H),P.bind("heartbeat",H),P.bind("session-offline",H),()=>{L.unsubscribe(j),L.disconnect()}}},[v,m,H,i.realtimeEnabled,i.soketiHost,i.soketiKey,i.soketiPort,i.soketiUseTLS,i.apiKey]),O.useEffect(()=>{const L=setInterval(U,i.refreshInterval||6e4);return()=>clearInterval(L)},[U,i.refreshInterval]),{stats:h,funnel:x,heatmapPages:D,loading:T,error:S,refresh:v}}function wt(i){var d,c,o="";if(typeof i=="string"||typeof i=="number")o+=i;else if(typeof i=="object")if(Array.isArray(i)){var l=i.length;for(d=0;d<l;d++)i[d]&&(c=wt(i[d]))&&(o&&(o+=" "),o+=c)}else for(c in i)i[c]&&(o&&(o+=" "),o+=c);return o}function Sr(){for(var i,d,c=0,o="",l=arguments.length;c<l;c++)(i=arguments[c])&&(d=wt(i))&&(o&&(o+=" "),o+=d);return o}const We="-",Cr=i=>{const d=Pr(i),{conflictingClassGroups:c,conflictingClassGroupModifiers:o}=i;return{getClassGroupId:u=>{const x=u.split(We);return x[0]===""&&x.length!==1&&x.shift(),yt(x,d)||Tr(u)},getConflictingClassGroupIds:(u,x)=>{const y=c[u]||[];return x&&o[u]?[...y,...o[u]]:y}}},yt=(i,d)=>{var u;if(i.length===0)return d.classGroupId;const c=i[0],o=d.nextPart.get(c),l=o?yt(i.slice(1),o):void 0;if(l)return l;if(d.validators.length===0)return;const h=i.join(We);return(u=d.validators.find(({validator:x})=>x(h)))==null?void 0:u.classGroupId},jt=/^\[(.+)\]$/,Tr=i=>{if(jt.test(i)){const d=jt.exec(i)[1],c=d==null?void 0:d.substring(0,d.indexOf(":"));if(c)return"arbitrary.."+c}},Pr=i=>{const{theme:d,prefix:c}=i,o={nextPart:new Map,validators:[]};return Er(Object.entries(i.classGroups),c).forEach(([h,u])=>{Je(u,o,h,d)}),o},Je=(i,d,c,o)=>{i.forEach(l=>{if(typeof l=="string"){const h=l===""?d:_t(d,l);h.classGroupId=c;return}if(typeof l=="function"){if(Ar(l)){Je(l(o),d,c,o);return}d.validators.push({validator:l,classGroupId:c});return}Object.entries(l).forEach(([h,u])=>{Je(u,_t(d,h),c,o)})})},_t=(i,d)=>{let c=i;return d.split(We).forEach(o=>{c.nextPart.has(o)||c.nextPart.set(o,{nextPart:new Map,validators:[]}),c=c.nextPart.get(o)}),c},Ar=i=>i.isThemeGetter,Er=(i,d)=>d?i.map(([c,o])=>{const l=o.map(h=>typeof h=="string"?d+h:typeof h=="object"?Object.fromEntries(Object.entries(h).map(([u,x])=>[d+u,x])):h);return[c,l]}):i,Rr=i=>{if(i<1)return{get:()=>{},set:()=>{}};let d=0,c=new Map,o=new Map;const l=(h,u)=>{c.set(h,u),d++,d>i&&(d=0,o=c,c=new Map)};return{get(h){let u=c.get(h);if(u!==void 0)return u;if((u=o.get(h))!==void 0)return l(h,u),u},set(h,u){c.has(h)?c.set(h,u):l(h,u)}}},kt="!",Lr=i=>{const{separator:d,experimentalParseClassName:c}=i,o=d.length===1,l=d[0],h=d.length,u=x=>{const y=[];let D=0,_=0,T;for(let m=0;m<x.length;m++){let b=x[m];if(D===0){if(b===l&&(o||x.slice(m,m+h)===d)){y.push(x.slice(_,m)),_=m+h;continue}if(b==="/"){T=m;continue}}b==="["?D++:b==="]"&&D--}const p=y.length===0?x:x.substring(_),S=p.startsWith(kt),N=S?p.substring(1):p,v=T&&T>_?T-_:void 0;return{modifiers:y,hasImportantModifier:S,baseClassName:N,maybePostfixModifierPosition:v}};return c?x=>c({className:x,parseClassName:u}):u},Ir=i=>{if(i.length<=1)return i;const d=[];let c=[];return i.forEach(o=>{o[0]==="["?(d.push(...c.sort(),o),c=[]):c.push(o)}),d.push(...c.sort()),d},Or=i=>({cache:Rr(i.cacheSize),parseClassName:Lr(i),...Cr(i)}),Mr=/\s+/,zr=(i,d)=>{const{parseClassName:c,getClassGroupId:o,getConflictingClassGroupIds:l}=d,h=[],u=i.trim().split(Mr);let x="";for(let y=u.length-1;y>=0;y-=1){const D=u[y],{modifiers:_,hasImportantModifier:T,baseClassName:p,maybePostfixModifierPosition:S}=c(D);let N=!!S,v=o(N?p.substring(0,S):p);if(!v){if(!N){x=D+(x.length>0?" "+x:x);continue}if(v=o(p),!v){x=D+(x.length>0?" "+x:x);continue}N=!1}const m=Ir(_).join(":"),b=T?m+kt:m,k=b+v;if(h.includes(k))continue;h.push(k);const R=l(v,N);for(let U=0;U<R.length;++U){const H=R[U];h.push(b+H)}x=D+(x.length>0?" "+x:x)}return x};function Dr(){let i=0,d,c,o="";for(;i<arguments.length;)(d=arguments[i++])&&(c=Nt(d))&&(o&&(o+=" "),o+=c);return o}const Nt=i=>{if(typeof i=="string")return i;let d,c="";for(let o=0;o<i.length;o++)i[o]&&(d=Nt(i[o]))&&(c&&(c+=" "),c+=d);return c};function Ur(i,...d){let c,o,l,h=u;function u(y){const D=d.reduce((_,T)=>T(_),i());return c=Or(D),o=c.cache.get,l=c.cache.set,h=x,x(y)}function x(y){const D=o(y);if(D)return D;const _=zr(y,c);return l(y,_),_}return function(){return h(Dr.apply(null,arguments))}}const V=i=>{const d=c=>c[i]||[];return d.isThemeGetter=!0,d},St=/^\[(?:([a-z-]+):)?(.+)\]$/i,Hr=/^\d+\/\d+$/,Br=new Set(["px","full","screen"]),Fr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Vr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,qr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Wr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oe=i=>je(i)||Br.has(i)||Hr.test(i),ue=i=>_e(i,"length",en),je=i=>!!i&&!Number.isNaN(Number(i)),Xe=i=>_e(i,"number",je),Te=i=>!!i&&Number.isInteger(Number(i)),Jr=i=>i.endsWith("%")&&je(i.slice(0,-1)),M=i=>St.test(i),pe=i=>Fr.test(i),Xr=new Set(["length","size","percentage"]),Yr=i=>_e(i,Xr,Ct),Kr=i=>_e(i,"position",Ct),$r=new Set(["image","url"]),Zr=i=>_e(i,$r,rn),Qr=i=>_e(i,"",tn),Pe=()=>!0,_e=(i,d,c)=>{const o=St.exec(i);return o?o[1]?typeof d=="string"?o[1]===d:d.has(o[1]):c(o[2]):!1},en=i=>Gr.test(i)&&!Vr.test(i),Ct=()=>!1,tn=i=>qr.test(i),rn=i=>Wr.test(i),nn=Ur(()=>{const i=V("colors"),d=V("spacing"),c=V("blur"),o=V("brightness"),l=V("borderColor"),h=V("borderRadius"),u=V("borderSpacing"),x=V("borderWidth"),y=V("contrast"),D=V("grayscale"),_=V("hueRotate"),T=V("invert"),p=V("gap"),S=V("gradientColorStops"),N=V("gradientColorStopPositions"),v=V("inset"),m=V("margin"),b=V("opacity"),k=V("padding"),R=V("saturate"),U=V("scale"),H=V("sepia"),L=V("skew"),j=V("space"),P=V("translate"),G=()=>["auto","contain","none"],X=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto",M,d],z=()=>[M,d],ne=()=>["",oe,ue],fe=()=>["auto",je,M],me=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],le=()=>["solid","dashed","dotted","double","none"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>["start","end","center","between","around","evenly","stretch"],ae=()=>["","0",M],be=()=>["auto","avoid","all","avoid-page","page","left","right","column"],g=()=>[je,M];return{cacheSize:500,separator:":",theme:{colors:[Pe],spacing:[oe,ue],blur:["none","",pe,M],brightness:g(),borderColor:[i],borderRadius:["none","","full",pe,M],borderSpacing:z(),borderWidth:ne(),contrast:g(),grayscale:ae(),hueRotate:g(),invert:ae(),gap:z(),gradientColorStops:[i],gradientColorStopPositions:[Jr,ue],inset:te(),margin:te(),opacity:g(),padding:z(),saturate:g(),scale:g(),sepia:ae(),skew:g(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",M]}],container:["container"],columns:[{columns:[pe]}],"break-after":[{"break-after":be()}],"break-before":[{"break-before":be()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...me(),M]}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:G()}],"overscroll-x":[{"overscroll-x":G()}],"overscroll-y":[{"overscroll-y":G()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Te,M]}],basis:[{basis:te()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",M]}],grow:[{grow:ae()}],shrink:[{shrink:ae()}],order:[{order:["first","last","none",Te,M]}],"grid-cols":[{"grid-cols":[Pe]}],"col-start-end":[{col:["auto",{span:["full",Te,M]},M]}],"col-start":[{"col-start":fe()}],"col-end":[{"col-end":fe()}],"grid-rows":[{"grid-rows":[Pe]}],"row-start-end":[{row:["auto",{span:[Te,M]},M]}],"row-start":[{"row-start":fe()}],"row-end":[{"row-end":fe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",M]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",M]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...ge()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ge(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ge(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",M,d]}],"min-w":[{"min-w":[M,d,"min","max","fit"]}],"max-w":[{"max-w":[M,d,"none","full","min","max","fit","prose",{screen:[pe]},pe]}],h:[{h:[M,d,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[M,d,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[M,d,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[M,d,"auto","min","max","fit"]}],"font-size":[{text:["base",pe,ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xe]}],"font-family":[{font:[Pe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",M]}],"line-clamp":[{"line-clamp":["none",je,Xe]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",oe,M]}],"list-image":[{"list-image":["none",M]}],"list-style-type":[{list:["none","disc","decimal",M]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[i]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[i]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",oe,ue]}],"underline-offset":[{"underline-offset":["auto",oe,M]}],"text-decoration-color":[{decoration:[i]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",M]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",M]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...me(),Kr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Yr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Zr]}],"bg-color":[{bg:[i]}],"gradient-from-pos":[{from:[N]}],"gradient-via-pos":[{via:[N]}],"gradient-to-pos":[{to:[N]}],"gradient-from":[{from:[S]}],"gradient-via":[{via:[S]}],"gradient-to":[{to:[S]}],rounded:[{rounded:[h]}],"rounded-s":[{"rounded-s":[h]}],"rounded-e":[{"rounded-e":[h]}],"rounded-t":[{"rounded-t":[h]}],"rounded-r":[{"rounded-r":[h]}],"rounded-b":[{"rounded-b":[h]}],"rounded-l":[{"rounded-l":[h]}],"rounded-ss":[{"rounded-ss":[h]}],"rounded-se":[{"rounded-se":[h]}],"rounded-ee":[{"rounded-ee":[h]}],"rounded-es":[{"rounded-es":[h]}],"rounded-tl":[{"rounded-tl":[h]}],"rounded-tr":[{"rounded-tr":[h]}],"rounded-br":[{"rounded-br":[h]}],"rounded-bl":[{"rounded-bl":[h]}],"border-w":[{border:[x]}],"border-w-x":[{"border-x":[x]}],"border-w-y":[{"border-y":[x]}],"border-w-s":[{"border-s":[x]}],"border-w-e":[{"border-e":[x]}],"border-w-t":[{"border-t":[x]}],"border-w-r":[{"border-r":[x]}],"border-w-b":[{"border-b":[x]}],"border-w-l":[{"border-l":[x]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...le(),"hidden"]}],"divide-x":[{"divide-x":[x]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[x]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:le()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...le()]}],"outline-offset":[{"outline-offset":[oe,M]}],"outline-w":[{outline:[oe,ue]}],"outline-color":[{outline:[i]}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[i]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[oe,ue]}],"ring-offset-color":[{"ring-offset":[i]}],shadow:[{shadow:["","inner","none",pe,Qr]}],"shadow-color":[{shadow:[Pe]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...xe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":xe()}],filter:[{filter:["","none"]}],blur:[{blur:[c]}],brightness:[{brightness:[o]}],contrast:[{contrast:[y]}],"drop-shadow":[{"drop-shadow":["","none",pe,M]}],grayscale:[{grayscale:[D]}],"hue-rotate":[{"hue-rotate":[_]}],invert:[{invert:[T]}],saturate:[{saturate:[R]}],sepia:[{sepia:[H]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[c]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[y]}],"backdrop-grayscale":[{"backdrop-grayscale":[D]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_]}],"backdrop-invert":[{"backdrop-invert":[T]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[R]}],"backdrop-sepia":[{"backdrop-sepia":[H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[u]}],"border-spacing-x":[{"border-spacing-x":[u]}],"border-spacing-y":[{"border-spacing-y":[u]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",M]}],duration:[{duration:g()}],ease:[{ease:["linear","in","out","in-out",M]}],delay:[{delay:g()}],animate:[{animate:["none","spin","ping","pulse","bounce",M]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[U]}],"scale-x":[{"scale-x":[U]}],"scale-y":[{"scale-y":[U]}],rotate:[{rotate:[Te,M]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[L]}],"skew-y":[{"skew-y":[L]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",M]}],accent:[{accent:["auto",i]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",M]}],"caret-color":[{caret:[i]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",M]}],fill:[{fill:[i,"none"]}],"stroke-w":[{stroke:[oe,ue,Xe]}],stroke:[{stroke:[i,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),Tt={"Ascension Island":"🇦🇨",Andorra:"🇦🇩","United Arab Emirates":"🇦🇪",Afghanistan:"🇦🇫","Antigua & Barbuda":"🇦🇬",Anguilla:"🇦🇮",Albania:"🇦🇱",Armenia:"🇦🇲",Angola:"🇦🇴",Antarctica:"🇦🇶",Argentina:"🇦🇷","American Samoa":"🇦🇸",Austria:"🇦🇹",Australia:"🇦🇺",Aruba:"🇦🇼","Åland Islands":"🇦🇽",Azerbaijan:"🇦🇿","Bosnia & Herzegovina":"🇧🇦",Barbados:"🇧🇧",Bangladesh:"🇧🇩",Belgium:"🇧🇪","Burkina Faso":"🇧🇫",Bulgaria:"🇧🇬",Bahrain:"🇧🇭",Burundi:"🇧🇮",Benin:"🇧🇯","St. Barthélemy":"🇧🇱",Bermuda:"🇧🇲",Brunei:"🇧🇳",Bolivia:"🇧🇴","Caribbean Netherlands":"🇧🇶",Brazil:"🇧🇷",Bahamas:"🇧🇸",Bhutan:"🇧🇹","Bouvet Island":"🇧🇻",Botswana:"🇧🇼",Belarus:"🇧🇾",Belize:"🇧🇿",Canada:"🇨🇦","Cocos (Keeling) Islands":"🇨🇨","Congo - Kinshasa":"🇨🇩","Central African Republic":"🇨🇫","Congo - Brazzaville":"🇨🇬",Switzerland:"🇨🇭","Côte d’Ivoire":"🇨🇮","Cook Islands":"🇨🇰",Chile:"🇨🇱",Cameroon:"🇨🇲",China:"🇨🇳",Colombia:"🇨🇴","Clipperton Island":"🇨🇵","Costa Rica":"🇨🇷",Cuba:"🇨🇺","Cape Verde":"🇨🇻",Curaçao:"🇨🇼","Christmas Island":"🇨🇽",Cyprus:"🇨🇾",Czechia:"🇨🇿",Germany:"🇩🇪","Diego Garcia":"🇩🇬",Djibouti:"🇩🇯",Denmark:"🇩🇰",Dominica:"🇩🇲","Dominican Republic":"🇩🇴",Algeria:"🇩🇿","Ceuta & Melilla":"🇪🇦",Ecuador:"🇪🇨",Estonia:"🇪🇪",Egypt:"🇪🇬","Western Sahara":"🇪🇭",Eritrea:"🇪🇷",Spain:"🇪🇸",Ethiopia:"🇪🇹","European Union":"🇪🇺",Finland:"🇫🇮",Fiji:"🇫🇯","Falkland Islands":"🇫🇰",Micronesia:"🇫🇲","Faroe Islands":"🇫🇴",France:"🇫🇷",Gabon:"🇬🇦","United Kingdom":"🇬🇧",Grenada:"🇬🇩",Georgia:"🇬🇪","French Guiana":"🇬🇫",Guernsey:"🇬🇬",Ghana:"🇬🇭",Gibraltar:"🇬🇮",Greenland:"🇬🇱",Gambia:"🇬🇲",Guinea:"🇬🇳",Guadeloupe:"🇬🇵","Equatorial Guinea":"🇬🇶",Greece:"🇬🇷","South Georgia & South Sandwich Islands":"🇬🇸",Guatemala:"🇬🇹",Guam:"🇬🇺","Guinea-Bissau":"🇬🇼",Guyana:"🇬🇾","Hong Kong SAR China":"🇭🇰","Heard & McDonald Islands":"🇭🇲",Honduras:"🇭🇳",Croatia:"🇭🇷",Haiti:"🇭🇹",Hungary:"🇭🇺","Canary Islands":"🇮🇨",Indonesia:"🇮🇩",Ireland:"🇮🇪",Israel:"🇮🇱","Isle of Man":"🇮🇲",India:"🇮🇳","British Indian Ocean Territory":"🇮🇴",Iraq:"🇮🇶",Iran:"🇮🇷",Iceland:"🇮🇸",Italy:"🇮🇹",Jersey:"🇯🇪",Jamaica:"🇯🇲",Jordan:"🇯🇴",Japan:"🇯🇵",Kenya:"🇰🇪",Kyrgyzstan:"🇰🇬",Cambodia:"🇰🇭",Kiribati:"🇰🇮",Comoros:"🇰🇲","St. Kitts & Nevis":"🇰🇳","North Korea":"🇰🇵","South Korea":"🇰🇷",Kuwait:"🇰🇼","Cayman Islands":"🇰🇾",Kazakhstan:"🇰🇿",Laos:"🇱🇦",Lebanon:"🇱🇧","St. Lucia":"🇱🇨",Liechtenstein:"🇱🇮","Sri Lanka":"🇱🇰",Liberia:"🇱🇷",Lesotho:"🇱🇸",Lithuania:"🇱🇹",Luxembourg:"🇱🇺",Latvia:"🇱🇻",Libya:"🇱🇾",Morocco:"🇲🇦",Monaco:"🇲🇨",Moldova:"🇲🇩",Montenegro:"🇲🇪","St. Martin":"🇲🇫",Madagascar:"🇲🇬","Marshall Islands":"🇲🇭","North Macedonia":"🇲🇰",Mali:"🇲🇱","Myanmar (Burma)":"🇲🇲",Mongolia:"🇲🇳","Macao SAR China":"🇲🇴","Northern Mariana Islands":"🇲🇵",Martinique:"🇲🇶",Mauritania:"🇲🇷",Montserrat:"🇲🇸",Malta:"🇲🇹",Mauritius:"🇲🇺",Maldives:"🇲🇻",Malawi:"🇲🇼",Mexico:"🇲🇽",Malaysia:"🇲🇾",Mozambique:"🇲🇿",Namibia:"🇳🇦","New Caledonia":"🇳🇨",Niger:"🇳🇪","Norfolk Island":"🇳🇫",Nigeria:"🇳🇬",Nicaragua:"🇳🇮",Netherlands:"🇳🇱",Norway:"🇳🇴",Nepal:"🇳🇵",Nauru:"🇳🇷",Niue:"🇳🇺","New Zealand":"🇳🇿",Oman:"🇴🇲",Panama:"🇵🇦",Peru:"🇵🇪","French Polynesia":"🇵🇫","Papua New Guinea":"🇵🇬",Philippines:"🇵🇭",Pakistan:"🇵🇰",Poland:"🇵🇱","St. Pierre & Miquelon":"🇵🇲","Pitcairn Islands":"🇵🇳","Puerto Rico":"🇵🇷","Palestinian Territories":"🇵🇸",Portugal:"🇵🇹",Palau:"🇵🇼",Paraguay:"🇵🇾",Qatar:"🇶🇦",Réunion:"🇷🇪",Romania:"🇷🇴",Serbia:"🇷🇸",Russia:"🇷🇺",Rwanda:"🇷🇼","Saudi Arabia":"🇸🇦","Solomon Islands":"🇸🇧",Seychelles:"🇸🇨",Sudan:"🇸🇩",Sweden:"🇸🇪",Singapore:"🇸🇬","St. Helena":"🇸🇭",Slovenia:"🇸🇮","Svalbard & Jan Mayen":"🇸🇯",Slovakia:"🇸🇰","Sierra Leone":"🇸🇱","San Marino":"🇸🇲",Senegal:"🇸🇳",Somalia:"🇸🇴",Suriname:"🇸🇷","South Sudan":"🇸🇸","São Tomé & Príncipe":"🇸🇹","El Salvador":"🇸🇻","Sint Maarten":"🇸🇽",Syria:"🇸🇾",Eswatini:"🇸🇿","Tristan da Cunha":"🇹🇦","Turks & Caicos Islands":"🇹🇨",Chad:"🇹🇩","French Southern Territories":"🇹🇫",Togo:"🇹🇬",Thailand:"🇹🇭",Tajikistan:"🇹🇯",Tokelau:"🇹🇰","Timor-Leste":"🇹🇱",Turkmenistan:"🇹🇲",Tunisia:"🇹🇳",Tonga:"🇹🇴",Turkey:"🇹🇷","Trinidad & Tobago":"🇹🇹",Tuvalu:"🇹🇻",Taiwan:"🇹🇼",Tanzania:"🇹🇿",Ukraine:"🇺🇦",Uganda:"🇺🇬","U.S. Outlying Islands":"🇺🇲","United Nations":"🇺🇳","United States":"🇺🇸",Uruguay:"🇺🇾",Uzbekistan:"🇺🇿","Vatican City":"🇻🇦","St. Vincent & Grenadines":"🇻🇨",Venezuela:"🇻🇪","British Virgin Islands":"🇻🇬","U.S. Virgin Islands":"🇻🇮",Vietnam:"🇻🇳",Vanuatu:"🇻🇺","Wallis & Futuna":"🇼🇫",Samoa:"🇼🇸",Kosovo:"🇽🇰",Yemen:"🇾🇪",Mayotte:"🇾🇹","South Africa":"🇿🇦",Zambia:"🇿🇲",Zimbabwe:"🇿🇼",England:"🏴",Scotland:"🏴",Wales:"🏴"},Oe=(i,d)=>!i&&!d?"🌐":d&&d.length===2?d.toUpperCase().split("").map(c=>String.fromCodePoint(c.charCodeAt(0)+127397)).join(""):i&&Tt[i]||"🌐",sn=i=>new Intl.NumberFormat().format(i),Ye=i=>{const d=new Date,c=new Date(i),o=Math.floor((d.getTime()-c.getTime())/1e3);return o<60?"Just now":o<3600?`${Math.floor(o/60)}m ago`:o<86400?`${Math.floor(o/3600)}h ago`:c.toLocaleDateString()},Pt=i=>{const d=new Date(i),c=d.getDate(),o=d.toLocaleString("en-US",{month:"long"}),l=d.toLocaleString("en-US",{weekday:"long"});return d.getFullYear(),`${l} ${c}${(u=>{if(u>3&&u<21)return"th";switch(u%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}})(c)}, ${o}`};function ie(...i){return nn(Sr(i))}function ke({label:i,value:d,icon:c,color:o,pulse:l}){const h={blue:"text-blue-400 bg-blue-500/10",purple:"text-purple-400 bg-purple-500/10",green:"text-green-400 bg-green-500/10",orange:"text-orange-400 bg-orange-500/10",red:"text-red-400 bg-red-500/10"};return n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 p-6 rounded-3xl backdrop-blur-xl group hover:border-white/10 transition-all relative overflow-hidden",children:[l&&n.jsxs("div",{className:"absolute top-4 right-4 flex h-3 w-3",children:[n.jsx("span",{className:ie("animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",o==="green"?"bg-green-400":"bg-blue-400")}),n.jsx("span",{className:ie("relative inline-flex rounded-full h-3 w-3",o==="green"?"bg-green-500":"bg-blue-500")})]}),n.jsx("div",{className:ie("w-10 h-10 rounded-2xl flex items-center justify-center mb-4",h[o]),children:c}),n.jsx("p",{className:"text-slate-400 text-sm font-medium mb-1",children:i}),n.jsx("p",{className:"text-3xl font-bold text-white tracking-tight",children:d})]})}function At({stats:i}){var l,h;const d=((l=i==null?void 0:i.summary)==null?void 0:l.realtimeActivity)||Array(30).fill(0),c=((h=i==null?void 0:i.summary)==null?void 0:h.realtimeActivityDetails)||Array(30).fill([]),o=Math.max(...d,1);return n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsxs("div",{children:[n.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[n.jsx(Ie,{className:"w-5 h-5 text-blue-400"}),"Page Views per Minute"]}),n.jsx("p",{className:"text-slate-500 text-sm",children:"Real-time activity for the last 30 minutes"})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("span",{className:"text-3xl font-black text-white",children:d[d.length-1]||0}),n.jsx("p",{className:"text-[10px] text-slate-500 uppercase tracking-widest font-bold",children:"Views in last minute"})]})]}),n.jsx("div",{className:"flex items-end gap-1.5 h-32",children:d.map((u,x)=>{const y=u/o*100,D=c[x]||[];return n.jsx("div",{className:ie("flex-1 transition-all duration-500 rounded-t-lg relative group",x===d.length-1?"bg-blue-500 shadow-[0_0_15px_rgba(59,130,246,0.5)]":"bg-blue-500/20 hover:bg-blue-500/40"),style:{height:`${Math.max(y,4)}%`},children:n.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-3 bg-slate-800 text-white text-[10px] py-2 px-3 rounded-lg opacity-0 group-hover:opacity-100 whitespace-nowrap pointer-events-none z-10 border border-white/10 shadow-2xl backdrop-blur-md transition-opacity min-w-[120px]",children:[n.jsxs("div",{className:"font-bold mb-1",children:[u," views • ",d.length-1-x,"m ago"]}),D.length>0&&n.jsxs("div",{className:"space-y-0.5 border-t border-white/10 pt-1.5 mt-1",children:[D.slice(0,3).map((_,T)=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-sm",children:Oe(_.country,_.countryCode)}),n.jsx("span",{className:"text-slate-300 truncate max-w-[80px]",children:_.city||_.country}),n.jsxs("span",{className:"text-slate-500 ml-auto",children:["(",_.count,")"]})]},T)),D.length>3&&n.jsxs("div",{className:"text-slate-500 text-[9px]",children:["+",D.length-3," more"]})]})]})},x)})}),n.jsxs("div",{className:"flex justify-between mt-4",children:[n.jsx("span",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-[0.2em]",children:"30 minutes ago"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse shadow-[0_0_8px_rgba(34,197,94,0.5)]"}),n.jsx("span",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-[0.2em]",children:"Live"})]})]})]})}function Et({pages:i,totalViews:d}){return n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsx("div",{className:"flex items-center justify-between mb-8",children:n.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[n.jsx(br,{className:"w-5 h-5 text-blue-400"}),"Most Visited Pages"]})}),n.jsxs("div",{className:"space-y-4",children:[i.map((c,o)=>n.jsxs("div",{className:"group flex items-center justify-between p-4 rounded-2xl bg-white/5 hover:bg-white/10 transition-all border border-transparent hover:border-white/10",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("span",{className:"text-xs font-bold text-slate-500 w-4",children:o+1}),n.jsx("span",{className:"text-slate-300 font-medium group-hover:text-blue-400 transition-colors uppercase tracking-wider text-xs",children:c.path==="/"?"Home":c.path.replace("/","").replace(/-/g," ")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-white font-bold",children:c.count}),n.jsx("div",{className:"w-16 bg-white/5 h-1.5 rounded-full overflow-hidden",children:n.jsx("div",{className:"bg-blue-500 h-full rounded-full",style:{width:`${c.count/(d||1)*100}%`}})})]})]},o)),i.length===0&&n.jsx("p",{className:"text-center text-slate-500 py-8 italic",children:"No page view data yet."})]})]})}function Rt({geo:i,cities:d}){return n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsx("div",{className:"flex items-center justify-between mb-8",children:n.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[n.jsx(Ge,{className:"w-5 h-5 text-purple-400"}),"Top Locations"]})}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-xs font-bold text-slate-500 uppercase tracking-widest mb-4",children:"Countries"}),n.jsx("div",{className:"space-y-3",children:i.map((c,o)=>c.country!=="Unknown"&&o<5&&n.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl bg-white/5 border border-transparent",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("span",{className:"text-lg",children:Oe(c.country,c.countryCode)}),n.jsx("span",{className:"text-slate-300 font-medium text-sm",children:c.country})]}),n.jsx("span",{className:"text-white font-bold text-sm",children:c.count})]},o))})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-xs font-bold text-slate-500 uppercase tracking-widest mb-4",children:"Cities"}),n.jsx("div",{className:"grid grid-cols-2 gap-3",children:d.map((c,o)=>n.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl bg-blue-500/5 border border-blue-500/10",children:[n.jsx("span",{className:"text-slate-300 text-sm truncate",children:c.city}),n.jsx("span",{className:"text-blue-400 font-bold text-sm",children:c.count})]},o))})]}),i.length===0&&n.jsx("p",{className:"text-center text-slate-500 py-12 italic",children:"Waiting for more traffic data..."})]})]})}function Lt({sources:i,referrers:d}){return n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(Ie,{className:"w-5 h-5 text-orange-400"}),"Traffic Sources (UTM)"]}),n.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[i.map((c,o)=>n.jsxs("div",{className:"flex items-center justify-between p-4 rounded-2xl bg-white/5 border border-white/5",children:[n.jsx("span",{className:"text-slate-300 font-medium",children:c.source}),n.jsx("span",{className:"text-white font-bold",children:c.count})]},o)),i.length===0&&n.jsx("p",{className:"text-slate-500 italic text-sm",children:"No UTM parameters detected yet."})]})]}),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsx("h2",{className:"text-xl font-bold text-white mb-8",children:"Top Referrers"}),n.jsxs("div",{className:"space-y-4",children:[d.map((c,o)=>n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("span",{className:"text-slate-400 text-[10px] truncate max-w-full italic",children:c.url||"Direct"}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-white font-medium text-sm",children:c.url?new URL(c.url).hostname:"Direct Entry"}),n.jsx("span",{className:"text-blue-400 font-bold",children:c.count})]})]},o)),d.length===0&&n.jsx("p",{className:"text-slate-500 italic text-sm",children:"No referrers detected yet."})]})]})]})}function It({session:i}){var c;if(!i.pageViews&&!i.events)return null;const d=[...(i.pageViews||[]).map(o=>({...o,type:"page_view"})),...(i.events||[]).map(o=>{var l;return{...o,type:"event",path:((l=o.metadata)==null?void 0:l.path)||"Action"}})].sort((o,l)=>new Date(o.timestamp).getTime()-new Date(l.timestamp).getTime());return d.length===0?n.jsx("div",{className:"py-8 text-center text-slate-500 italic text-sm",children:"No detailed navigation data available for this session."}):n.jsxs("div",{className:"py-8 px-10 bg-white/[0.01] border-t border-white/5",children:[n.jsx("h3",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest mb-4",children:"Navigation Journey"}),n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-8",children:[n.jsxs("div",{className:"bg-white/5 border border-white/5 rounded-2xl p-4 flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg bg-blue-500/10 flex items-center justify-center text-blue-400",children:n.jsx(ft,{className:"w-4 h-4"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-tight",children:"Browser"}),n.jsx("p",{className:"text-white text-xs font-medium",children:i.browser||"Unknown"})]})]}),n.jsxs("div",{className:"bg-white/5 border border-white/5 rounded-2xl p-4 flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg bg-purple-500/10 flex items-center justify-center text-purple-400",children:n.jsx(gt,{className:"w-4 h-4"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-tight",children:"OS & Screen"}),n.jsxs("p",{className:"text-white text-xs font-medium",children:[i.os||"Unknown",i.screenWidth&&` (${i.screenWidth}x${i.screenHeight})`]})]})]}),n.jsxs("div",{className:"bg-white/5 border border-white/5 rounded-2xl p-4 flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg bg-green-500/10 flex items-center justify-center text-green-400",children:n.jsx(vr,{className:"w-4 h-4"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-tight",children:"Language"}),n.jsx("p",{className:"text-white text-xs font-medium uppercase",children:i.language||"Unknown"})]})]}),n.jsxs("div",{className:"bg-white/5 border border-white/5 rounded-2xl p-4 flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg bg-yellow-500/10 flex items-center justify-center text-yellow-400",children:n.jsx(Ge,{className:"w-4 h-4"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-tight",children:"Network / ISP"}),n.jsx("p",{className:"text-white text-xs font-medium truncate max-w-[120px]",title:i.org||i.isp,children:i.org||i.isp||"Unknown"})]})]})]}),n.jsxs("div",{className:"space-y-0 relative",children:[n.jsx("div",{className:"absolute left-[11px] top-2 bottom-2 w-px bg-white/5"}),d.map((o,l)=>{var h;return n.jsxs("div",{className:"relative pl-10 pb-8 last:pb-4 group",children:[n.jsx("div",{className:`absolute left-0 top-0.5 w-6 h-6 rounded-full border-2 border-slate-900 z-10 flex items-center justify-center transition-transform group-hover:scale-110
|
|
143
|
+
*/(function(i,d){(function(o,l){i.exports=l()})(window,function(){return function(c){var o={};function l(h){if(o[h])return o[h].exports;var u=o[h]={i:h,l:!1,exports:{}};return c[h].call(u.exports,u,u.exports,l),u.l=!0,u.exports}return l.m=c,l.c=o,l.d=function(h,u,b){l.o(h,u)||Object.defineProperty(h,u,{enumerable:!0,get:b})},l.r=function(h){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(h,"__esModule",{value:!0})},l.t=function(h,u){if(u&1&&(h=l(h)),u&8||u&4&&typeof h=="object"&&h&&h.__esModule)return h;var b=Object.create(null);if(l.r(b),Object.defineProperty(b,"default",{enumerable:!0,value:h}),u&2&&typeof h!="string")for(var w in h)l.d(b,w,(function(D){return h[D]}).bind(null,w));return b},l.n=function(h){var u=h&&h.__esModule?function(){return h.default}:function(){return h};return l.d(u,"a",u),u},l.o=function(h,u){return Object.prototype.hasOwnProperty.call(h,u)},l.p="",l(l.s=2)}([function(c,o,l){var h=this&&this.__extends||function(){var y=function(m,x){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,P){_.__proto__=P}||function(_,P){for(var E in P)P.hasOwnProperty(E)&&(_[E]=P[E])},y(m,x)};return function(m,x){y(m,x);function _(){this.constructor=m}m.prototype=x===null?Object.create(x):(_.prototype=x.prototype,new _)}}();Object.defineProperty(o,"__esModule",{value:!0});var u=256,b=function(){function y(m){m===void 0&&(m="="),this._paddingCharacter=m}return y.prototype.encodedLength=function(m){return this._paddingCharacter?(m+2)/3*4|0:(m*8+5)/6|0},y.prototype.encode=function(m){for(var x="",_=0;_<m.length-2;_+=3){var P=m[_]<<16|m[_+1]<<8|m[_+2];x+=this._encodeByte(P>>>3*6&63),x+=this._encodeByte(P>>>2*6&63),x+=this._encodeByte(P>>>1*6&63),x+=this._encodeByte(P>>>0*6&63)}var E=m.length-_;if(E>0){var P=m[_]<<16|(E===2?m[_+1]<<8:0);x+=this._encodeByte(P>>>3*6&63),x+=this._encodeByte(P>>>2*6&63),E===2?x+=this._encodeByte(P>>>1*6&63):x+=this._paddingCharacter||"",x+=this._paddingCharacter||""}return x},y.prototype.maxDecodedLength=function(m){return this._paddingCharacter?m/4*3|0:(m*6+7)/8|0},y.prototype.decodedLength=function(m){return this.maxDecodedLength(m.length-this._getPaddingLength(m))},y.prototype.decode=function(m){if(m.length===0)return new Uint8Array(0);for(var x=this._getPaddingLength(m),_=m.length-x,P=new Uint8Array(this.maxDecodedLength(_)),E=0,H=0,L=0,j=0,A=0,G=0,X=0;H<_-4;H+=4)j=this._decodeChar(m.charCodeAt(H+0)),A=this._decodeChar(m.charCodeAt(H+1)),G=this._decodeChar(m.charCodeAt(H+2)),X=this._decodeChar(m.charCodeAt(H+3)),P[E++]=j<<2|A>>>4,P[E++]=A<<4|G>>>2,P[E++]=G<<6|X,L|=j&u,L|=A&u,L|=G&u,L|=X&u;if(H<_-1&&(j=this._decodeChar(m.charCodeAt(H)),A=this._decodeChar(m.charCodeAt(H+1)),P[E++]=j<<2|A>>>4,L|=j&u,L|=A&u),H<_-2&&(G=this._decodeChar(m.charCodeAt(H+2)),P[E++]=A<<4|G>>>2,L|=G&u),H<_-3&&(X=this._decodeChar(m.charCodeAt(H+3)),P[E++]=G<<6|X,L|=X&u),L!==0)throw new Error("Base64Coder: incorrect characters for decoding");return P},y.prototype._encodeByte=function(m){var x=m;return x+=65,x+=25-m>>>8&6,x+=51-m>>>8&-75,x+=61-m>>>8&-15,x+=62-m>>>8&3,String.fromCharCode(x)},y.prototype._decodeChar=function(m){var x=u;return x+=(42-m&m-44)>>>8&-u+m-43+62,x+=(46-m&m-48)>>>8&-u+m-47+63,x+=(47-m&m-58)>>>8&-u+m-48+52,x+=(64-m&m-91)>>>8&-u+m-65+0,x+=(96-m&m-123)>>>8&-u+m-97+26,x},y.prototype._getPaddingLength=function(m){var x=0;if(this._paddingCharacter){for(var _=m.length-1;_>=0&&m[_]===this._paddingCharacter;_--)x++;if(m.length<4||x>2)throw new Error("Base64Coder: incorrect padding")}return x},y}();o.Coder=b;var w=new b;function D(y){return w.encode(y)}o.encode=D;function N(y){return w.decode(y)}o.decode=N;var C=function(y){h(m,y);function m(){return y!==null&&y.apply(this,arguments)||this}return m.prototype._encodeByte=function(x){var _=x;return _+=65,_+=25-x>>>8&6,_+=51-x>>>8&-75,_+=61-x>>>8&-13,_+=62-x>>>8&49,String.fromCharCode(_)},m.prototype._decodeChar=function(x){var _=u;return _+=(44-x&x-46)>>>8&-u+x-45+62,_+=(94-x&x-96)>>>8&-u+x-95+63,_+=(47-x&x-58)>>>8&-u+x-48+52,_+=(64-x&x-91)>>>8&-u+x-65+0,_+=(96-x&x-123)>>>8&-u+x-97+26,_},m}(b);o.URLSafeCoder=C;var p=new C;function k(y){return p.encode(y)}o.encodeURLSafe=k;function T(y){return p.decode(y)}o.decodeURLSafe=T,o.encodedLength=function(y){return w.encodedLength(y)},o.maxDecodedLength=function(y){return w.maxDecodedLength(y)},o.decodedLength=function(y){return w.decodedLength(y)}},function(c,o,l){Object.defineProperty(o,"__esModule",{value:!0});var h="utf8: invalid string",u="utf8: invalid source encoding";function b(N){for(var C=new Uint8Array(w(N)),p=0,k=0;k<N.length;k++){var T=N.charCodeAt(k);T<128?C[p++]=T:T<2048?(C[p++]=192|T>>6,C[p++]=128|T&63):T<55296?(C[p++]=224|T>>12,C[p++]=128|T>>6&63,C[p++]=128|T&63):(k++,T=(T&1023)<<10,T|=N.charCodeAt(k)&1023,T+=65536,C[p++]=240|T>>18,C[p++]=128|T>>12&63,C[p++]=128|T>>6&63,C[p++]=128|T&63)}return C}o.encode=b;function w(N){for(var C=0,p=0;p<N.length;p++){var k=N.charCodeAt(p);if(k<128)C+=1;else if(k<2048)C+=2;else if(k<55296)C+=3;else if(k<=57343){if(p>=N.length-1)throw new Error(h);p++,C+=4}else throw new Error(h)}return C}o.encodedLength=w;function D(N){for(var C=[],p=0;p<N.length;p++){var k=N[p];if(k&128){var T=void 0;if(k<224){if(p>=N.length)throw new Error(u);var y=N[++p];if((y&192)!==128)throw new Error(u);k=(k&31)<<6|y&63,T=128}else if(k<240){if(p>=N.length-1)throw new Error(u);var y=N[++p],m=N[++p];if((y&192)!==128||(m&192)!==128)throw new Error(u);k=(k&15)<<12|(y&63)<<6|m&63,T=2048}else if(k<248){if(p>=N.length-2)throw new Error(u);var y=N[++p],m=N[++p],x=N[++p];if((y&192)!==128||(m&192)!==128||(x&192)!==128)throw new Error(u);k=(k&15)<<18|(y&63)<<12|(m&63)<<6|x&63,T=65536}else throw new Error(u);if(k<T||k>=55296&&k<=57343)throw new Error(u);if(k>=65536){if(k>1114111)throw new Error(u);k-=65536,C.push(String.fromCharCode(55296|k>>10)),k=56320|k&1023}}C.push(String.fromCharCode(k))}return C.join("")}o.decode=D},function(c,o,l){c.exports=l(3).default},function(c,o,l){l.r(o);class h{constructor(e,t){this.lastId=0,this.prefix=e,this.name=t}create(e){this.lastId++;var t=this.lastId,s=this.prefix+t,a=this.name+"["+t+"]",f=!1,v=function(){f||(e.apply(null,arguments),f=!0)};return this[t]=v,{number:t,id:s,name:a,callback:v}}remove(e){delete this[e.number]}}var u=new h("_pusher_script_","Pusher.ScriptReceivers"),b={VERSION:"8.4.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},w=b;class D{constructor(e){this.options=e,this.receivers=e.receivers||u,this.loading={}}load(e,t,s){var a=this;if(a.loading[e]&&a.loading[e].length>0)a.loading[e].push(s);else{a.loading[e]=[s];var f=M.createScriptRequest(a.getPath(e,t)),v=a.receivers.create(function(S){if(a.receivers.remove(v),a.loading[e]){var I=a.loading[e];delete a.loading[e];for(var B=function(Q){Q||f.cleanup()},F=0;F<I.length;F++)I[F](S,B)}});f.send(v)}}getRoot(e){var t,s=M.getDocument().location.protocol;return e&&e.useTLS||s==="https:"?t=this.options.cdn_https:t=this.options.cdn_http,t.replace(/\/*$/,"")+"/"+this.options.version}getPath(e,t){return this.getRoot(t)+"/"+e+this.options.suffix+".js"}}var N=new h("_pusher_dependencies","Pusher.DependenciesReceivers"),C=new D({cdn_http:w.cdn_http,cdn_https:w.cdn_https,version:w.VERSION,suffix:w.dependency_suffix,receivers:N});const p={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}};var T={buildLogSuffix:function(r){const e="See:",t=p.urls[r];if(!t)return"";let s;return t.fullUrl?s=t.fullUrl:t.path&&(s=p.baseUrl+t.path),s?`${e} ${s}`:""}},y;(function(r){r.UserAuthentication="user-authentication",r.ChannelAuthorization="channel-authorization"})(y||(y={}));class m extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class x extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class _ extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class P extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class E extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class H extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class L extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class j extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class A extends Error{constructor(e,t){super(t),this.status=e,Object.setPrototypeOf(this,new.target.prototype)}}var X=function(r,e,t,s,a){const f=M.createXHR();f.open("POST",t.endpoint,!0),f.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var v in t.headers)f.setRequestHeader(v,t.headers[v]);if(t.headersProvider!=null){let S=t.headersProvider();for(var v in S)f.setRequestHeader(v,S[v])}return f.onreadystatechange=function(){if(f.readyState===4)if(f.status===200){let S,I=!1;try{S=JSON.parse(f.responseText),I=!0}catch{a(new A(200,`JSON returned from ${s.toString()} endpoint was invalid, yet status code was 200. Data was: ${f.responseText}`),null)}I&&a(null,S)}else{let S="";switch(s){case y.UserAuthentication:S=T.buildLogSuffix("authenticationEndpoint");break;case y.ChannelAuthorization:S=`Clients must be authorized to join private or presence channels. ${T.buildLogSuffix("authorizationEndpoint")}`;break}a(new A(f.status,`Unable to retrieve auth string from ${s.toString()} endpoint - received status: ${f.status} from ${t.endpoint}. ${S}`),null)}},f.send(e),f};function te(r){return xe(me(r))}var U=String.fromCharCode,se="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fe=function(r){var e=r.charCodeAt(0);return e<128?r:e<2048?U(192|e>>>6)+U(128|e&63):U(224|e>>>12&15)+U(128|e>>>6&63)+U(128|e&63)},me=function(r){return r.replace(/[^\x00-\x7F]/g,fe)},le=function(r){var e=[0,2,1][r.length%3],t=r.charCodeAt(0)<<16|(r.length>1?r.charCodeAt(1):0)<<8|(r.length>2?r.charCodeAt(2):0),s=[se.charAt(t>>>18),se.charAt(t>>>12&63),e>=2?"=":se.charAt(t>>>6&63),e>=1?"=":se.charAt(t&63)];return s.join("")},xe=window.btoa||function(r){return r.replace(/[\s\S]{1,3}/g,le)};class ge{constructor(e,t,s,a){this.clear=t,this.timer=e(()=>{this.timer&&(this.timer=a(this.timer))},s)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var ae=ge;function be(r){window.clearTimeout(r)}function g(r){window.clearInterval(r)}class R extends ae{constructor(e,t){super(setTimeout,be,e,function(s){return t(),null})}}class q extends ae{constructor(e,t){super(setInterval,g,e,function(s){return t(),s})}}var K={now(){return Date.now?Date.now():new Date().valueOf()},defer(r){return new R(0,r)},method(r,...e){var t=Array.prototype.slice.call(arguments,1);return function(s){return s[r].apply(s,t.concat(arguments))}}},$=K;function ee(r,...e){for(var t=0;t<e.length;t++){var s=e[t];for(var a in s)s[a]&&s[a].constructor&&s[a].constructor===Object?r[a]=ee(r[a]||{},s[a]):r[a]=s[a]}return r}function Z(){for(var r=["Pusher"],e=0;e<arguments.length;e++)typeof arguments[e]=="string"?r.push(arguments[e]):r.push(De(arguments[e]));return r.join(" : ")}function ce(r,e){var t=Array.prototype.indexOf;if(r===null)return-1;if(t&&r.indexOf===t)return r.indexOf(e);for(var s=0,a=r.length;s<a;s++)if(r[s]===e)return s;return-1}function ie(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&e(r[t],t,r)}function ze(r){var e=[];return ie(r,function(t,s){e.push(s)}),e}function dn(r){var e=[];return ie(r,function(t){e.push(t)}),e}function Ee(r,e,t){for(var s=0;s<r.length;s++)e.call(t||window,r[s],s,r)}function Ut(r,e){for(var t=[],s=0;s<r.length;s++)t.push(e(r[s],s,r,t));return t}function hn(r,e){var t={};return ie(r,function(s,a){t[a]=e(s)}),t}function Ht(r,e){e=e||function(a){return!!a};for(var t=[],s=0;s<r.length;s++)e(r[s],s,r,t)&&t.push(r[s]);return t}function Bt(r,e){var t={};return ie(r,function(s,a){(e&&e(s,a,r,t)||s)&&(t[a]=s)}),t}function un(r){var e=[];return ie(r,function(t,s){e.push([s,t])}),e}function Ft(r,e){for(var t=0;t<r.length;t++)if(e(r[t],t,r))return!0;return!1}function pn(r,e){for(var t=0;t<r.length;t++)if(!e(r[t],t,r))return!1;return!0}function fn(r){return hn(r,function(e){return typeof e=="object"&&(e=De(e)),encodeURIComponent(te(e.toString()))})}function mn(r){var e=Bt(r,function(s){return s!==void 0}),t=Ut(un(fn(e)),$.method("join","=")).join("&");return t}function gn(r){var e=[],t=[];return function s(a,f){var v,S,I;switch(typeof a){case"object":if(!a)return null;for(v=0;v<e.length;v+=1)if(e[v]===a)return{$ref:t[v]};if(e.push(a),t.push(f),Object.prototype.toString.apply(a)==="[object Array]")for(I=[],v=0;v<a.length;v+=1)I[v]=s(a[v],f+"["+v+"]");else{I={};for(S in a)Object.prototype.hasOwnProperty.call(a,S)&&(I[S]=s(a[S],f+"["+JSON.stringify(S)+"]"))}return I;case"number":case"string":case"boolean":return a}}(r,"$")}function De(r){try{return JSON.stringify(r)}catch{return JSON.stringify(gn(r))}}class xn{constructor(){this.globalLog=e=>{window.console&&window.console.log&&window.console.log(e)}}debug(...e){this.log(this.globalLog,e)}warn(...e){this.log(this.globalLogWarn,e)}error(...e){this.log(this.globalLogError,e)}globalLogWarn(e){window.console&&window.console.warn?window.console.warn(e):this.globalLog(e)}globalLogError(e){window.console&&window.console.error?window.console.error(e):this.globalLogWarn(e)}log(e,...t){var s=Z.apply(this,arguments);ot.log?ot.log(s):ot.logToConsole&&e.bind(this)(s)}}var J=new xn,bn=function(r,e,t,s,a){(t.headers!==void 0||t.headersProvider!=null)&&J.warn(`To send headers with the ${s.toString()} request, you must use AJAX, rather than JSONP.`);var f=r.nextAuthCallbackID.toString();r.nextAuthCallbackID++;var v=r.getDocument(),S=v.createElement("script");r.auth_callbacks[f]=function(F){a(null,F)};var I="Pusher.auth_callbacks['"+f+"']";S.src=t.endpoint+"?callback="+encodeURIComponent(I)+"&"+e;var B=v.getElementsByTagName("head")[0]||v.documentElement;B.insertBefore(S,B.firstChild)},vn=bn;class wn{constructor(e){this.src=e}send(e){var t=this,s="Error loading "+t.src;t.script=document.createElement("script"),t.script.id=e.id,t.script.src=t.src,t.script.type="text/javascript",t.script.charset="UTF-8",t.script.addEventListener?(t.script.onerror=function(){e.callback(s)},t.script.onload=function(){e.callback(null)}):t.script.onreadystatechange=function(){(t.script.readyState==="loaded"||t.script.readyState==="complete")&&e.callback(null)},t.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(t.errorScript=document.createElement("script"),t.errorScript.id=e.id+"_error",t.errorScript.text=e.name+"('"+s+"');",t.script.async=t.errorScript.async=!1):t.script.async=!0;var a=document.getElementsByTagName("head")[0];a.insertBefore(t.script,a.firstChild),t.errorScript&&a.insertBefore(t.errorScript,t.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class yn{constructor(e,t){this.url=e,this.data=t}send(e){if(!this.request){var t=mn(this.data),s=this.url+"/"+e.number+"?"+t;this.request=M.createScriptRequest(s),this.request.send(e)}}cleanup(){this.request&&this.request.cleanup()}}var jn=function(r,e){return function(t,s){var a="http"+(e?"s":"")+"://",f=a+(r.host||r.options.host)+r.options.path,v=M.createJSONPRequest(f,t),S=M.ScriptReceivers.create(function(I,B){u.remove(S),v.cleanup(),B&&B.host&&(r.host=B.host),s&&s(I,B)});v.send(S)}},_n={name:"jsonp",getAgent:jn},Nn=_n;function $e(r,e,t){var s=r+(e.useTLS?"s":""),a=e.useTLS?e.hostTLS:e.hostNonTLS;return s+"://"+a+t}function Ze(r,e){var t="/app/"+r,s="?protocol="+w.PROTOCOL+"&client=js&version="+w.VERSION+(e?"&"+e:"");return t+s}var kn={getInitial:function(r,e){var t=(e.httpPath||"")+Ze(r,"flash=false");return $e("ws",e,t)}},Sn={getInitial:function(r,e){var t=(e.httpPath||"/pusher")+Ze(r);return $e("http",e,t)}},Cn={getInitial:function(r,e){return $e("http",e,e.httpPath||"/pusher")},getPath:function(r,e){return Ze(r)}};class Tn{constructor(){this._callbacks={}}get(e){return this._callbacks[Qe(e)]}add(e,t,s){var a=Qe(e);this._callbacks[a]=this._callbacks[a]||[],this._callbacks[a].push({fn:t,context:s})}remove(e,t,s){if(!e&&!t&&!s){this._callbacks={};return}var a=e?[Qe(e)]:ze(this._callbacks);t||s?this.removeCallback(a,t,s):this.removeAllCallbacks(a)}removeCallback(e,t,s){Ee(e,function(a){this._callbacks[a]=Ht(this._callbacks[a]||[],function(f){return t&&t!==f.fn||s&&s!==f.context}),this._callbacks[a].length===0&&delete this._callbacks[a]},this)}removeAllCallbacks(e){Ee(e,function(t){delete this._callbacks[t]},this)}}function Qe(r){return"_"+r}class de{constructor(e){this.callbacks=new Tn,this.global_callbacks=[],this.failThrough=e}bind(e,t,s){return this.callbacks.add(e,t,s),this}bind_global(e){return this.global_callbacks.push(e),this}unbind(e,t,s){return this.callbacks.remove(e,t,s),this}unbind_global(e){return e?(this.global_callbacks=Ht(this.global_callbacks||[],t=>t!==e),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(e,t,s){for(var a=0;a<this.global_callbacks.length;a++)this.global_callbacks[a](e,t);var f=this.callbacks.get(e),v=[];if(s?v.push(t,s):t&&v.push(t),f&&f.length>0)for(var a=0;a<f.length;a++)f[a].fn.apply(f[a].context||window,v);else this.failThrough&&this.failThrough(e,t);return this}}class Pn extends de{constructor(e,t,s,a,f){super(),this.initialize=M.transportConnectionInitializer,this.hooks=e,this.name=t,this.priority=s,this.key=a,this.options=f,this.state="new",this.timeline=f.timeline,this.activityTimeout=f.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var e=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(e,this.options)}catch(t){return $.defer(()=>{this.onError(t),this.changeState("closed")}),!1}return this.bindListeners(),J.debug("Connecting",{transport:this.name,url:e}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(e){return this.state==="open"?($.defer(()=>{this.socket&&this.socket.send(e)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(e){this.emit("error",{type:"WebSocketError",error:e}),this.timeline.error(this.buildTimelineMessage({error:e.toString()}))}onClose(e){e?this.changeState("closed",{code:e.code,reason:e.reason,wasClean:e.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(e){this.emit("message",e)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=e=>{this.onError(e)},this.socket.onclose=e=>{this.onClose(e)},this.socket.onmessage=e=>{this.onMessage(e)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(e,t){this.state=e,this.timeline.info(this.buildTimelineMessage({state:e,params:t})),this.emit(e,t)}buildTimelineMessage(e){return ee({cid:this.id},e)}}class ke{constructor(e){this.hooks=e}isSupported(e){return this.hooks.isSupported(e)}createConnection(e,t,s,a){return new Pn(this.hooks,e,t,s,a)}}var An=new ke({urls:kn,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!M.getWebSocketAPI()},isSupported:function(){return!!M.getWebSocketAPI()},getSocket:function(r){return M.createWebSocket(r)}}),Gt={urls:Sn,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},Vt=ee({getSocket:function(r){return M.HTTPFactory.createStreamingSocket(r)}},Gt),qt=ee({getSocket:function(r){return M.HTTPFactory.createPollingSocket(r)}},Gt),Wt={isSupported:function(){return M.isXHRSupported()}},En=new ke(ee({},Vt,Wt)),Rn=new ke(ee({},qt,Wt)),Ln={ws:An,xhr_streaming:En,xhr_polling:Rn},Ue=Ln,In=new ke({file:"sockjs",urls:Cn,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(r,e){return new window.SockJS(r,null,{js_path:C.getPath("sockjs",{useTLS:e.useTLS}),ignore_null_origin:e.ignoreNullOrigin})},beforeOpen:function(r,e){r.send(JSON.stringify({path:e}))}}),Jt={isSupported:function(r){var e=M.isXDRSupported(r.useTLS);return e}},On=new ke(ee({},Vt,Jt)),Mn=new ke(ee({},qt,Jt));Ue.xdr_streaming=On,Ue.xdr_polling=Mn,Ue.sockjs=In;var zn=Ue;class Dn extends de{constructor(){super();var e=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){e.emit("online")},!1),window.addEventListener("offline",function(){e.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var Un=new Dn;class Hn{constructor(e,t,s){this.manager=e,this.transport=t,this.minPingDelay=s.minPingDelay,this.maxPingDelay=s.maxPingDelay,this.pingDelay=void 0}createConnection(e,t,s,a){a=ee({},a,{activityTimeout:this.pingDelay});var f=this.transport.createConnection(e,t,s,a),v=null,S=function(){f.unbind("open",S),f.bind("closed",I),v=$.now()},I=B=>{if(f.unbind("closed",I),B.code===1002||B.code===1003)this.manager.reportDeath();else if(!B.wasClean&&v){var F=$.now()-v;F<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(F/2,this.minPingDelay))}};return f.bind("open",S),f}isSupported(e){return this.manager.isAlive()&&this.transport.isSupported(e)}}const Xt={decodeMessage:function(r){try{var e=JSON.parse(r.data),t=e.data;if(typeof t=="string")try{t=JSON.parse(e.data)}catch{}var s={event:e.event,channel:e.channel,data:t};return e.user_id&&(s.user_id=e.user_id),s}catch(a){throw{type:"MessageParseError",error:a,data:r.data}}},encodeMessage:function(r){return JSON.stringify(r)},processHandshake:function(r){var e=Xt.decodeMessage(r);if(e.event==="pusher:connection_established"){if(!e.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:e.data.socket_id,activityTimeout:e.data.activity_timeout*1e3}}else{if(e.event==="pusher:error")return{action:this.getCloseAction(e.data),error:this.getCloseError(e.data)};throw"Invalid handshake"}},getCloseAction:function(r){return r.code<4e3?r.code>=1002&&r.code<=1004?"backoff":null:r.code===4e3?"tls_only":r.code<4100?"refused":r.code<4200?"backoff":r.code<4300?"retry":"refused"},getCloseError:function(r){return r.code!==1e3&&r.code!==1001?{type:"PusherError",data:{code:r.code,message:r.reason||r.message}}:null}};var ve=Xt;class Bn extends de{constructor(e,t){super(),this.id=e,this.transport=t,this.activityTimeout=t.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(e){return this.transport.send(e)}send_event(e,t,s){var a={event:e,data:t};return s&&(a.channel=s),J.debug("Event sent",a),this.send(ve.encodeMessage(a))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var e={message:s=>{var a;try{a=ve.decodeMessage(s)}catch(f){this.emit("error",{type:"MessageParseError",error:f,data:s.data})}if(a!==void 0){switch(J.debug("Event recd",a),a.event){case"pusher:error":this.emit("error",{type:"PusherError",data:a.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",a)}},activity:()=>{this.emit("activity")},error:s=>{this.emit("error",s)},closed:s=>{t(),s&&s.code&&this.handleCloseEvent(s),this.transport=null,this.emit("closed")}},t=()=>{ie(e,(s,a)=>{this.transport.unbind(a,s)})};ie(e,(s,a)=>{this.transport.bind(a,s)})}handleCloseEvent(e){var t=ve.getCloseAction(e),s=ve.getCloseError(e);s&&this.emit("error",s),t&&this.emit(t,{action:t,error:s})}}class Fn{constructor(e,t){this.transport=e,this.callback=t,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=e=>{this.unbindListeners();var t;try{t=ve.processHandshake(e)}catch(s){this.finish("error",{error:s}),this.transport.close();return}t.action==="connected"?this.finish("connected",{connection:new Bn(t.id,this.transport),activityTimeout:t.activityTimeout}):(this.finish(t.action,{error:t.error}),this.transport.close())},this.onClosed=e=>{this.unbindListeners();var t=ve.getCloseAction(e)||"backoff",s=ve.getCloseError(e);this.finish(t,{error:s})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(e,t){this.callback(ee({transport:this.transport,action:e},t))}}class Gn{constructor(e,t){this.timeline=e,this.options=t||{}}send(e,t){this.timeline.isEmpty()||this.timeline.send(M.TimelineTransport.getAgent(this,e),t)}}class et extends de{constructor(e,t){super(function(s,a){J.debug("No callbacks on "+e+" for "+s)}),this.name=e,this.pusher=t,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(e,t){return t(null,{auth:""})}trigger(e,t){if(e.indexOf("client-")!==0)throw new m("Event '"+e+"' does not start with 'client-'");if(!this.subscribed){var s=T.buildLogSuffix("triggeringClientEvents");J.warn(`Client event triggered before channel 'subscription_succeeded' event . ${s}`)}return this.pusher.send_event(e,t,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(e){var t=e.event,s=e.data;if(t==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(e);else if(t==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(e);else if(t.indexOf("pusher_internal:")!==0){var a={};this.emit(t,s,a)}}handleSubscriptionSucceededEvent(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",e.data)}handleSubscriptionCountEvent(e){e.data.subscription_count&&(this.subscriptionCount=e.data.subscription_count),this.emit("pusher:subscription_count",e.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(e,t)=>{e?(this.subscriptionPending=!1,J.error(e.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:e.message},e instanceof A?{status:e.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:t.auth,channel_data:t.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class tt extends et{authorize(e,t){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:e},t)}}class Vn{constructor(){this.reset()}get(e){return Object.prototype.hasOwnProperty.call(this.members,e)?{id:e,info:this.members[e]}:null}each(e){ie(this.members,(t,s)=>{e(this.get(s))})}setMyID(e){this.myID=e}onSubscription(e){this.members=e.presence.hash,this.count=e.presence.count,this.me=this.get(this.myID)}addMember(e){return this.get(e.user_id)===null&&this.count++,this.members[e.user_id]=e.user_info,this.get(e.user_id)}removeMember(e){var t=this.get(e.user_id);return t&&(delete this.members[e.user_id],this.count--),t}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var qn=function(r,e,t,s){function a(f){return f instanceof t?f:new t(function(v){v(f)})}return new(t||(t=Promise))(function(f,v){function S(F){try{B(s.next(F))}catch(Q){v(Q)}}function I(F){try{B(s.throw(F))}catch(Q){v(Q)}}function B(F){F.done?f(F.value):a(F.value).then(S,I)}B((s=s.apply(r,e||[])).next())})};class Wn extends tt{constructor(e,t){super(e,t),this.members=new Vn}authorize(e,t){super.authorize(e,(s,a)=>qn(this,void 0,void 0,function*(){if(!s)if(a=a,a.channel_data!=null){var f=JSON.parse(a.channel_data);this.members.setMyID(f.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let v=T.buildLogSuffix("authorizationEndpoint");J.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${v}, or the user should be signed in.`),t("Invalid auth response");return}t(s,a)}))}handleEvent(e){var t=e.event;if(t.indexOf("pusher_internal:")===0)this.handleInternalEvent(e);else{var s=e.data,a={};e.user_id&&(a.user_id=e.user_id),this.emit(t,s,a)}}handleInternalEvent(e){var t=e.event,s=e.data;switch(t){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(e);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(e);break;case"pusher_internal:member_added":var a=this.members.addMember(s);this.emit("pusher:member_added",a);break;case"pusher_internal:member_removed":var f=this.members.removeMember(s);f&&this.emit("pusher:member_removed",f);break}}handleSubscriptionSucceededEvent(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(e.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var Jn=l(1),rt=l(0);class Xn extends tt{constructor(e,t,s){super(e,t),this.key=null,this.nacl=s}authorize(e,t){super.authorize(e,(s,a)=>{if(s){t(s,a);return}let f=a.shared_secret;if(!f){t(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(rt.decode)(f),delete a.shared_secret,t(null,a)})}trigger(e,t){throw new H("Client events are not currently supported for encrypted channels")}handleEvent(e){var t=e.event,s=e.data;if(t.indexOf("pusher_internal:")===0||t.indexOf("pusher:")===0){super.handleEvent(e);return}this.handleEncryptedEvent(t,s)}handleEncryptedEvent(e,t){if(!this.key){J.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!t.ciphertext||!t.nonce){J.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+t);return}let s=Object(rt.decode)(t.ciphertext);if(s.length<this.nacl.secretbox.overheadLength){J.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${s.length}`);return}let a=Object(rt.decode)(t.nonce);if(a.length<this.nacl.secretbox.nonceLength){J.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${a.length}`);return}let f=this.nacl.secretbox.open(s,a,this.key);if(f===null){J.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(v,S)=>{if(v){J.error(`Failed to make a request to the authEndpoint: ${S}. Unable to fetch new key, so dropping encrypted event`);return}if(f=this.nacl.secretbox.open(s,a,this.key),f===null){J.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(e,this.getDataToEmit(f))});return}this.emit(e,this.getDataToEmit(f))}getDataToEmit(e){let t=Object(Jn.decode)(e);try{return JSON.parse(t)}catch{return t}}}class Yn extends de{constructor(e,t){super(),this.state="initialized",this.connection=null,this.key=e,this.options=t,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var s=M.getNetwork();s.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),s.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(e){return this.connection?this.connection.send(e):!1}send_event(e,t,s){return this.connection?this.connection.send_event(e,t,s):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var e=(t,s)=>{t?this.runner=this.strategy.connect(0,e):s.action==="error"?(this.emit("error",{type:"HandshakeError",error:s.error}),this.timeline.error({handshakeError:s.error})):(this.abortConnecting(),this.handshakeCallbacks[s.action](s))};this.runner=this.strategy.connect(0,e)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var e=this.abandonConnection();e.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(e){this.timeline.info({action:"retry",delay:e}),e>0&&this.emit("connecting_in",Math.round(e/1e3)),this.retryTimer=new R(e||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new R(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new R(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new R(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(e){return ee({},e,{message:t=>{this.resetActivityCheck(),this.emit("message",t)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:t=>{this.emit("error",t)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(e){return ee({},e,{connected:t=>{this.activityTimeout=Math.min(this.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(t.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let e=t=>s=>{s.error&&this.emit("error",{type:"WebSocketError",error:s.error}),t(s)};return{tls_only:e(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:e(()=>{this.disconnect()}),backoff:e(()=>{this.retryIn(1e3)}),retry:e(()=>{this.retryIn(0)})}}setConnection(e){this.connection=e;for(var t in this.connectionCallbacks)this.connection.bind(t,this.connectionCallbacks[t]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var e in this.connectionCallbacks)this.connection.unbind(e,this.connectionCallbacks[e]);var t=this.connection;return this.connection=null,t}}updateState(e,t){var s=this.state;if(this.state=e,s!==e){var a=e;a==="connected"&&(a+=" with new socket ID "+t.socket_id),J.debug("State changed",s+" -> "+a),this.timeline.info({state:e,params:t}),this.emit("state_change",{previous:s,current:e}),this.emit(e,t)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class Kn{constructor(){this.channels={}}add(e,t){return this.channels[e]||(this.channels[e]=$n(e,t)),this.channels[e]}all(){return dn(this.channels)}find(e){return this.channels[e]}remove(e){var t=this.channels[e];return delete this.channels[e],t}disconnect(){ie(this.channels,function(e){e.disconnect()})}}function $n(r,e){if(r.indexOf("private-encrypted-")===0){if(e.config.nacl)return he.createEncryptedChannel(r,e,e.config.nacl);let t="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",s=T.buildLogSuffix("encryptedChannelSupport");throw new H(`${t}. ${s}`)}else{if(r.indexOf("private-")===0)return he.createPrivateChannel(r,e);if(r.indexOf("presence-")===0)return he.createPresenceChannel(r,e);if(r.indexOf("#")===0)throw new x('Cannot create a channel with name "'+r+'".');return he.createChannel(r,e)}}var Zn={createChannels(){return new Kn},createConnectionManager(r,e){return new Yn(r,e)},createChannel(r,e){return new et(r,e)},createPrivateChannel(r,e){return new tt(r,e)},createPresenceChannel(r,e){return new Wn(r,e)},createEncryptedChannel(r,e,t){return new Xn(r,e,t)},createTimelineSender(r,e){return new Gn(r,e)},createHandshake(r,e){return new Fn(r,e)},createAssistantToTheTransportManager(r,e,t){return new Hn(r,e,t)}},he=Zn;class Yt{constructor(e){this.options=e||{},this.livesLeft=this.options.lives||1/0}getAssistant(e){return he.createAssistantToTheTransportManager(this,e,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class we{constructor(e,t){this.strategies=e,this.loop=!!t.loop,this.failFast=!!t.failFast,this.timeout=t.timeout,this.timeoutLimit=t.timeoutLimit}isSupported(){return Ft(this.strategies,$.method("isSupported"))}connect(e,t){var s=this.strategies,a=0,f=this.timeout,v=null,S=(I,B)=>{B?t(null,B):(a=a+1,this.loop&&(a=a%s.length),a<s.length?(f&&(f=f*2,this.timeoutLimit&&(f=Math.min(f,this.timeoutLimit))),v=this.tryStrategy(s[a],e,{timeout:f,failFast:this.failFast},S)):t(!0))};return v=this.tryStrategy(s[a],e,{timeout:f,failFast:this.failFast},S),{abort:function(){v.abort()},forceMinPriority:function(I){e=I,v&&v.forceMinPriority(I)}}}tryStrategy(e,t,s,a){var f=null,v=null;return s.timeout>0&&(f=new R(s.timeout,function(){v.abort(),a(!0)})),v=e.connect(t,function(S,I){S&&f&&f.isRunning()&&!s.failFast||(f&&f.ensureAborted(),a(S,I))}),{abort:function(){f&&f.ensureAborted(),v.abort()},forceMinPriority:function(S){v.forceMinPriority(S)}}}}class nt{constructor(e){this.strategies=e}isSupported(){return Ft(this.strategies,$.method("isSupported"))}connect(e,t){return Qn(this.strategies,e,function(s,a){return function(f,v){if(a[s].error=f,f){es(a)&&t(!0);return}Ee(a,function(S){S.forceMinPriority(v.transport.priority)}),t(null,v)}})}}function Qn(r,e,t){var s=Ut(r,function(a,f,v,S){return a.connect(e,t(f,S))});return{abort:function(){Ee(s,ts)},forceMinPriority:function(a){Ee(s,function(f){f.forceMinPriority(a)})}}}function es(r){return pn(r,function(e){return!!e.error})}function ts(r){!r.error&&!r.aborted&&(r.abort(),r.aborted=!0)}class rs{constructor(e,t,s){this.strategy=e,this.transports=t,this.ttl=s.ttl||1800*1e3,this.usingTLS=s.useTLS,this.timeline=s.timeline}isSupported(){return this.strategy.isSupported()}connect(e,t){var s=this.usingTLS,a=ns(s),f=a&&a.cacheSkipCount?a.cacheSkipCount:0,v=[this.strategy];if(a&&a.timestamp+this.ttl>=$.now()){var S=this.transports[a.transport];S&&(["ws","wss"].includes(a.transport)||f>3?(this.timeline.info({cached:!0,transport:a.transport,latency:a.latency}),v.push(new we([S],{timeout:a.latency*2+1e3,failFast:!0}))):f++)}var I=$.now(),B=v.pop().connect(e,function F(Q,Fe){Q?(Kt(s),v.length>0?(I=$.now(),B=v.pop().connect(e,F)):t(Q)):(ss(s,Fe.transport.name,$.now()-I,f),t(null,Fe))});return{abort:function(){B.abort()},forceMinPriority:function(F){e=F,B&&B.forceMinPriority(F)}}}}function st(r){return"pusherTransport"+(r?"TLS":"NonTLS")}function ns(r){var e=M.getLocalStorage();if(e)try{var t=e[st(r)];if(t)return JSON.parse(t)}catch{Kt(r)}return null}function ss(r,e,t,s){var a=M.getLocalStorage();if(a)try{a[st(r)]=De({timestamp:$.now(),transport:e,latency:t,cacheSkipCount:s})}catch{}}function Kt(r){var e=M.getLocalStorage();if(e)try{delete e[st(r)]}catch{}}class He{constructor(e,{delay:t}){this.strategy=e,this.options={delay:t}}isSupported(){return this.strategy.isSupported()}connect(e,t){var s=this.strategy,a,f=new R(this.options.delay,function(){a=s.connect(e,t)});return{abort:function(){f.ensureAborted(),a&&a.abort()},forceMinPriority:function(v){e=v,a&&a.forceMinPriority(v)}}}}class Re{constructor(e,t,s){this.test=e,this.trueBranch=t,this.falseBranch=s}isSupported(){var e=this.test()?this.trueBranch:this.falseBranch;return e.isSupported()}connect(e,t){var s=this.test()?this.trueBranch:this.falseBranch;return s.connect(e,t)}}class is{constructor(e){this.strategy=e}isSupported(){return this.strategy.isSupported()}connect(e,t){var s=this.strategy.connect(e,function(a,f){f&&s.abort(),t(a,f)});return s}}function Le(r){return function(){return r.isSupported()}}var as=function(r,e,t){var s={};function a(or,ii,ai,oi,li){var lr=t(r,or,ii,ai,oi,li);return s[or]=lr,lr}var f=Object.assign({},e,{hostNonTLS:r.wsHost+":"+r.wsPort,hostTLS:r.wsHost+":"+r.wssPort,httpPath:r.wsPath}),v=Object.assign({},f,{useTLS:!0}),S=Object.assign({},e,{hostNonTLS:r.httpHost+":"+r.httpPort,hostTLS:r.httpHost+":"+r.httpsPort,httpPath:r.httpPath}),I={loop:!0,timeout:15e3,timeoutLimit:6e4},B=new Yt({minPingDelay:1e4,maxPingDelay:r.activityTimeout}),F=new Yt({lives:2,minPingDelay:1e4,maxPingDelay:r.activityTimeout}),Q=a("ws","ws",3,f,B),Fe=a("wss","ws",3,v,B),ei=a("sockjs","sockjs",1,S),tr=a("xhr_streaming","xhr_streaming",1,S,F),ti=a("xdr_streaming","xdr_streaming",1,S,F),rr=a("xhr_polling","xhr_polling",1,S),ri=a("xdr_polling","xdr_polling",1,S),nr=new we([Q],I),ni=new we([Fe],I),si=new we([ei],I),sr=new we([new Re(Le(tr),tr,ti)],I),ir=new we([new Re(Le(rr),rr,ri)],I),ar=new we([new Re(Le(sr),new nt([sr,new He(ir,{delay:4e3})]),ir)],I),lt=new Re(Le(ar),ar,si),ct;return e.useTLS?ct=new nt([nr,new He(lt,{delay:2e3})]):ct=new nt([nr,new He(ni,{delay:2e3}),new He(lt,{delay:5e3})]),new rs(new is(new Re(Le(Q),ct,lt)),s,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})},os=as,ls=function(){var r=this;r.timeline.info(r.buildTimelineMessage({transport:r.name+(r.options.useTLS?"s":"")})),r.hooks.isInitialized()?r.changeState("initialized"):r.hooks.file?(r.changeState("initializing"),C.load(r.hooks.file,{useTLS:r.options.useTLS},function(e,t){r.hooks.isInitialized()?(r.changeState("initialized"),t(!0)):(e&&r.onError(e),r.onClose(),t(!1))})):r.onClose()},cs={getRequest:function(r){var e=new window.XDomainRequest;return e.ontimeout=function(){r.emit("error",new _),r.close()},e.onerror=function(t){r.emit("error",t),r.close()},e.onprogress=function(){e.responseText&&e.responseText.length>0&&r.onChunk(200,e.responseText)},e.onload=function(){e.responseText&&e.responseText.length>0&&r.onChunk(200,e.responseText),r.emit("finished",200),r.close()},e},abortRequest:function(r){r.ontimeout=r.onerror=r.onprogress=r.onload=null,r.abort()}},ds=cs;const hs=256*1024;class us extends de{constructor(e,t,s){super(),this.hooks=e,this.method=t,this.url=s}start(e){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},M.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(e)}close(){this.unloader&&(M.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(e,t){for(;;){var s=this.advanceBuffer(t);if(s)this.emit("chunk",{status:e,data:s});else break}this.isBufferTooLong(t)&&this.emit("buffer_too_long")}advanceBuffer(e){var t=e.slice(this.position),s=t.indexOf(`
|
|
144
|
+
`);return s!==-1?(this.position+=s+1,t.slice(0,s)):null}isBufferTooLong(e){return this.position===e.length&&e.length>hs}}var it;(function(r){r[r.CONNECTING=0]="CONNECTING",r[r.OPEN=1]="OPEN",r[r.CLOSED=3]="CLOSED"})(it||(it={}));var ye=it,ps=1;class fs{constructor(e,t){this.hooks=e,this.session=Zt(1e3)+"/"+bs(8),this.location=ms(t),this.readyState=ye.CONNECTING,this.openStream()}send(e){return this.sendRaw(JSON.stringify([e]))}ping(){this.hooks.sendHeartbeat(this)}close(e,t){this.onClose(e,t,!0)}sendRaw(e){if(this.readyState===ye.OPEN)try{return M.createSocketRequest("POST",$t(gs(this.location,this.session))).start(e),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(e,t,s){this.closeStream(),this.readyState=ye.CLOSED,this.onclose&&this.onclose({code:e,reason:t,wasClean:s})}onChunk(e){if(e.status===200){this.readyState===ye.OPEN&&this.onActivity();var t,s=e.data.slice(0,1);switch(s){case"o":t=JSON.parse(e.data.slice(1)||"{}"),this.onOpen(t);break;case"a":t=JSON.parse(e.data.slice(1)||"[]");for(var a=0;a<t.length;a++)this.onEvent(t[a]);break;case"m":t=JSON.parse(e.data.slice(1)||"null"),this.onEvent(t);break;case"h":this.hooks.onHeartbeat(this);break;case"c":t=JSON.parse(e.data.slice(1)||"[]"),this.onClose(t[0],t[1],!0);break}}}onOpen(e){this.readyState===ye.CONNECTING?(e&&e.hostname&&(this.location.base=xs(this.location.base,e.hostname)),this.readyState=ye.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(e){this.readyState===ye.OPEN&&this.onmessage&&this.onmessage({data:e})}onActivity(){this.onactivity&&this.onactivity()}onError(e){this.onerror&&this.onerror(e)}openStream(){this.stream=M.createSocketRequest("POST",$t(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",e=>{this.onChunk(e)}),this.stream.bind("finished",e=>{this.hooks.onFinished(this,e)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(e){$.defer(()=>{this.onError(e),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function ms(r){var e=/([^\?]*)\/*(\??.*)/.exec(r);return{base:e[1],queryString:e[2]}}function gs(r,e){return r.base+"/"+e+"/xhr_send"}function $t(r){var e=r.indexOf("?")===-1?"?":"&";return r+e+"t="+ +new Date+"&n="+ps++}function xs(r,e){var t=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(r);return t[1]+e+t[3]}function Zt(r){return M.randomInt(r)}function bs(r){for(var e=[],t=0;t<r;t++)e.push(Zt(32).toString(32));return e.join("")}var vs=fs,ws={getReceiveURL:function(r,e){return r.base+"/"+e+"/xhr_streaming"+r.queryString},onHeartbeat:function(r){r.sendRaw("[]")},sendHeartbeat:function(r){r.sendRaw("[]")},onFinished:function(r,e){r.onClose(1006,"Connection interrupted ("+e+")",!1)}},ys=ws,js={getReceiveURL:function(r,e){return r.base+"/"+e+"/xhr"+r.queryString},onHeartbeat:function(){},sendHeartbeat:function(r){r.sendRaw("[]")},onFinished:function(r,e){e===200?r.reconnect():r.onClose(1006,"Connection interrupted ("+e+")",!1)}},_s=js,Ns={getRequest:function(r){var e=M.getXHRAPI(),t=new e;return t.onreadystatechange=t.onprogress=function(){switch(t.readyState){case 3:t.responseText&&t.responseText.length>0&&r.onChunk(t.status,t.responseText);break;case 4:t.responseText&&t.responseText.length>0&&r.onChunk(t.status,t.responseText),r.emit("finished",t.status),r.close();break}},t},abortRequest:function(r){r.onreadystatechange=null,r.abort()}},ks=Ns,Ss={createStreamingSocket(r){return this.createSocket(ys,r)},createPollingSocket(r){return this.createSocket(_s,r)},createSocket(r,e){return new vs(r,e)},createXHR(r,e){return this.createRequest(ks,r,e)},createRequest(r,e,t){return new us(r,e,t)}},Qt=Ss;Qt.createXDR=function(r,e){return this.createRequest(ds,r,e)};var Cs=Qt,Ts={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:u,DependenciesReceivers:N,getDefaultStrategy:os,Transports:zn,transportConnectionInitializer:ls,HTTPFactory:Cs,TimelineTransport:Nn,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(r){window.Pusher=r;var e=()=>{this.onDocumentBody(r.ready)};window.JSON?e():C.load("json2",{},e)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:X,jsonp:vn}},onDocumentBody(r){document.body?r():setTimeout(()=>{this.onDocumentBody(r)},0)},createJSONPRequest(r,e){return new yn(r,e)},createScriptRequest(r){return new wn(r)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var r=this.getXHRAPI();return new r},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return Un},createWebSocket(r){var e=this.getWebSocketAPI();return new e(r)},createSocketRequest(r,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(r,e);if(this.isXDRSupported(e.indexOf("https:")===0))return this.HTTPFactory.createXDR(r,e);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var r=this.getXHRAPI();return!!r&&new r().withCredentials!==void 0},isXDRSupported(r){var e=r?"https:":"http:",t=this.getProtocol();return!!window.XDomainRequest&&t===e},addUnloadListener(r){window.addEventListener!==void 0?window.addEventListener("unload",r,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",r)},removeUnloadListener(r){window.addEventListener!==void 0?window.removeEventListener("unload",r,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",r)},randomInt(r){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*r)}},M=Ts,at;(function(r){r[r.ERROR=3]="ERROR",r[r.INFO=6]="INFO",r[r.DEBUG=7]="DEBUG"})(at||(at={}));var Be=at;class Ps{constructor(e,t,s){this.key=e,this.session=t,this.events=[],this.options=s||{},this.sent=0,this.uniqueID=0}log(e,t){e<=this.options.level&&(this.events.push(ee({},t,{timestamp:$.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(e){this.log(Be.ERROR,e)}info(e){this.log(Be.INFO,e)}debug(e){this.log(Be.DEBUG,e)}isEmpty(){return this.events.length===0}send(e,t){var s=ee({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],e(s,(a,f)=>{a||this.sent++,t&&t(a,f)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class As{constructor(e,t,s,a){this.name=e,this.priority=t,this.transport=s,this.options=a||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(e,t){if(this.isSupported()){if(this.priority<e)return er(new P,t)}else return er(new j,t);var s=!1,a=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),f=null,v=function(){a.unbind("initialized",v),a.connect()},S=function(){f=he.createHandshake(a,function(Q){s=!0,F(),t(null,Q)})},I=function(Q){F(),t(Q)},B=function(){F();var Q;Q=De(a),t(new E(Q))},F=function(){a.unbind("initialized",v),a.unbind("open",S),a.unbind("error",I),a.unbind("closed",B)};return a.bind("initialized",v),a.bind("open",S),a.bind("error",I),a.bind("closed",B),a.initialize(),{abort:()=>{s||(F(),f?f.close():a.close())},forceMinPriority:Q=>{s||this.priority<Q&&(f?f.close():a.close())}}}}function er(r,e){return $.defer(function(){e(r)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Es}=M;var Rs=function(r,e,t,s,a,f){var v=Es[t];if(!v)throw new L(t);var S=(!r.enabledTransports||ce(r.enabledTransports,e)!==-1)&&(!r.disabledTransports||ce(r.disabledTransports,e)===-1),I;return S?(a=Object.assign({ignoreNullOrigin:r.ignoreNullOrigin},a),I=new As(e,s,f?f.getAssistant(v):v,a)):I=Ls,I},Ls={isSupported:function(){return!1},connect:function(r,e){var t=$.defer(function(){e(new j)});return{abort:function(){t.ensureAborted()},forceMinPriority:function(){}}}};function Is(r){if(r==null)throw"You must pass an options object";if(r.cluster==null)throw"Options object must provide a cluster";"disableStats"in r&&J.warn("The disableStats option is deprecated in favor of enableStats")}const Os=(r,e)=>{var t="socket_id="+encodeURIComponent(r.socketId);for(var s in e.params)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(e.params[s]);if(e.paramsProvider!=null){let a=e.paramsProvider();for(var s in a)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(a[s])}return t};var Ms=r=>{if(typeof M.getAuthorizers()[r.transport]>"u")throw`'${r.transport}' is not a recognized auth transport`;return(e,t)=>{const s=Os(e,r);M.getAuthorizers()[r.transport](M,s,r,y.UserAuthentication,t)}};const zs=(r,e)=>{var t="socket_id="+encodeURIComponent(r.socketId);t+="&channel_name="+encodeURIComponent(r.channelName);for(var s in e.params)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(e.params[s]);if(e.paramsProvider!=null){let a=e.paramsProvider();for(var s in a)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(a[s])}return t};var Ds=r=>{if(typeof M.getAuthorizers()[r.transport]>"u")throw`'${r.transport}' is not a recognized auth transport`;return(e,t)=>{const s=zs(e,r);M.getAuthorizers()[r.transport](M,s,r,y.ChannelAuthorization,t)}};const Us=(r,e,t)=>{const s={authTransport:e.transport,authEndpoint:e.endpoint,auth:{params:e.params,headers:e.headers}};return(a,f)=>{const v=r.channel(a.channelName);t(v,s).authorize(a.socketId,f)}};function Hs(r,e){let t={activityTimeout:r.activityTimeout||w.activityTimeout,cluster:r.cluster,httpPath:r.httpPath||w.httpPath,httpPort:r.httpPort||w.httpPort,httpsPort:r.httpsPort||w.httpsPort,pongTimeout:r.pongTimeout||w.pongTimeout,statsHost:r.statsHost||w.stats_host,unavailableTimeout:r.unavailableTimeout||w.unavailableTimeout,wsPath:r.wsPath||w.wsPath,wsPort:r.wsPort||w.wsPort,wssPort:r.wssPort||w.wssPort,enableStats:qs(r),httpHost:Bs(r),useTLS:Vs(r),wsHost:Fs(r),userAuthenticator:Ws(r),channelAuthorizer:Xs(r,e)};return"disabledTransports"in r&&(t.disabledTransports=r.disabledTransports),"enabledTransports"in r&&(t.enabledTransports=r.enabledTransports),"ignoreNullOrigin"in r&&(t.ignoreNullOrigin=r.ignoreNullOrigin),"timelineParams"in r&&(t.timelineParams=r.timelineParams),"nacl"in r&&(t.nacl=r.nacl),t}function Bs(r){return r.httpHost?r.httpHost:r.cluster?`sockjs-${r.cluster}.pusher.com`:w.httpHost}function Fs(r){return r.wsHost?r.wsHost:Gs(r.cluster)}function Gs(r){return`ws-${r}.pusher.com`}function Vs(r){return M.getProtocol()==="https:"?!0:r.forceTLS!==!1}function qs(r){return"enableStats"in r?r.enableStats:"disableStats"in r?!r.disableStats:!1}function Ws(r){const e=Object.assign(Object.assign({},w.userAuthentication),r.userAuthentication);return"customHandler"in e&&e.customHandler!=null?e.customHandler:Ms(e)}function Js(r,e){let t;return"channelAuthorization"in r?t=Object.assign(Object.assign({},w.channelAuthorization),r.channelAuthorization):(t={transport:r.authTransport||w.authTransport,endpoint:r.authEndpoint||w.authEndpoint},"auth"in r&&("params"in r.auth&&(t.params=r.auth.params),"headers"in r.auth&&(t.headers=r.auth.headers)),"authorizer"in r&&(t.customHandler=Us(e,t,r.authorizer))),t}function Xs(r,e){const t=Js(r,e);return"customHandler"in t&&t.customHandler!=null?t.customHandler:Ds(t)}class Ys extends de{constructor(e){super(function(t,s){J.debug(`No callbacks on watchlist events for ${t}`)}),this.pusher=e,this.bindWatchlistInternalEvent()}handleEvent(e){e.data.events.forEach(t=>{this.emit(t.name,t)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",e=>{var t=e.event;t==="pusher_internal:watchlist_events"&&this.handleEvent(e)})}}function Ks(){let r,e;return{promise:new Promise((s,a)=>{r=s,e=a}),resolve:r,reject:e}}var $s=Ks;class Zs extends de{constructor(e){super(function(t,s){J.debug("No callbacks on user for "+t)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(t,s)=>{if(t){J.warn(`Error during signin: ${t}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:s.auth,user_data:s.user_data})},this.pusher=e,this.pusher.connection.bind("state_change",({previous:t,current:s})=>{t!=="connected"&&s==="connected"&&this._signin(),t==="connected"&&s!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new Ys(e),this.pusher.connection.bind("message",t=>{var s=t.event;s==="pusher:signin_success"&&this._onSigninSuccess(t.data),this.serverToUserChannel&&this.serverToUserChannel.name===t.channel&&this.serverToUserChannel.handleEvent(t)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(e){try{this.user_data=JSON.parse(e.user_data)}catch{J.error(`Failed parsing user data after signin: ${e.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){J.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const e=t=>{t.subscriptionPending&&t.subscriptionCancelled?t.reinstateSubscription():!t.subscriptionPending&&this.pusher.connection.state==="connected"&&t.subscribe()};this.serverToUserChannel=new et(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((t,s)=>{t.indexOf("pusher_internal:")===0||t.indexOf("pusher:")===0||this.emit(t,s)}),e(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:e,resolve:t}=$s();e.done=!1;const s=()=>{e.done=!0};e.then(s).catch(s),this.signinDonePromise=e,this._signinDoneResolve=t}}class re{static ready(){re.isReady=!0;for(var e=0,t=re.instances.length;e<t;e++)re.instances[e].connect()}static getClientFeatures(){return ze(Bt({ws:M.Transports.ws},function(e){return e.isSupported({})}))}constructor(e,t){Qs(e),Is(t),this.key=e,this.config=Hs(t,this),this.channels=he.createChannels(),this.global_emitter=new de,this.sessionID=M.randomInt(1e9),this.timeline=new Ps(this.key,this.sessionID,{cluster:this.config.cluster,features:re.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Be.INFO,version:w.VERSION}),this.config.enableStats&&(this.timelineSender=he.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+M.TimelineTransport.name}));var s=a=>M.getDefaultStrategy(this.config,a,Rs);this.connection=he.createConnectionManager(this.key,{getStrategy:s,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",a=>{var f=a.event,v=f.indexOf("pusher_internal:")===0;if(a.channel){var S=this.channel(a.channel);S&&S.handleEvent(a)}v||this.global_emitter.emit(a.event,a.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",a=>{J.warn(a)}),re.instances.push(this),this.timeline.info({instances:re.instances.length}),this.user=new Zs(this),re.isReady&&this.connect()}channel(e){return this.channels.find(e)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var e=this.connection.isUsingTLS(),t=this.timelineSender;this.timelineSenderTimer=new q(6e4,function(){t.send(e)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(e,t,s){return this.global_emitter.bind(e,t,s),this}unbind(e,t,s){return this.global_emitter.unbind(e,t,s),this}bind_global(e){return this.global_emitter.bind_global(e),this}unbind_global(e){return this.global_emitter.unbind_global(e),this}unbind_all(e){return this.global_emitter.unbind_all(),this}subscribeAll(){var e;for(e in this.channels.channels)this.channels.channels.hasOwnProperty(e)&&this.subscribe(e)}subscribe(e){var t=this.channels.add(e,this);return t.subscriptionPending&&t.subscriptionCancelled?t.reinstateSubscription():!t.subscriptionPending&&this.connection.state==="connected"&&t.subscribe(),t}unsubscribe(e){var t=this.channels.find(e);t&&t.subscriptionPending?t.cancelSubscription():(t=this.channels.remove(e),t&&t.subscribed&&t.unsubscribe())}send_event(e,t,s){return this.connection.send_event(e,t,s)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}re.instances=[],re.isReady=!1,re.logToConsole=!1,re.Runtime=M,re.ScriptReceivers=M.ScriptReceivers,re.DependenciesReceivers=M.DependenciesReceivers,re.auth_callbacks=M.auth_callbacks;var ot=o.default=re;function Qs(r){if(r==null)throw"You must pass your app key when you instantiate Pusher."}M.setup(re)}])})})(bt);var Nr=bt.exports;const kr=dt(Nr);function vt(i,d,c,o,l){const[h,u]=O.useState(null),[b,w]=O.useState(null),[D,N]=O.useState([]),[C,p]=O.useState(!0),[k,T]=O.useState(null),y=O.useCallback(async()=>{try{p(!0);const L=c!=="all"?`&segment=${c}`:"",j=`&trafficType=${o}`;let A=`${i.endpoint}/stats?`;d==="custom"&&(l!=null&&l.start)&&(l!=null&&l.end)?A+=`startDate=${l.start}&endDate=${l.end}${L}${j}`:A+=`timeframe=${d}${L}${j}`;const G=await fetch(A,{headers:{"x-tenant-key":i.apiKey,"x-tenant-secret":i.adminSecret,"Cache-Control":"no-cache"}});if(G.ok){const X=await G.json();u(X),T(null)}else throw new Error("Failed to fetch stats")}catch(L){T(L.message)}finally{p(!1)}},[i.endpoint,i.apiKey,i.adminSecret,d,c,o,l]),m=O.useCallback(async()=>{try{const L=c!=="all"?`&segment=${c}`:"",j=`&trafficType=${o}`;let A=l==null?void 0:l.start,G=l==null?void 0:l.end;if(!A||!G){const te=new Date,U=new Date;d==="7d"?U.setDate(te.getDate()-7):d==="30d"?U.setDate(te.getDate()-30):U.setHours(te.getHours()-24),A=U.toISOString().split("T")[0],G=te.toISOString().split("T")[0]}const X=await fetch(`${i.endpoint}/funnel?startDate=${A}&endDate=${G}${L}${j}`,{headers:{"x-tenant-key":i.apiKey,"x-tenant-secret":i.adminSecret,"Cache-Control":"no-cache"}});if(X.ok){const te=await X.json();w(te)}}catch(L){console.error("[Dashboard] funnel fetch error:",L)}},[i.endpoint,i.apiKey,i.adminSecret,d,c,o,l]),x=O.useCallback(async()=>{try{const L=await fetch(`${i.endpoint}/heatmap/pages`,{headers:{"x-tenant-key":i.apiKey,"x-tenant-secret":i.adminSecret,"Cache-Control":"no-cache"}});if(L.ok){const j=await L.json();N(j)}}catch(L){console.error("[Dashboard] heatmap pages fetch error:",L)}},[i.endpoint,i.apiKey,i.adminSecret]),_=O.useRef(0),P=O.useRef(null),E=O.useCallback(()=>{y(),m(),x()},[y,m,x]),H=O.useCallback(()=>{P.current&&clearTimeout(P.current);const L=Date.now(),j=L-_.current;j>2e3?(E(),_.current=L):P.current=setTimeout(()=>{E(),_.current=Date.now()},2e3-j)},[E]);return O.useEffect(()=>{if(y(),m(),x(),i.realtimeEnabled){const L=new kr(i.soketiKey||"infrabricks_key",{wsHost:i.soketiHost||"127.0.0.1",wsPort:i.soketiPort||443,forceTLS:i.soketiUseTLS!==!1,enabledTransports:["ws","wss"],cluster:"mt1"}),j=`analytics-${i.apiKey}`,A=L.subscribe(j);return A.bind("new-session",H),A.bind("new-pageview",H),A.bind("new-event",H),A.bind("heartbeat",H),A.bind("session-offline",H),()=>{L.unsubscribe(j),L.disconnect()}}},[y,m,H,i.realtimeEnabled,i.soketiHost,i.soketiKey,i.soketiPort,i.soketiUseTLS,i.apiKey]),O.useEffect(()=>{const L=setInterval(E,i.refreshInterval||6e4);return()=>clearInterval(L)},[E,i.refreshInterval]),{stats:h,funnel:b,heatmapPages:D,loading:C,error:k,refresh:y}}function wt(i){var d,c,o="";if(typeof i=="string"||typeof i=="number")o+=i;else if(typeof i=="object")if(Array.isArray(i)){var l=i.length;for(d=0;d<l;d++)i[d]&&(c=wt(i[d]))&&(o&&(o+=" "),o+=c)}else for(c in i)i[c]&&(o&&(o+=" "),o+=c);return o}function Sr(){for(var i,d,c=0,o="",l=arguments.length;c<l;c++)(i=arguments[c])&&(d=wt(i))&&(o&&(o+=" "),o+=d);return o}const We="-",Cr=i=>{const d=Pr(i),{conflictingClassGroups:c,conflictingClassGroupModifiers:o}=i;return{getClassGroupId:u=>{const b=u.split(We);return b[0]===""&&b.length!==1&&b.shift(),yt(b,d)||Tr(u)},getConflictingClassGroupIds:(u,b)=>{const w=c[u]||[];return b&&o[u]?[...w,...o[u]]:w}}},yt=(i,d)=>{var u;if(i.length===0)return d.classGroupId;const c=i[0],o=d.nextPart.get(c),l=o?yt(i.slice(1),o):void 0;if(l)return l;if(d.validators.length===0)return;const h=i.join(We);return(u=d.validators.find(({validator:b})=>b(h)))==null?void 0:u.classGroupId},jt=/^\[(.+)\]$/,Tr=i=>{if(jt.test(i)){const d=jt.exec(i)[1],c=d==null?void 0:d.substring(0,d.indexOf(":"));if(c)return"arbitrary.."+c}},Pr=i=>{const{theme:d,prefix:c}=i,o={nextPart:new Map,validators:[]};return Er(Object.entries(i.classGroups),c).forEach(([h,u])=>{Je(u,o,h,d)}),o},Je=(i,d,c,o)=>{i.forEach(l=>{if(typeof l=="string"){const h=l===""?d:_t(d,l);h.classGroupId=c;return}if(typeof l=="function"){if(Ar(l)){Je(l(o),d,c,o);return}d.validators.push({validator:l,classGroupId:c});return}Object.entries(l).forEach(([h,u])=>{Je(u,_t(d,h),c,o)})})},_t=(i,d)=>{let c=i;return d.split(We).forEach(o=>{c.nextPart.has(o)||c.nextPart.set(o,{nextPart:new Map,validators:[]}),c=c.nextPart.get(o)}),c},Ar=i=>i.isThemeGetter,Er=(i,d)=>d?i.map(([c,o])=>{const l=o.map(h=>typeof h=="string"?d+h:typeof h=="object"?Object.fromEntries(Object.entries(h).map(([u,b])=>[d+u,b])):h);return[c,l]}):i,Rr=i=>{if(i<1)return{get:()=>{},set:()=>{}};let d=0,c=new Map,o=new Map;const l=(h,u)=>{c.set(h,u),d++,d>i&&(d=0,o=c,c=new Map)};return{get(h){let u=c.get(h);if(u!==void 0)return u;if((u=o.get(h))!==void 0)return l(h,u),u},set(h,u){c.has(h)?c.set(h,u):l(h,u)}}},Nt="!",Lr=i=>{const{separator:d,experimentalParseClassName:c}=i,o=d.length===1,l=d[0],h=d.length,u=b=>{const w=[];let D=0,N=0,C;for(let m=0;m<b.length;m++){let x=b[m];if(D===0){if(x===l&&(o||b.slice(m,m+h)===d)){w.push(b.slice(N,m)),N=m+h;continue}if(x==="/"){C=m;continue}}x==="["?D++:x==="]"&&D--}const p=w.length===0?b:b.substring(N),k=p.startsWith(Nt),T=k?p.substring(1):p,y=C&&C>N?C-N:void 0;return{modifiers:w,hasImportantModifier:k,baseClassName:T,maybePostfixModifierPosition:y}};return c?b=>c({className:b,parseClassName:u}):u},Ir=i=>{if(i.length<=1)return i;const d=[];let c=[];return i.forEach(o=>{o[0]==="["?(d.push(...c.sort(),o),c=[]):c.push(o)}),d.push(...c.sort()),d},Or=i=>({cache:Rr(i.cacheSize),parseClassName:Lr(i),...Cr(i)}),Mr=/\s+/,zr=(i,d)=>{const{parseClassName:c,getClassGroupId:o,getConflictingClassGroupIds:l}=d,h=[],u=i.trim().split(Mr);let b="";for(let w=u.length-1;w>=0;w-=1){const D=u[w],{modifiers:N,hasImportantModifier:C,baseClassName:p,maybePostfixModifierPosition:k}=c(D);let T=!!k,y=o(T?p.substring(0,k):p);if(!y){if(!T){b=D+(b.length>0?" "+b:b);continue}if(y=o(p),!y){b=D+(b.length>0?" "+b:b);continue}T=!1}const m=Ir(N).join(":"),x=C?m+Nt:m,_=x+y;if(h.includes(_))continue;h.push(_);const P=l(y,T);for(let E=0;E<P.length;++E){const H=P[E];h.push(x+H)}b=D+(b.length>0?" "+b:b)}return b};function Dr(){let i=0,d,c,o="";for(;i<arguments.length;)(d=arguments[i++])&&(c=kt(d))&&(o&&(o+=" "),o+=c);return o}const kt=i=>{if(typeof i=="string")return i;let d,c="";for(let o=0;o<i.length;o++)i[o]&&(d=kt(i[o]))&&(c&&(c+=" "),c+=d);return c};function Ur(i,...d){let c,o,l,h=u;function u(w){const D=d.reduce((N,C)=>C(N),i());return c=Or(D),o=c.cache.get,l=c.cache.set,h=b,b(w)}function b(w){const D=o(w);if(D)return D;const N=zr(w,c);return l(w,N),N}return function(){return h(Dr.apply(null,arguments))}}const V=i=>{const d=c=>c[i]||[];return d.isThemeGetter=!0,d},St=/^\[(?:([a-z-]+):)?(.+)\]$/i,Hr=/^\d+\/\d+$/,Br=new Set(["px","full","screen"]),Fr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Vr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,qr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Wr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oe=i=>je(i)||Br.has(i)||Hr.test(i),ue=i=>_e(i,"length",en),je=i=>!!i&&!Number.isNaN(Number(i)),Xe=i=>_e(i,"number",je),Pe=i=>!!i&&Number.isInteger(Number(i)),Jr=i=>i.endsWith("%")&&je(i.slice(0,-1)),z=i=>St.test(i),pe=i=>Fr.test(i),Xr=new Set(["length","size","percentage"]),Yr=i=>_e(i,Xr,Ct),Kr=i=>_e(i,"position",Ct),$r=new Set(["image","url"]),Zr=i=>_e(i,$r,rn),Qr=i=>_e(i,"",tn),Ae=()=>!0,_e=(i,d,c)=>{const o=St.exec(i);return o?o[1]?typeof d=="string"?o[1]===d:d.has(o[1]):c(o[2]):!1},en=i=>Gr.test(i)&&!Vr.test(i),Ct=()=>!1,tn=i=>qr.test(i),rn=i=>Wr.test(i),nn=Ur(()=>{const i=V("colors"),d=V("spacing"),c=V("blur"),o=V("brightness"),l=V("borderColor"),h=V("borderRadius"),u=V("borderSpacing"),b=V("borderWidth"),w=V("contrast"),D=V("grayscale"),N=V("hueRotate"),C=V("invert"),p=V("gap"),k=V("gradientColorStops"),T=V("gradientColorStopPositions"),y=V("inset"),m=V("margin"),x=V("opacity"),_=V("padding"),P=V("saturate"),E=V("scale"),H=V("sepia"),L=V("skew"),j=V("space"),A=V("translate"),G=()=>["auto","contain","none"],X=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto",z,d],U=()=>[z,d],se=()=>["",oe,ue],fe=()=>["auto",je,z],me=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],le=()=>["solid","dashed","dotted","double","none"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>["start","end","center","between","around","evenly","stretch"],ae=()=>["","0",z],be=()=>["auto","avoid","all","avoid-page","page","left","right","column"],g=()=>[je,z];return{cacheSize:500,separator:":",theme:{colors:[Ae],spacing:[oe,ue],blur:["none","",pe,z],brightness:g(),borderColor:[i],borderRadius:["none","","full",pe,z],borderSpacing:U(),borderWidth:se(),contrast:g(),grayscale:ae(),hueRotate:g(),invert:ae(),gap:U(),gradientColorStops:[i],gradientColorStopPositions:[Jr,ue],inset:te(),margin:te(),opacity:g(),padding:U(),saturate:g(),scale:g(),sepia:ae(),skew:g(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",z]}],container:["container"],columns:[{columns:[pe]}],"break-after":[{"break-after":be()}],"break-before":[{"break-before":be()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...me(),z]}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:G()}],"overscroll-x":[{"overscroll-x":G()}],"overscroll-y":[{"overscroll-y":G()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Pe,z]}],basis:[{basis:te()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",z]}],grow:[{grow:ae()}],shrink:[{shrink:ae()}],order:[{order:["first","last","none",Pe,z]}],"grid-cols":[{"grid-cols":[Ae]}],"col-start-end":[{col:["auto",{span:["full",Pe,z]},z]}],"col-start":[{"col-start":fe()}],"col-end":[{"col-end":fe()}],"grid-rows":[{"grid-rows":[Ae]}],"row-start-end":[{row:["auto",{span:[Pe,z]},z]}],"row-start":[{"row-start":fe()}],"row-end":[{"row-end":fe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",z]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",z]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...ge()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ge(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ge(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",z,d]}],"min-w":[{"min-w":[z,d,"min","max","fit"]}],"max-w":[{"max-w":[z,d,"none","full","min","max","fit","prose",{screen:[pe]},pe]}],h:[{h:[z,d,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[z,d,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[z,d,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[z,d,"auto","min","max","fit"]}],"font-size":[{text:["base",pe,ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xe]}],"font-family":[{font:[Ae]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",z]}],"line-clamp":[{"line-clamp":["none",je,Xe]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",oe,z]}],"list-image":[{"list-image":["none",z]}],"list-style-type":[{list:["none","disc","decimal",z]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[i]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[i]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",oe,ue]}],"underline-offset":[{"underline-offset":["auto",oe,z]}],"text-decoration-color":[{decoration:[i]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",z]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...me(),Kr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Yr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Zr]}],"bg-color":[{bg:[i]}],"gradient-from-pos":[{from:[T]}],"gradient-via-pos":[{via:[T]}],"gradient-to-pos":[{to:[T]}],"gradient-from":[{from:[k]}],"gradient-via":[{via:[k]}],"gradient-to":[{to:[k]}],rounded:[{rounded:[h]}],"rounded-s":[{"rounded-s":[h]}],"rounded-e":[{"rounded-e":[h]}],"rounded-t":[{"rounded-t":[h]}],"rounded-r":[{"rounded-r":[h]}],"rounded-b":[{"rounded-b":[h]}],"rounded-l":[{"rounded-l":[h]}],"rounded-ss":[{"rounded-ss":[h]}],"rounded-se":[{"rounded-se":[h]}],"rounded-ee":[{"rounded-ee":[h]}],"rounded-es":[{"rounded-es":[h]}],"rounded-tl":[{"rounded-tl":[h]}],"rounded-tr":[{"rounded-tr":[h]}],"rounded-br":[{"rounded-br":[h]}],"rounded-bl":[{"rounded-bl":[h]}],"border-w":[{border:[b]}],"border-w-x":[{"border-x":[b]}],"border-w-y":[{"border-y":[b]}],"border-w-s":[{"border-s":[b]}],"border-w-e":[{"border-e":[b]}],"border-w-t":[{"border-t":[b]}],"border-w-r":[{"border-r":[b]}],"border-w-b":[{"border-b":[b]}],"border-w-l":[{"border-l":[b]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...le(),"hidden"]}],"divide-x":[{"divide-x":[b]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[b]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:le()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...le()]}],"outline-offset":[{"outline-offset":[oe,z]}],"outline-w":[{outline:[oe,ue]}],"outline-color":[{outline:[i]}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[i]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[oe,ue]}],"ring-offset-color":[{"ring-offset":[i]}],shadow:[{shadow:["","inner","none",pe,Qr]}],"shadow-color":[{shadow:[Ae]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...xe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":xe()}],filter:[{filter:["","none"]}],blur:[{blur:[c]}],brightness:[{brightness:[o]}],contrast:[{contrast:[w]}],"drop-shadow":[{"drop-shadow":["","none",pe,z]}],grayscale:[{grayscale:[D]}],"hue-rotate":[{"hue-rotate":[N]}],invert:[{invert:[C]}],saturate:[{saturate:[P]}],sepia:[{sepia:[H]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[c]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[w]}],"backdrop-grayscale":[{"backdrop-grayscale":[D]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[N]}],"backdrop-invert":[{"backdrop-invert":[C]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[P]}],"backdrop-sepia":[{"backdrop-sepia":[H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[u]}],"border-spacing-x":[{"border-spacing-x":[u]}],"border-spacing-y":[{"border-spacing-y":[u]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",z]}],duration:[{duration:g()}],ease:[{ease:["linear","in","out","in-out",z]}],delay:[{delay:g()}],animate:[{animate:["none","spin","ping","pulse","bounce",z]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Pe,z]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[L]}],"skew-y":[{"skew-y":[L]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",z]}],accent:[{accent:["auto",i]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",z]}],"caret-color":[{caret:[i]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",z]}],fill:[{fill:[i,"none"]}],"stroke-w":[{stroke:[oe,ue,Xe]}],stroke:[{stroke:[i,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),Tt={"Ascension Island":"🇦🇨",Andorra:"🇦🇩","United Arab Emirates":"🇦🇪",Afghanistan:"🇦🇫","Antigua & Barbuda":"🇦🇬",Anguilla:"🇦🇮",Albania:"🇦🇱",Armenia:"🇦🇲",Angola:"🇦🇴",Antarctica:"🇦🇶",Argentina:"🇦🇷","American Samoa":"🇦🇸",Austria:"🇦🇹",Australia:"🇦🇺",Aruba:"🇦🇼","Åland Islands":"🇦🇽",Azerbaijan:"🇦🇿","Bosnia & Herzegovina":"🇧🇦",Barbados:"🇧🇧",Bangladesh:"🇧🇩",Belgium:"🇧🇪","Burkina Faso":"🇧🇫",Bulgaria:"🇧🇬",Bahrain:"🇧🇭",Burundi:"🇧🇮",Benin:"🇧🇯","St. Barthélemy":"🇧🇱",Bermuda:"🇧🇲",Brunei:"🇧🇳",Bolivia:"🇧🇴","Caribbean Netherlands":"🇧🇶",Brazil:"🇧🇷",Bahamas:"🇧🇸",Bhutan:"🇧🇹","Bouvet Island":"🇧🇻",Botswana:"🇧🇼",Belarus:"🇧🇾",Belize:"🇧🇿",Canada:"🇨🇦","Cocos (Keeling) Islands":"🇨🇨","Congo - Kinshasa":"🇨🇩","Central African Republic":"🇨🇫","Congo - Brazzaville":"🇨🇬",Switzerland:"🇨🇭","Côte d’Ivoire":"🇨🇮","Cook Islands":"🇨🇰",Chile:"🇨🇱",Cameroon:"🇨🇲",China:"🇨🇳",Colombia:"🇨🇴","Clipperton Island":"🇨🇵","Costa Rica":"🇨🇷",Cuba:"🇨🇺","Cape Verde":"🇨🇻",Curaçao:"🇨🇼","Christmas Island":"🇨🇽",Cyprus:"🇨🇾",Czechia:"🇨🇿",Germany:"🇩🇪","Diego Garcia":"🇩🇬",Djibouti:"🇩🇯",Denmark:"🇩🇰",Dominica:"🇩🇲","Dominican Republic":"🇩🇴",Algeria:"🇩🇿","Ceuta & Melilla":"🇪🇦",Ecuador:"🇪🇨",Estonia:"🇪🇪",Egypt:"🇪🇬","Western Sahara":"🇪🇭",Eritrea:"🇪🇷",Spain:"🇪🇸",Ethiopia:"🇪🇹","European Union":"🇪🇺",Finland:"🇫🇮",Fiji:"🇫🇯","Falkland Islands":"🇫🇰",Micronesia:"🇫🇲","Faroe Islands":"🇫🇴",France:"🇫🇷",Gabon:"🇬🇦","United Kingdom":"🇬🇧",Grenada:"🇬🇩",Georgia:"🇬🇪","French Guiana":"🇬🇫",Guernsey:"🇬🇬",Ghana:"🇬🇭",Gibraltar:"🇬🇮",Greenland:"🇬🇱",Gambia:"🇬🇲",Guinea:"🇬🇳",Guadeloupe:"🇬🇵","Equatorial Guinea":"🇬🇶",Greece:"🇬🇷","South Georgia & South Sandwich Islands":"🇬🇸",Guatemala:"🇬🇹",Guam:"🇬🇺","Guinea-Bissau":"🇬🇼",Guyana:"🇬🇾","Hong Kong SAR China":"🇭🇰","Heard & McDonald Islands":"🇭🇲",Honduras:"🇭🇳",Croatia:"🇭🇷",Haiti:"🇭🇹",Hungary:"🇭🇺","Canary Islands":"🇮🇨",Indonesia:"🇮🇩",Ireland:"🇮🇪",Israel:"🇮🇱","Isle of Man":"🇮🇲",India:"🇮🇳","British Indian Ocean Territory":"🇮🇴",Iraq:"🇮🇶",Iran:"🇮🇷",Iceland:"🇮🇸",Italy:"🇮🇹",Jersey:"🇯🇪",Jamaica:"🇯🇲",Jordan:"🇯🇴",Japan:"🇯🇵",Kenya:"🇰🇪",Kyrgyzstan:"🇰🇬",Cambodia:"🇰🇭",Kiribati:"🇰🇮",Comoros:"🇰🇲","St. Kitts & Nevis":"🇰🇳","North Korea":"🇰🇵","South Korea":"🇰🇷",Kuwait:"🇰🇼","Cayman Islands":"🇰🇾",Kazakhstan:"🇰🇿",Laos:"🇱🇦",Lebanon:"🇱🇧","St. Lucia":"🇱🇨",Liechtenstein:"🇱🇮","Sri Lanka":"🇱🇰",Liberia:"🇱🇷",Lesotho:"🇱🇸",Lithuania:"🇱🇹",Luxembourg:"🇱🇺",Latvia:"🇱🇻",Libya:"🇱🇾",Morocco:"🇲🇦",Monaco:"🇲🇨",Moldova:"🇲🇩",Montenegro:"🇲🇪","St. Martin":"🇲🇫",Madagascar:"🇲🇬","Marshall Islands":"🇲🇭","North Macedonia":"🇲🇰",Mali:"🇲🇱","Myanmar (Burma)":"🇲🇲",Mongolia:"🇲🇳","Macao SAR China":"🇲🇴","Northern Mariana Islands":"🇲🇵",Martinique:"🇲🇶",Mauritania:"🇲🇷",Montserrat:"🇲🇸",Malta:"🇲🇹",Mauritius:"🇲🇺",Maldives:"🇲🇻",Malawi:"🇲🇼",Mexico:"🇲🇽",Malaysia:"🇲🇾",Mozambique:"🇲🇿",Namibia:"🇳🇦","New Caledonia":"🇳🇨",Niger:"🇳🇪","Norfolk Island":"🇳🇫",Nigeria:"🇳🇬",Nicaragua:"🇳🇮",Netherlands:"🇳🇱",Norway:"🇳🇴",Nepal:"🇳🇵",Nauru:"🇳🇷",Niue:"🇳🇺","New Zealand":"🇳🇿",Oman:"🇴🇲",Panama:"🇵🇦",Peru:"🇵🇪","French Polynesia":"🇵🇫","Papua New Guinea":"🇵🇬",Philippines:"🇵🇭",Pakistan:"🇵🇰",Poland:"🇵🇱","St. Pierre & Miquelon":"🇵🇲","Pitcairn Islands":"🇵🇳","Puerto Rico":"🇵🇷","Palestinian Territories":"🇵🇸",Portugal:"🇵🇹",Palau:"🇵🇼",Paraguay:"🇵🇾",Qatar:"🇶🇦",Réunion:"🇷🇪",Romania:"🇷🇴",Serbia:"🇷🇸",Russia:"🇷🇺",Rwanda:"🇷🇼","Saudi Arabia":"🇸🇦","Solomon Islands":"🇸🇧",Seychelles:"🇸🇨",Sudan:"🇸🇩",Sweden:"🇸🇪",Singapore:"🇸🇬","St. Helena":"🇸🇭",Slovenia:"🇸🇮","Svalbard & Jan Mayen":"🇸🇯",Slovakia:"🇸🇰","Sierra Leone":"🇸🇱","San Marino":"🇸🇲",Senegal:"🇸🇳",Somalia:"🇸🇴",Suriname:"🇸🇷","South Sudan":"🇸🇸","São Tomé & Príncipe":"🇸🇹","El Salvador":"🇸🇻","Sint Maarten":"🇸🇽",Syria:"🇸🇾",Eswatini:"🇸🇿","Tristan da Cunha":"🇹🇦","Turks & Caicos Islands":"🇹🇨",Chad:"🇹🇩","French Southern Territories":"🇹🇫",Togo:"🇹🇬",Thailand:"🇹🇭",Tajikistan:"🇹🇯",Tokelau:"🇹🇰","Timor-Leste":"🇹🇱",Turkmenistan:"🇹🇲",Tunisia:"🇹🇳",Tonga:"🇹🇴",Turkey:"🇹🇷","Trinidad & Tobago":"🇹🇹",Tuvalu:"🇹🇻",Taiwan:"🇹🇼",Tanzania:"🇹🇿",Ukraine:"🇺🇦",Uganda:"🇺🇬","U.S. Outlying Islands":"🇺🇲","United Nations":"🇺🇳","United States":"🇺🇸",Uruguay:"🇺🇾",Uzbekistan:"🇺🇿","Vatican City":"🇻🇦","St. Vincent & Grenadines":"🇻🇨",Venezuela:"🇻🇪","British Virgin Islands":"🇻🇬","U.S. Virgin Islands":"🇻🇮",Vietnam:"🇻🇳",Vanuatu:"🇻🇺","Wallis & Futuna":"🇼🇫",Samoa:"🇼🇸",Kosovo:"🇽🇰",Yemen:"🇾🇪",Mayotte:"🇾🇹","South Africa":"🇿🇦",Zambia:"🇿🇲",Zimbabwe:"🇿🇼",England:"🏴",Scotland:"🏴",Wales:"🏴"},Me=(i,d)=>!i&&!d?"🌐":d&&d.length===2?d.toUpperCase().split("").map(c=>String.fromCodePoint(c.charCodeAt(0)+127397)).join(""):i&&Tt[i]||"🌐",sn=i=>new Intl.NumberFormat().format(i),Ye=i=>{const d=new Date,c=new Date(i),o=Math.floor((d.getTime()-c.getTime())/1e3);return o<60?"Just now":o<3600?`${Math.floor(o/60)}m ago`:o<86400?`${Math.floor(o/3600)}h ago`:c.toLocaleDateString()},Pt=i=>{const d=new Date(i),c=d.getDate(),o=d.toLocaleString("en-US",{month:"long"}),l=d.toLocaleString("en-US",{weekday:"long"});return d.getFullYear(),`${l} ${c}${(u=>{if(u>3&&u<21)return"th";switch(u%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}})(c)}, ${o}`};function ne(...i){return nn(Sr(i))}function Ne({label:i,value:d,icon:c,color:o,pulse:l}){const h={blue:"text-blue-400 bg-blue-500/10",purple:"text-purple-400 bg-purple-500/10",green:"text-green-400 bg-green-500/10",orange:"text-orange-400 bg-orange-500/10",red:"text-red-400 bg-red-500/10"};return n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 p-6 rounded-3xl backdrop-blur-xl group hover:border-white/10 transition-all relative overflow-hidden",children:[l&&n.jsxs("div",{className:"absolute top-4 right-4 flex h-3 w-3",children:[n.jsx("span",{className:ne("animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",o==="green"?"bg-green-400":"bg-blue-400")}),n.jsx("span",{className:ne("relative inline-flex rounded-full h-3 w-3",o==="green"?"bg-green-500":"bg-blue-500")})]}),n.jsx("div",{className:ne("w-10 h-10 rounded-2xl flex items-center justify-center mb-4",h[o]),children:c}),n.jsx("p",{className:"text-slate-400 text-sm font-medium mb-1",children:i}),n.jsx("p",{className:"text-3xl font-bold text-white tracking-tight",children:d})]})}function At({stats:i}){var l,h;const d=((l=i==null?void 0:i.summary)==null?void 0:l.realtimeActivity)||Array(30).fill(0),c=((h=i==null?void 0:i.summary)==null?void 0:h.realtimeActivityDetails)||Array(30).fill([]),o=Math.max(...d,1);return n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsxs("div",{children:[n.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[n.jsx(Ie,{className:"w-5 h-5 text-blue-400"}),"Page Views per Minute"]}),n.jsx("p",{className:"text-slate-500 text-sm",children:"Real-time activity for the last 30 minutes"})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("span",{className:"text-3xl font-black text-white",children:d[d.length-1]||0}),n.jsx("p",{className:"text-[10px] text-slate-500 uppercase tracking-widest font-bold",children:"Views in last minute"})]})]}),n.jsx("div",{className:"flex items-end gap-1.5 h-32",children:d.map((u,b)=>{const w=u/o*100,D=c[b]||[];return n.jsx("div",{className:ne("flex-1 transition-all duration-500 rounded-t-lg relative group",b===d.length-1?"bg-blue-500 shadow-[0_0_15px_rgba(59,130,246,0.5)]":"bg-blue-500/20 hover:bg-blue-500/40"),style:{height:`${Math.max(w,4)}%`},children:n.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-3 bg-slate-800 text-white text-[10px] py-2 px-3 rounded-lg opacity-0 group-hover:opacity-100 whitespace-nowrap pointer-events-none z-10 border border-white/10 shadow-2xl backdrop-blur-md transition-opacity min-w-[120px]",children:[n.jsxs("div",{className:"font-bold mb-1",children:[u," views • ",d.length-1-b,"m ago"]}),D.length>0&&n.jsxs("div",{className:"space-y-0.5 border-t border-white/10 pt-1.5 mt-1",children:[D.slice(0,3).map((N,C)=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-sm",children:Me(N.country,N.countryCode)}),n.jsx("span",{className:"text-slate-300 truncate max-w-[80px]",children:N.city||N.country}),n.jsxs("span",{className:"text-slate-500 ml-auto",children:["(",N.count,")"]})]},C)),D.length>3&&n.jsxs("div",{className:"text-slate-500 text-[9px]",children:["+",D.length-3," more"]})]})]})},b)})}),n.jsxs("div",{className:"flex justify-between mt-4",children:[n.jsx("span",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-[0.2em]",children:"30 minutes ago"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse shadow-[0_0_8px_rgba(34,197,94,0.5)]"}),n.jsx("span",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-[0.2em]",children:"Live"})]})]})]})}function Et({pages:i,totalViews:d}){return n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsx("div",{className:"flex items-center justify-between mb-8",children:n.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[n.jsx(xr,{className:"w-5 h-5 text-blue-400"}),"Most Visited Pages"]})}),n.jsxs("div",{className:"space-y-4",children:[i.map((c,o)=>n.jsxs("div",{className:"group flex items-center justify-between p-4 rounded-2xl bg-white/5 hover:bg-white/10 transition-all border border-transparent hover:border-white/10",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("span",{className:"text-xs font-bold text-slate-500 w-4",children:o+1}),n.jsx("span",{className:"text-slate-300 font-medium group-hover:text-blue-400 transition-colors uppercase tracking-wider text-xs",children:c.path==="/"?"Home":c.path.replace("/","").replace(/-/g," ")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-white font-bold",children:c.count}),n.jsx("div",{className:"w-16 bg-white/5 h-1.5 rounded-full overflow-hidden",children:n.jsx("div",{className:"bg-blue-500 h-full rounded-full",style:{width:`${c.count/(d||1)*100}%`}})})]})]},o)),i.length===0&&n.jsx("p",{className:"text-center text-slate-500 py-8 italic",children:"No page view data yet."})]})]})}function Rt({geo:i,cities:d}){return n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsx("div",{className:"flex items-center justify-between mb-8",children:n.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[n.jsx(Ve,{className:"w-5 h-5 text-purple-400"}),"Top Locations"]})}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-xs font-bold text-slate-500 uppercase tracking-widest mb-4",children:"Countries"}),n.jsx("div",{className:"space-y-3",children:i.map((c,o)=>c.country!=="Unknown"&&o<5&&n.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl bg-white/5 border border-transparent",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("span",{className:"text-lg",children:Me(c.country,c.countryCode)}),n.jsx("span",{className:"text-slate-300 font-medium text-sm",children:c.country})]}),n.jsx("span",{className:"text-white font-bold text-sm",children:c.count})]},o))})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-xs font-bold text-slate-500 uppercase tracking-widest mb-4",children:"Cities"}),n.jsx("div",{className:"grid grid-cols-2 gap-3",children:d.map((c,o)=>n.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl bg-blue-500/5 border border-blue-500/10",children:[n.jsx("span",{className:"text-slate-300 text-sm truncate",children:c.city}),n.jsx("span",{className:"text-blue-400 font-bold text-sm",children:c.count})]},o))})]}),i.length===0&&n.jsx("p",{className:"text-center text-slate-500 py-12 italic",children:"Waiting for more traffic data..."})]})]})}function Lt({sources:i,referrers:d}){return n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(Ie,{className:"w-5 h-5 text-orange-400"}),"Traffic Sources (UTM)"]}),n.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[i.map((c,o)=>n.jsxs("div",{className:"flex items-center justify-between p-4 rounded-2xl bg-white/5 border border-white/5",children:[n.jsx("span",{className:"text-slate-300 font-medium",children:c.source}),n.jsx("span",{className:"text-white font-bold",children:c.count})]},o)),i.length===0&&n.jsx("p",{className:"text-slate-500 italic text-sm",children:"No UTM parameters detected yet."})]})]}),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsx("h2",{className:"text-xl font-bold text-white mb-8",children:"Top Referrers"}),n.jsxs("div",{className:"space-y-4",children:[d.map((c,o)=>n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("span",{className:"text-slate-400 text-[10px] truncate max-w-full italic",children:c.url||"Direct"}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-white font-medium text-sm",children:c.url?new URL(c.url).hostname:"Direct Entry"}),n.jsx("span",{className:"text-blue-400 font-bold",children:c.count})]})]},o)),d.length===0&&n.jsx("p",{className:"text-slate-500 italic text-sm",children:"No referrers detected yet."})]})]})]})}function It({session:i}){var c;if(!i.pageViews&&!i.events)return null;const d=[...(i.pageViews||[]).map(o=>({...o,type:"page_view"})),...(i.events||[]).map(o=>{var l;return{...o,type:"event",path:((l=o.metadata)==null?void 0:l.path)||"Action"}})].sort((o,l)=>new Date(o.timestamp).getTime()-new Date(l.timestamp).getTime());return d.length===0?n.jsx("div",{className:"py-8 text-center text-slate-500 italic text-sm",children:"No detailed navigation data available for this session."}):n.jsxs("div",{className:"py-8 px-10 bg-white/[0.01] border-t border-white/5",children:[n.jsx("h3",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest mb-4",children:"Navigation Journey"}),n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-8",children:[n.jsxs("div",{className:"bg-white/5 border border-white/5 rounded-2xl p-4 flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg bg-blue-500/10 flex items-center justify-center text-blue-400",children:n.jsx(mt,{className:"w-4 h-4"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-tight",children:"Browser"}),n.jsx("p",{className:"text-white text-xs font-medium",children:i.browser||"Unknown"})]})]}),n.jsxs("div",{className:"bg-white/5 border border-white/5 rounded-2xl p-4 flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg bg-purple-500/10 flex items-center justify-center text-purple-400",children:n.jsx(gt,{className:"w-4 h-4"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-tight",children:"OS & Screen"}),n.jsxs("p",{className:"text-white text-xs font-medium",children:[i.os||"Unknown",i.screenWidth&&` (${i.screenWidth}x${i.screenHeight})`]})]})]}),n.jsxs("div",{className:"bg-white/5 border border-white/5 rounded-2xl p-4 flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg bg-green-500/10 flex items-center justify-center text-green-400",children:n.jsx(br,{className:"w-4 h-4"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-tight",children:"Language"}),n.jsx("p",{className:"text-white text-xs font-medium uppercase",children:i.language||"Unknown"})]})]}),n.jsxs("div",{className:"bg-white/5 border border-white/5 rounded-2xl p-4 flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg bg-yellow-500/10 flex items-center justify-center text-yellow-400",children:n.jsx(Ve,{className:"w-4 h-4"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] text-slate-500 uppercase font-bold tracking-tight",children:"Network / ISP"}),n.jsx("p",{className:"text-white text-xs font-medium truncate max-w-[120px]",title:i.org||i.isp,children:i.org||i.isp||"Unknown"})]})]})]}),n.jsxs("div",{className:"space-y-0 relative",children:[n.jsx("div",{className:"absolute left-[11px] top-2 bottom-2 w-px bg-white/5"}),d.map((o,l)=>{var h;return n.jsxs("div",{className:"relative pl-10 pb-8 last:pb-4 group",children:[n.jsx("div",{className:`absolute left-0 top-0.5 w-6 h-6 rounded-full border-2 border-slate-900 z-10 flex items-center justify-center transition-transform group-hover:scale-110
|
|
145
145
|
${o.type==="page_view"?"bg-blue-500 shadow-[0_0_10px_rgba(59,130,246,0.5)]":"bg-yellow-500 shadow-[0_0_10px_rgba(234,179,8,0.3)]"}
|
|
146
|
-
`,children:o.type==="page_view"?n.jsx(Ve,{className:"w-3 h-3 text-white"}):n.jsx(Le,{className:"w-3 h-3 text-slate-900"})}),n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:`text-sm font-bold tracking-tight ${o.type==="page_view"?"text-white":"text-yellow-500"}`,children:o.type==="page_view"?o.path:((h=o.name)==null?void 0:h.replace(/_/g," "))||"Interaction"}),n.jsx("span",{className:"text-[10px] text-slate-500 font-mono bg-white/5 px-1.5 py-0.5 rounded",children:new Date(o.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[o.type==="page_view"&&o.duration&&n.jsxs("span",{className:"text-[10px] text-slate-500 flex items-center gap-1 bg-white/5 px-1.5 py-0.5 rounded",children:["⏱️ ",o.duration,"s duration"]}),o.type==="event"&&n.jsxs("span",{className:"text-[10px] text-yellow-500/60 uppercase font-bold tracking-tighter",children:["Triggered ",o.category||"interaction"]})]}),o.metadata&&Object.keys(o.metadata).length>0&&n.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:Object.entries(o.metadata).map(([u,x])=>u!=="path"&&n.jsxs("span",{className:"text-[9px] bg-white/5 px-2 py-0.5 rounded border border-white/5 text-slate-500 font-medium whitespace-nowrap",children:[n.jsxs("span",{className:"text-slate-600 mr-1",children:[u,":"]}),typeof x=="object"?JSON.stringify(x):String(x)]},u))})]})]},l)}),n.jsxs("div",{className:"relative pl-10 group mt-4",children:[n.jsx("div",{className:"absolute left-0 top-0 w-6 h-6 rounded-full border-2 border-slate-900 bg-red-500/20 z-10 flex items-center justify-center",children:n.jsx(yr,{className:"w-3 h-3 text-red-500"})}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-sm font-bold text-red-400",children:"Exit / Last Activity"}),n.jsx("span",{className:"text-[10px] text-slate-600 bg-red-500/5 px-2 py-0.5 rounded font-mono",children:new Date(i.lastActive).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),n.jsxs("span",{className:"text-[10px] text-slate-500 italic",children:["User left site from: ",n.jsx("span",{className:"text-slate-400 font-bold not-italic ml-1",children:((c=d[d.length-1])==null?void 0:c.path)||"Unknown page"})]})]})]})]})]})}function Ot({sessions:i}){const[d,c]=O.useState(null),[,o]=O.useState(0);return O.useEffect(()=>{const l=setInterval(()=>o(h=>h+1),3e4);return()=>clearInterval(l)},[]),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(qe,{className:"w-5 h-5 text-green-400"}),"Recent Visitors"]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-white/5 pb-4",children:[n.jsx("th",{className:"pb-4 w-10"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest text-center px-2",children:"Live"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Visitor / IP"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Location"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"ISP"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Source"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Exit Page"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Device"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Browser"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"OS"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Views"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest px-2 text-right",children:"Last Activity"})]})}),n.jsx("tbody",{className:"divide-y divide-white/5",children:i.slice(0,7).map(l=>{var y;const h=new Date(l.lastActive||l.createdAt).getTime(),u=l.isOnline&&Date.now()-h<3e4,x=d===l.id;return n.jsxs(O.Fragment,{children:[n.jsxs("tr",{className:ie("group hover:bg-white/5 transition-colors cursor-pointer",x&&"bg-white/5"),onClick:()=>c(x?null:l.id),children:[n.jsx("td",{className:"py-4 pl-4",children:x?n.jsx(gr,{className:"w-4 h-4 text-blue-500"}):n.jsx(xr,{className:"w-4 h-4 text-slate-600 group-hover:text-blue-500 transition-colors"})}),n.jsx("td",{className:"py-4 text-center px-2",children:u&&n.jsx("div",{className:"flex justify-center items-center",children:n.jsxs("span",{className:"relative flex h-2 w-2",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-green-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"})]})})}),n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-white font-bold text-sm truncate max-w-[120px]",title:l.ip,children:l.user?l.user.name||l.user.email:"Anonymous"}),l.isReturning&&n.jsx("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded bg-green-500/10 text-green-400 border border-green-500/20 uppercase tracking-wide",children:"🔄 Returning"})]}),n.jsx("span",{className:"text-slate-500 text-[10px] font-mono",children:l.ip||"0.0.0.0"})]})}),n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-lg",children:Oe(l.country||"Unknown",l.countryCode)}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-white text-xs",children:l.country||"Unknown"}),n.jsx("span",{className:"text-slate-500 text-[10px]",children:l.city})]})]})}),n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-slate-200 text-xs font-medium truncate max-w-[120px] block",title:l.isp,children:l.isp||"Unknown ISP"}),l.org&&l.org!==l.isp&&n.jsx("span",{className:"text-slate-500 text-[10px] truncate max-w-[120px]",title:l.org,children:l.org})]})}),n.jsx("td",{className:"py-4",children:n.jsx("span",{className:ie("text-[10px] uppercase font-bold px-2 py-0.5 rounded border",(y=l.utmSource)!=null&&y.includes("google")?"text-green-400 border-green-500/20 bg-green-500/10":"text-slate-400 border-slate-500/20 bg-slate-500/10"),children:l.utmSource||"Direct"})}),n.jsx("td",{className:"py-4",children:n.jsx("span",{className:"text-slate-300 text-xs font-mono truncate max-w-[150px] block",title:l.exitPage,children:l.exitPage})}),n.jsx("td",{className:"py-4",children:l.device==="bot"?n.jsxs("div",{className:"flex items-center gap-1.5 text-orange-400 bg-orange-500/10 px-2 py-1 rounded border border-orange-500/20 w-fit",children:[n.jsx(mr,{className:"w-3 h-3"}),n.jsx("span",{className:"text-[10px] uppercase font-bold tracking-wider",children:"Bot"})]}):n.jsx("span",{className:"text-slate-400 text-xs px-2 py-1 bg-white/5 rounded-lg border border-white/5 uppercase font-bold tracking-tighter",children:l.device||"Desktop"})}),n.jsx("td",{className:"py-4",children:n.jsx("span",{className:"text-white text-xs whitespace-nowrap",children:l.browser||"Unknown"})}),n.jsx("td",{className:"py-4",children:n.jsx("span",{className:"text-white text-xs whitespace-nowrap",children:l.os||"Unknown"})}),n.jsx("td",{className:"py-4",children:n.jsxs("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold ${l.pageViewsCount>1?"bg-blue-500/10 text-blue-400":"bg-slate-500/10 text-slate-400"}`,children:[l.pageViewsCount," View",l.pageViewsCount!==1&&"s"]})}),n.jsx("td",{className:"py-4 text-right pr-4",children:n.jsxs("div",{className:"flex flex-col items-end",children:[n.jsx("span",{className:"text-slate-400 text-xs font-medium",children:Ye(l.lastActive||l.createdAt)}),n.jsx("span",{className:"text-slate-500 text-[10px] whitespace-nowrap",children:Pt(l.lastActive||l.createdAt)})]})})]}),x&&n.jsx("tr",{className:"bg-white/[0.02] no-hover",children:n.jsx("td",{colSpan:11,className:"p-0 border-b border-white/5",children:n.jsx(It,{session:l})})})]},l.id)})})]})})]})}function Mt({funnel:i}){return n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsx("div",{children:n.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[n.jsx(xt,{className:"w-5 h-5 text-brand-gold"}),"Conversion Funnel"]})}),n.jsxs("div",{className:"text-right",children:[n.jsxs("span",{className:"text-2xl font-black text-brand-gold",children:[i.overallConversion,"%"]}),n.jsx("p",{className:"text-[10px] text-slate-500 uppercase tracking-widest font-bold",children:"Overall"})]})]}),n.jsx("div",{className:"space-y-3",children:i.steps.map((d,c)=>{const o=i.steps[0].count||1,l=Math.max(d.count/o*100,8),h=i.steps[c+1],u=h?d.count-h.count:0;return n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-white font-medium",children:d.name}),n.jsx("span",{className:"text-slate-400",children:d.count.toLocaleString()})]}),n.jsx("div",{className:"relative h-10 bg-slate-800/50 rounded-lg overflow-hidden",children:n.jsx("div",{className:`h-full rounded-lg transition-all duration-500 flex items-center justify-end pr-3 ${c===0?"bg-blue-500":c===i.steps.length-1?"bg-green-500":"bg-blue-500/60"}`,style:{width:`${l}%`},children:n.jsxs("span",{className:"text-[10px] font-black text-white/90",children:[d.rate,"%"]})})}),h&&u>0&&n.jsxs("div",{className:"flex items-center justify-center text-[10px] text-red-400 py-1",children:[n.jsx(xt,{className:"w-3 h-3 mr-1"}),u.toLocaleString()," dropped (",100-h.rate,"% loss)"]})]},d.name)})})]})}var zt={exports:{}};(function(i){i.exports=d;function d(c){if(!(this instanceof d))return new d(c);this._canvas=c=typeof c=="string"?document.getElementById(c):c,this._ctx=c.getContext("2d"),this._width=c.width,this._height=c.height,this._max=1,this._data=[]}d.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:function(c){return this._data=c,this},max:function(c){return this._max=c,this},add:function(c){return this._data.push(c),this},clear:function(){return this._data=[],this},radius:function(c,o){o=o===void 0?15:o;var l=this._circle=this._createCanvas(),h=l.getContext("2d"),u=this._r=c+o;return l.width=l.height=u*2,h.shadowOffsetX=h.shadowOffsetY=u*2,h.shadowBlur=o,h.shadowColor="black",h.beginPath(),h.arc(-u,-u,c,0,Math.PI*2,!0),h.closePath(),h.fill(),this},resize:function(){this._width=this._canvas.width,this._height=this._canvas.height},gradient:function(c){var o=this._createCanvas(),l=o.getContext("2d"),h=l.createLinearGradient(0,0,0,256);o.width=1,o.height=256;for(var u in c)h.addColorStop(+u,c[u]);return l.fillStyle=h,l.fillRect(0,0,1,256),this._grad=l.getImageData(0,0,1,256).data,this},draw:function(c){this._circle||this.radius(this.defaultRadius),this._grad||this.gradient(this.defaultGradient);var o=this._ctx;o.clearRect(0,0,this._width,this._height);for(var l=0,h=this._data.length,u;l<h;l++)u=this._data[l],o.globalAlpha=Math.max(u[2]/this._max,c===void 0?.05:c),o.drawImage(this._circle,u[0]-this._r,u[1]-this._r);var x=o.getImageData(0,0,this._width,this._height);return this._colorize(x.data,this._grad),o.putImageData(x,0,0),this},_colorize:function(c,o){for(var l=0,h=c.length,u;l<h;l+=4)u=c[l+3]*4,u&&(c[l]=o[u],c[l+1]=o[u+1],c[l+2]=o[u+2])},_createCanvas:function(){return typeof document<"u"?document.createElement("canvas"):new this._canvas.constructor}}})(zt);var an=zt.exports;const on=dt(an);function Dt({path:i,config:d}){var p;const c=O.useRef(null),o=O.useRef(null),[l,h]=O.useState(!0),[u,x]=O.useState(null),[y,D]=O.useState([]),[_,T]=O.useState(2e3);return O.useEffect(()=>{if(!i)return;(async()=>{h(!0),x(null);try{const N=await fetch(`${d.endpoint}/heatmap?path=${encodeURIComponent(i)}`,{headers:{"x-tenant-key":d.apiKey,"x-tenant-secret":d.adminSecret}});if(!N.ok)throw new Error("Failed to fetch heatmap data");const v=await N.json();D(v)}catch(N){x(N.message)}finally{h(!1)}})()},[i,d]),O.useEffect(()=>{const S=setInterval(()=>{var v;const N=document.querySelector('iframe[title="Heatmap Preview"]');if(N&&N.contentWindow)try{const m=((v=N.contentDocument)==null?void 0:v.documentElement.scrollHeight)||2e3;m!==_&&T(m)}catch{T(2500)}},1e3);return()=>clearInterval(S)},[_]),O.useEffect(()=>{var k;if(!c.current||y.length===0||l)return;const S=c.current,N=S.getContext("2d");if(!N)return;N.clearRect(0,0,S.width,S.height);const v=on(S),m=((k=o.current)==null?void 0:k.offsetWidth)||window.innerWidth,b=y.map(R=>[m/2+R.x,R.y,.8]);v.data(b),v.radius(20,15),v.draw()},[y,l,_]),n.jsxs("div",{className:"flex flex-col gap-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[n.jsx(Ve,{className:"w-5 h-5 text-red-500"}),"Page Interaction Heatmap"]}),n.jsxs("p",{className:"text-slate-500 text-sm",children:["Real-time precision mapping for: ",i]})]}),n.jsxs("div",{className:"bg-slate-800 rounded-2xl px-6 py-3 border border-white/5 flex items-center gap-4",children:[n.jsxs("div",{className:"text-right border-r border-white/10 pr-4",children:[n.jsx("span",{className:"text-white font-bold block leading-none",children:y.length}),n.jsx("span",{className:"text-slate-500 text-[10px] uppercase font-bold tracking-wider",children:"Dots"})]}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500"}),n.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"}),n.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500"})]})]})]}),n.jsxs("div",{ref:o,className:"relative bg-slate-900 rounded-[2.5rem] border border-white/5 overflow-hidden min-h-[700px] shadow-2xl",style:{height:`${_}px`},children:[d.siteUrl?n.jsx("iframe",{src:`${d.siteUrl}${i}`,className:"absolute inset-0 w-full h-full border-none opacity-40 pointer-events-none grayscale hover:grayscale-0 transition-all duration-700",title:"Heatmap Preview"}):n.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-slate-900",children:n.jsx("p",{className:"text-slate-500 text-sm",children:"Preview not available (siteUrl not configured)"})}),n.jsx("canvas",{ref:c,width:((p=o.current)==null?void 0:p.offsetWidth)||1200,height:_,className:"absolute inset-0 pointer-events-none z-10"}),l&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-slate-950/50 backdrop-blur-sm z-20",children:n.jsx(mt,{className:"w-8 h-8 text-red-500 animate-spin"})}),u&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-slate-950/50 backdrop-blur-sm z-20",children:n.jsxs("div",{className:"bg-red-500/10 border border-red-500/20 p-6 rounded-2xl flex flex-col items-center gap-3",children:[n.jsx(pr,{className:"w-8 h-8 text-red-500"}),n.jsx("p",{className:"text-white font-medium",children:u})]})}),!l&&y.length===0&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-slate-950/50 backdrop-blur-sm z-20",children:n.jsx("div",{className:"bg-slate-900 border border-white/5 p-8 rounded-3xl text-center",children:n.jsx("p",{className:"text-slate-400",children:"No interaction data found for this page yet."})})})]})]})}function ln({events:i}){return!i||i.length===0?n.jsx("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:n.jsx("div",{className:"text-center py-12",children:n.jsx("p",{className:"text-slate-500 text-sm italic",children:"No events recorded in this timeframe."})})}):n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsx("h2",{className:"text-xl font-bold text-white",children:"Recent Interactions"}),n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-brand-gold/10 border border-brand-gold/20",children:[n.jsx(Le,{className:"w-4 h-4 text-brand-gold"}),n.jsx("span",{className:"text-[10px] font-bold text-brand-gold uppercase tracking-widest",children:"Live Feed"})]})]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-white/5 pb-4",children:[n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Time"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Event"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Category"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"User"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest text-right",children:"Details"})]})}),n.jsx("tbody",{className:"divide-y divide-white/5",children:i.slice(0,7).map(d=>{var l,h,u;let c=Le,o="text-slate-400 bg-slate-500/10";return d.category==="auth"?(c=jr,o="text-purple-400 bg-purple-500/10"):d.category==="investment"?(c=Ie,o="text-brand-gold bg-brand-gold/10"):d.category==="wallet"&&(c=_r,o="text-blue-400 bg-blue-500/10"),n.jsxs("tr",{className:"group hover:bg-white/5 transition-colors",children:[n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-slate-500 text-[10px] font-mono",children:new Date(d.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),n.jsx("span",{className:"text-slate-600 text-[9px]",children:Ye(d.timestamp)})]})}),n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center ${o}`,children:n.jsx(c,{className:"w-4 h-4"})}),n.jsx("span",{className:"text-white font-bold text-sm uppercase tracking-tight",children:(l=d.name)==null?void 0:l.replace(/_/g," ")})]})}),n.jsx("td",{className:"py-4",children:n.jsx("span",{className:`px-2 py-1 rounded-md text-[10px] font-bold uppercase tracking-widest border border-white/5 ${o}`,children:d.category||"General"})}),n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-white text-sm font-medium",children:((h=d.user)==null?void 0:h.name)||"Anonymous User"}),((u=d.user)==null?void 0:u.email)&&n.jsx("span",{className:"text-slate-500 text-xs",children:d.user.email})]})}),n.jsx("td",{className:"py-4 text-right",children:d.metadata&&Object.keys(d.metadata).length>0&&n.jsx("div",{className:"flex flex-wrap justify-end gap-1.5 max-w-md ml-auto",children:Object.entries(d.metadata).slice(0,3).map(([x,y])=>n.jsxs("div",{className:"flex items-center gap-1.5 bg-white/5 px-2 py-1 rounded border border-white/5",children:[n.jsxs("span",{className:"text-[10px] text-slate-500 font-bold uppercase",children:[x,":"]}),n.jsx("span",{className:"text-[10px] text-slate-300 font-mono",children:typeof y=="string"&&y.length>20?y.substring(0,20)+"...":String(y)})]},x))})})]},d.id)})})]})})]})}function cn({config:i,className:d}){var b,k,R,U,H,L;const[c,o]=O.useState("24h"),[l,h]=O.useState("front"),[u,x]=O.useState("users"),[y,D]=O.useState({start:"",end:""}),[_,T]=O.useState(null),{stats:p,funnel:S,heatmapPages:N,loading:v,error:m}=vt(i,c,l,u,c==="custom"?y:void 0);return O.useEffect(()=>{!_&&N.length>0&&T(N[0].path)},[N,_]),!p&&v?n.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px]",children:[n.jsx(mt,{className:"w-10 h-10 animate-spin text-blue-500 mb-4"}),n.jsx("p",{className:"text-slate-400",children:"Loading your analytics data..."})]}):m?n.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] p-8 bg-red-500/10 rounded-3xl border border-red-500/20",children:[n.jsx("p",{className:"text-red-400 font-bold mb-2",children:"Error loading analytics"}),n.jsx("p",{className:"text-red-300 text-sm",children:m})]}):n.jsxs("div",{className:ie("space-y-8 animate-in fade-in duration-500",d),children:[n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-4xl font-bold text-white mb-2 bg-gradient-to-r from-white to-white/60 bg-clip-text text-transparent",children:"Traffic Analytics"}),n.jsx("p",{className:"text-slate-400",children:"Measure visitor behavior and traffic sources in real-time."})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 w-full lg:w-auto",children:[n.jsx("div",{className:"flex bg-slate-900/50 p-1 rounded-xl border border-white/5 backdrop-blur-sm",children:["all","front","investor","admin"].map(j=>n.jsx("button",{onClick:()=>h(j),className:ie("px-4 py-2 rounded-lg text-xs font-bold uppercase tracking-wider transition-all",l===j?"bg-white/10 text-white shadow-lg":"text-slate-500 hover:text-white hover:bg-white/5"),children:j==="all"?"All Pools":j==="front"?"Web":j==="investor"?"Dashboard":"Admin"},j))}),n.jsx("div",{className:"flex bg-slate-900/50 p-1 rounded-xl border border-white/5 backdrop-blur-sm",children:["all","users","bots"].map(j=>n.jsx("button",{onClick:()=>x(j),className:ie("px-4 py-2 rounded-lg text-xs font-bold uppercase tracking-wider transition-all",u===j?j==="bots"?"bg-orange-500/20 text-orange-400 shadow-lg border border-orange-500/20":"bg-white/10 text-white shadow-lg":"text-slate-500 hover:text-white hover:bg-white/5"),children:j==="all"?"All":j==="users"?"Visitors":"Bots"},j))}),n.jsx("div",{className:"flex bg-slate-900/50 p-1 rounded-xl border border-white/5 backdrop-blur-sm",children:["24h","7d","30d","custom"].map(j=>n.jsx("button",{onClick:()=>o(j),className:ie("px-4 py-2 rounded-lg text-sm font-medium transition-all",c===j?"bg-blue-600 text-white shadow-lg shadow-blue-600/20":"text-slate-400 hover:text-white hover:bg-white/5"),children:j==="custom"?"Custom":j.toUpperCase()},j))})]})]}),c==="custom"&&n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-2xl p-6 flex flex-col sm:flex-row items-center gap-4",children:[n.jsx(pt,{className:"w-5 h-5 text-blue-400"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("label",{className:"text-slate-400 text-sm",children:"From:"}),n.jsx("input",{type:"date",value:y.start,onChange:j=>D(P=>({...P,start:j.target.value})),className:"bg-slate-800 border border-white/10 rounded-lg px-3 py-2 text-white text-sm focus:outline-none focus:border-blue-500"})]}),n.jsx(fr,{className:"w-4 h-4 text-slate-500 hidden sm:block"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("label",{className:"text-slate-400 text-sm",children:"To:"}),n.jsx("input",{type:"date",value:y.end,onChange:j=>D(P=>({...P,end:j.target.value})),className:"bg-slate-800 border border-white/10 rounded-lg px-3 py-2 text-white text-sm focus:outline-none focus:border-blue-500"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-6",children:[n.jsx(ke,{label:"Active Now",value:((b=p==null?void 0:p.summary)==null?void 0:b.activeNow)||0,icon:n.jsx(qe,{className:"w-5 h-5"}),color:"green",pulse:!0}),n.jsx(ke,{label:"Total Sessions",value:((k=p==null?void 0:p.summary)==null?void 0:k.sessions)||0,icon:n.jsx(Ve,{className:"w-5 h-5"}),color:"purple"}),n.jsx(ke,{label:"Unique Visitors",value:((R=p==null?void 0:p.summary)==null?void 0:R.uniqueVisitors)||0,icon:n.jsx(qe,{className:"w-5 h-5"}),color:"blue"}),n.jsx(ke,{label:"Page Views",value:((U=p==null?void 0:p.summary)==null?void 0:U.pageViews)||0,icon:n.jsx(Ie,{className:"w-5 h-5"}),color:"orange"}),n.jsx(ke,{label:"Bounce Rate",value:`${((H=p==null?void 0:p.summary)==null?void 0:H.bounceRate)||0}%`,icon:n.jsx(pt,{className:"w-5 h-5"}),color:"red"})]}),n.jsxs("div",{className:"space-y-8",children:[n.jsx(At,{stats:p}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[n.jsx(Et,{pages:(p==null?void 0:p.topPages)||[],totalViews:((L=p==null?void 0:p.summary)==null?void 0:L.pageViews)||1}),n.jsx(Rt,{geo:(p==null?void 0:p.geo)||[],cities:(p==null?void 0:p.cities)||[]})]}),n.jsx(Lt,{sources:(p==null?void 0:p.sources)||[],referrers:(p==null?void 0:p.referrers)||[]}),n.jsx(Ot,{sessions:(p==null?void 0:p.recentSessions)||[]}),n.jsx(ln,{events:(p==null?void 0:p.recentEvents)||[]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(wr,{className:"w-5 h-5 text-blue-400"}),"Device Breakdown"]}),n.jsx("div",{className:"space-y-4",children:["Desktop","Mobile","Tablet"].map(j=>{var G,X,te;const P=((X=(G=p==null?void 0:p.devices)==null?void 0:G.find(z=>{var ne;return((ne=z.device)==null?void 0:ne.toLowerCase())===j.toLowerCase()}))==null?void 0:X.count)||0;return n.jsx(Ke,{label:j,count:P,total:((te=p==null?void 0:p.summary)==null?void 0:te.sessions)||0},j)})})]}),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(ft,{className:"w-5 h-5 text-purple-400"}),"Browser Breakdown"]}),n.jsxs("div",{className:"space-y-4",children:[((p==null?void 0:p.browsers)||[]).slice(0,5).map(j=>{var P;return n.jsx(Ke,{label:j.browser,count:j.count,total:((P=p==null?void 0:p.summary)==null?void 0:P.sessions)||0},j.browser)}),(!(p!=null&&p.browsers)||p.browsers.length===0)&&n.jsx("p",{className:"text-slate-500 text-sm italic",children:"No browser data yet"})]})]}),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(gt,{className:"w-5 h-5 text-green-400"}),"OS Breakdown"]}),n.jsxs("div",{className:"space-y-4",children:[((p==null?void 0:p.os)||[]).slice(0,5).map(j=>{var P;return n.jsx(Ke,{label:j.os,count:j.count,total:((P=p==null?void 0:p.summary)==null?void 0:P.sessions)||0},j.os)}),(!(p!=null&&p.os)||p.os.length===0)&&n.jsx("p",{className:"text-slate-500 text-sm italic",children:"No OS data yet"})]})]})]}),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(Ge,{className:"w-5 h-5 text-yellow-400"}),"Top Networks (ISP)"]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[((p==null?void 0:p.isps)||[]).slice(0,8).map(j=>{var P;return n.jsxs("div",{className:"bg-white/5 p-4 rounded-2xl border border-white/5",children:[n.jsx("p",{className:"text-white font-bold text-sm truncate",title:j.isp,children:j.isp}),n.jsxs("div",{className:"flex justify-between items-center mt-2",children:[n.jsxs("p",{className:"text-slate-500 text-xs",children:[j.count," sessions"]}),n.jsxs("p",{className:"text-blue-400 text-xs font-bold",children:[Math.round(j.count/(((P=p==null?void 0:p.summary)==null?void 0:P.sessions)||1)*100),"%"]})]})]},j.isp)}),(!(p!=null&&p.isps)||p.isps.length===0)&&n.jsx("p",{className:"text-slate-500 text-sm italic col-span-full",children:"No ISP data yet"})]})]}),S&&n.jsx(Mt,{funnel:S}),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(Le,{className:"w-5 h-5 text-red-500"}),"Interaction Heatmaps"]}),N.length>0?n.jsxs("div",{className:"space-y-6",children:[n.jsx("div",{className:"flex flex-wrap gap-2",children:N.map(j=>n.jsxs("button",{onClick:()=>T(j.path),className:ie("px-4 py-2 rounded-xl text-sm font-medium transition-all border",_===j.path?"bg-red-500 text-white border-red-500 shadow-lg shadow-red-500/20":"bg-white/5 text-slate-400 border-white/5 hover:bg-white/10"),children:[j.path,n.jsxs("span",{className:"ml-2 text-xs opacity-60",children:["(",j.count,")"]})]},j.path))}),_&&n.jsx(Dt,{path:_,config:i})]}):n.jsx("div",{className:"text-center py-20 bg-white/5 rounded-3xl border border-dashed border-white/10",children:n.jsx("p",{className:"text-slate-500",children:"No heatmap data captured yet. Ensure you are using the SDK and tracking interactions."})})]})]})]})}function Ke({label:i,count:d,total:c}){const o=c>0?Math.round(d/c*100):0;return n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex justify-between text-xs",children:[n.jsx("span",{className:"text-slate-300 font-medium",children:i}),n.jsxs("span",{className:"text-slate-500",children:[d," (",o,"%)"]})]}),n.jsx("div",{className:"h-1.5 w-full bg-white/5 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-blue-500 rounded-full transition-all duration-500",style:{width:`${o}%`}})})]})}W.AnalyticsDashboard=cn,W.COUNTRY_FLAGS=Tt,W.ConversionFunnel=Mt,W.GeoDistribution=Rt,W.HeatmapVisualizer=Dt,W.RealtimeMonitor=At,W.RecentVisitors=Ot,W.SessionTimeline=It,W.StatCard=ke,W.TopPages=Et,W.TrafficSources=Lt,W.cn=ie,W.formatNumber=sn,W.formatRelativeTime=Ye,W.formatVisitorDate=Pt,W.getFlag=Oe,W.useAnalyticsData=vt,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
|
|
146
|
+
`,children:o.type==="page_view"?n.jsx(Oe,{className:"w-3 h-3 text-white"}):n.jsx(Te,{className:"w-3 h-3 text-slate-900"})}),n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:`text-sm font-bold tracking-tight ${o.type==="page_view"?"text-white":"text-yellow-500"}`,children:o.type==="page_view"?o.path:((h=o.name)==null?void 0:h.replace(/_/g," "))||"Interaction"}),n.jsx("span",{className:"text-[10px] text-slate-500 font-mono bg-white/5 px-1.5 py-0.5 rounded",children:new Date(o.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[o.type==="page_view"&&o.duration&&n.jsxs("span",{className:"text-[10px] text-slate-500 flex items-center gap-1 bg-white/5 px-1.5 py-0.5 rounded",children:["⏱️ ",o.duration,"s duration"]}),o.type==="event"&&n.jsxs("span",{className:"text-[10px] text-yellow-500/60 uppercase font-bold tracking-tighter",children:["Triggered ",o.category||"interaction"]})]}),o.metadata&&Object.keys(o.metadata).length>0&&n.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:Object.entries(o.metadata).map(([u,b])=>u!=="path"&&n.jsxs("span",{className:"text-[9px] bg-white/5 px-2 py-0.5 rounded border border-white/5 text-slate-500 font-medium whitespace-nowrap",children:[n.jsxs("span",{className:"text-slate-600 mr-1",children:[u,":"]}),typeof b=="object"?JSON.stringify(b):String(b)]},u))})]})]},l)}),n.jsxs("div",{className:"relative pl-10 group mt-4",children:[n.jsx("div",{className:"absolute left-0 top-0 w-6 h-6 rounded-full border-2 border-slate-900 bg-red-500/20 z-10 flex items-center justify-center",children:n.jsx(yr,{className:"w-3 h-3 text-red-500"})}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-sm font-bold text-red-400",children:"Exit / Last Activity"}),n.jsx("span",{className:"text-[10px] text-slate-600 bg-red-500/5 px-2 py-0.5 rounded font-mono",children:new Date(i.lastActive).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),n.jsxs("span",{className:"text-[10px] text-slate-500 italic",children:["User left site from: ",n.jsx("span",{className:"text-slate-400 font-bold not-italic ml-1",children:((c=d[d.length-1])==null?void 0:c.path)||"Unknown page"})]})]})]})]})]})}function Ot({sessions:i}){const[d,c]=O.useState(null),[,o]=O.useState(0);return O.useEffect(()=>{const l=setInterval(()=>o(h=>h+1),3e4);return()=>clearInterval(l)},[]),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(qe,{className:"w-5 h-5 text-green-400"}),"Recent Visitors"]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-white/5 pb-4",children:[n.jsx("th",{className:"pb-4 w-10"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest text-center px-2",children:"Live"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Visitor / IP"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Location"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"ISP"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Source"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Exit Page"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Device"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Browser"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"OS"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Views"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest px-2 text-right",children:"Last Activity"})]})}),n.jsx("tbody",{className:"divide-y divide-white/5",children:i.slice(0,7).map(l=>{var w;const h=new Date(l.lastActive||l.createdAt).getTime(),u=l.isOnline&&Date.now()-h<3e4,b=d===l.id;return n.jsxs(O.Fragment,{children:[n.jsxs("tr",{className:ne("group hover:bg-white/5 transition-colors cursor-pointer",b&&"bg-white/5"),onClick:()=>c(b?null:l.id),children:[n.jsx("td",{className:"py-4 pl-4",children:b?n.jsx(mr,{className:"w-4 h-4 text-blue-500"}):n.jsx(gr,{className:"w-4 h-4 text-slate-600 group-hover:text-blue-500 transition-colors"})}),n.jsx("td",{className:"py-4 text-center px-2",children:u&&n.jsx("div",{className:"flex justify-center items-center",children:n.jsxs("span",{className:"relative flex h-2 w-2",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-green-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"})]})})}),n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-white font-bold text-sm truncate max-w-[120px]",title:l.ip,children:l.user?l.user.name||l.user.email:"Anonymous"}),l.isReturning&&n.jsx("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded bg-green-500/10 text-green-400 border border-green-500/20 uppercase tracking-wide",children:"🔄 Returning"})]}),n.jsx("span",{className:"text-slate-500 text-[10px] font-mono",children:l.ip||"0.0.0.0"})]})}),n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-lg",children:Me(l.country||"Unknown",l.countryCode)}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-white text-xs",children:l.country||"Unknown"}),n.jsx("span",{className:"text-slate-500 text-[10px]",children:l.city})]})]})}),n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-slate-200 text-xs font-medium truncate max-w-[120px] block",title:l.isp,children:l.isp||"Unknown ISP"}),l.org&&l.org!==l.isp&&n.jsx("span",{className:"text-slate-500 text-[10px] truncate max-w-[120px]",title:l.org,children:l.org})]})}),n.jsx("td",{className:"py-4",children:n.jsx("span",{className:ne("text-[10px] uppercase font-bold px-2 py-0.5 rounded border",(w=l.utmSource)!=null&&w.includes("google")?"text-green-400 border-green-500/20 bg-green-500/10":"text-slate-400 border-slate-500/20 bg-slate-500/10"),children:l.utmSource||"Direct"})}),n.jsx("td",{className:"py-4",children:n.jsx("span",{className:"text-slate-300 text-xs font-mono truncate max-w-[150px] block",title:l.exitPage,children:l.exitPage})}),n.jsx("td",{className:"py-4",children:l.device==="bot"?n.jsxs("div",{className:"flex items-center gap-1.5 text-orange-400 bg-orange-500/10 px-2 py-1 rounded border border-orange-500/20 w-fit",children:[n.jsx(fr,{className:"w-3 h-3"}),n.jsx("span",{className:"text-[10px] uppercase font-bold tracking-wider",children:"Bot"})]}):n.jsx("span",{className:"text-slate-400 text-xs px-2 py-1 bg-white/5 rounded-lg border border-white/5 uppercase font-bold tracking-tighter",children:l.device||"Desktop"})}),n.jsx("td",{className:"py-4",children:n.jsx("span",{className:"text-white text-xs whitespace-nowrap",children:l.browser||"Unknown"})}),n.jsx("td",{className:"py-4",children:n.jsx("span",{className:"text-white text-xs whitespace-nowrap",children:l.os||"Unknown"})}),n.jsx("td",{className:"py-4",children:n.jsxs("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold ${l.pageViewsCount>1?"bg-blue-500/10 text-blue-400":"bg-slate-500/10 text-slate-400"}`,children:[l.pageViewsCount," View",l.pageViewsCount!==1&&"s"]})}),n.jsx("td",{className:"py-4 text-right pr-4",children:n.jsxs("div",{className:"flex flex-col items-end",children:[n.jsx("span",{className:"text-slate-400 text-xs font-medium",children:Ye(l.lastActive||l.createdAt)}),n.jsx("span",{className:"text-slate-500 text-[10px] whitespace-nowrap",children:Pt(l.lastActive||l.createdAt)})]})})]}),b&&n.jsx("tr",{className:"bg-white/[0.02] no-hover",children:n.jsx("td",{colSpan:11,className:"p-0 border-b border-white/5",children:n.jsx(It,{session:l})})})]},l.id)})})]})})]})}function Mt({funnel:i}){return n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsx("div",{children:n.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[n.jsx(xt,{className:"w-5 h-5 text-brand-gold"}),"Conversion Funnel"]})}),n.jsxs("div",{className:"text-right",children:[n.jsxs("span",{className:"text-2xl font-black text-brand-gold",children:[i.overallConversion,"%"]}),n.jsx("p",{className:"text-[10px] text-slate-500 uppercase tracking-widest font-bold",children:"Overall"})]})]}),n.jsx("div",{className:"space-y-3",children:i.steps.map((d,c)=>{const o=i.steps[0].count||1,l=Math.max(d.count/o*100,8),h=i.steps[c+1],u=h?d.count-h.count:0;return n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-white font-medium",children:d.name}),n.jsx("span",{className:"text-slate-400",children:d.count.toLocaleString()})]}),n.jsx("div",{className:"relative h-10 bg-slate-800/50 rounded-lg overflow-hidden",children:n.jsx("div",{className:`h-full rounded-lg transition-all duration-500 flex items-center justify-end pr-3 ${c===0?"bg-blue-500":c===i.steps.length-1?"bg-green-500":"bg-blue-500/60"}`,style:{width:`${l}%`},children:n.jsxs("span",{className:"text-[10px] font-black text-white/90",children:[d.rate,"%"]})})}),h&&u>0&&n.jsxs("div",{className:"flex items-center justify-center text-[10px] text-red-400 py-1",children:[n.jsx(xt,{className:"w-3 h-3 mr-1"}),u.toLocaleString()," dropped (",100-h.rate,"% loss)"]})]},d.name)})})]})}var zt={exports:{}};(function(i){i.exports=d;function d(c){if(!(this instanceof d))return new d(c);this._canvas=c=typeof c=="string"?document.getElementById(c):c,this._ctx=c.getContext("2d"),this._width=c.width,this._height=c.height,this._max=1,this._data=[]}d.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:function(c){return this._data=c,this},max:function(c){return this._max=c,this},add:function(c){return this._data.push(c),this},clear:function(){return this._data=[],this},radius:function(c,o){o=o===void 0?15:o;var l=this._circle=this._createCanvas(),h=l.getContext("2d"),u=this._r=c+o;return l.width=l.height=u*2,h.shadowOffsetX=h.shadowOffsetY=u*2,h.shadowBlur=o,h.shadowColor="black",h.beginPath(),h.arc(-u,-u,c,0,Math.PI*2,!0),h.closePath(),h.fill(),this},resize:function(){this._width=this._canvas.width,this._height=this._canvas.height},gradient:function(c){var o=this._createCanvas(),l=o.getContext("2d"),h=l.createLinearGradient(0,0,0,256);o.width=1,o.height=256;for(var u in c)h.addColorStop(+u,c[u]);return l.fillStyle=h,l.fillRect(0,0,1,256),this._grad=l.getImageData(0,0,1,256).data,this},draw:function(c){this._circle||this.radius(this.defaultRadius),this._grad||this.gradient(this.defaultGradient);var o=this._ctx;o.clearRect(0,0,this._width,this._height);for(var l=0,h=this._data.length,u;l<h;l++)u=this._data[l],o.globalAlpha=Math.max(u[2]/this._max,c===void 0?.05:c),o.drawImage(this._circle,u[0]-this._r,u[1]-this._r);var b=o.getImageData(0,0,this._width,this._height);return this._colorize(b.data,this._grad),o.putImageData(b,0,0),this},_colorize:function(c,o){for(var l=0,h=c.length,u;l<h;l+=4)u=c[l+3]*4,u&&(c[l]=o[u],c[l+1]=o[u+1],c[l+2]=o[u+2])},_createCanvas:function(){return typeof document<"u"?document.createElement("canvas"):new this._canvas.constructor}}})(zt);var an=zt.exports;const on=dt(an);function Dt({path:i,config:d,startDate:c,endDate:o,deviceType:l}){const h=O.useRef(null),u=O.useRef(null),[b,w]=O.useState(!0),[D,N]=O.useState(!0),[C,p]=O.useState(null),[k,T]=O.useState([]),[y,m]=O.useState(2500);return O.useEffect(()=>{if(!i)return;(async()=>{w(!0),p(null);try{let _=`${d.endpoint}/heatmap?path=${encodeURIComponent(i)}`;c&&(_+=`&startDate=${c}`),o&&(_+=`&endDate=${o}`),l&&l!=="all"&&(_+=`&deviceType=${l}`);const P=await fetch(_,{headers:{"x-tenant-key":d.apiKey,"x-tenant-secret":d.adminSecret}});if(!P.ok)throw new Error("Failed to fetch heatmap data");const E=await P.json();T(E)}catch(_){p(_.message)}finally{w(!1)}})()},[i,d,c,o,l]),O.useEffect(()=>{const x=setInterval(()=>{var P;const _=document.querySelector('iframe[title="Heatmap Preview"]');if(_&&_.contentWindow)try{const E=((P=_.contentDocument)==null?void 0:P.documentElement.scrollHeight)||0;E>0&&Math.abs(E-y)>100&&m(E)}catch{}},2e3);return()=>clearInterval(x)},[y]),O.useEffect(()=>{var L;if(!h.current||k.length===0||b)return;const x=h.current,_=x.getContext("2d");if(!_)return;const P=((L=u.current)==null?void 0:L.offsetWidth)||1200;x.width=P,x.height=y,_.clearRect(0,0,x.width,x.height);const E=on(x),H=k.map(j=>[P/2+j.x,j.y,.8]);E.data(H),E.radius(18,12),E.draw()},[k,b,y]),n.jsxs("div",{className:"flex flex-col gap-6",children:[n.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[n.jsxs("div",{children:[n.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 bg-red-500/10 rounded-xl flex items-center justify-center border border-red-500/20",children:n.jsx(Oe,{className:"w-6 h-6 text-red-500"})}),"Interaction Analysis"]}),n.jsxs("p",{className:"text-slate-500 text-sm mt-1",children:["Displaying hotspots for ",n.jsx("code",{className:"text-slate-300 font-mono",children:i})]})]}),n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsxs("div",{className:"flex flex-col items-end",children:[n.jsx("span",{className:"text-slate-500 text-[10px] uppercase font-bold tracking-widest mb-1",children:"Confidence"}),n.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(x=>n.jsx("div",{className:`w-3 h-1 rounded-full ${k.length>x*10?"bg-red-500":"bg-slate-800"}`},x))})]}),n.jsxs("div",{className:"bg-slate-800/80 border border-white/5 px-6 py-3 rounded-2xl flex items-center gap-4 backdrop-blur-md",children:[n.jsxs("div",{className:"text-right border-r border-white/10 pr-4",children:[n.jsx("span",{className:"text-white text-xl font-bold block leading-none",children:k.length.toLocaleString()}),n.jsx("span",{className:"text-slate-500 text-[10px] uppercase font-bold tracking-widest",children:"Events"})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-blue-500 shadow-[0_0_8px_rgba(59,130,246,0.5)]"}),n.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-green-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"}),n.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"})]})]})]})]}),n.jsxs("div",{ref:u,className:"relative bg-[#0a0a0b] rounded-[3rem] border border-white/5 overflow-hidden shadow-2xl transition-all duration-500",style:{height:`${y}px`,minHeight:"800px"},children:[d.siteUrl?n.jsx("iframe",{src:`${d.siteUrl}${i}`,className:ne("absolute inset-0 w-full h-full border-none transition-all duration-1000","opacity-40 grayscale pointer-events-none hover:opacity-60",D?"scale-95 blur-xl":"scale-100 blur-0"),onLoad:()=>N(!1),title:"Heatmap Preview"}):n.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-slate-900 gap-4",children:[n.jsx("div",{className:"p-4 bg-slate-800 rounded-full",children:n.jsx(pt,{className:"w-8 h-8 text-slate-500"})}),n.jsx("p",{className:"text-slate-400 text-sm",children:"Site Preview URL not configured"})]}),n.jsx("canvas",{ref:h,className:"absolute inset-0 pointer-events-none z-10"}),(b||D)&&n.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-slate-950/40 backdrop-blur-xl z-20",children:[n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"w-16 h-16 border-4 border-red-500/20 border-t-red-500 rounded-full animate-spin"}),n.jsx(Oe,{className:"w-6 h-6 text-red-500 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 animate-pulse"})]}),n.jsxs("div",{className:"mt-8 text-center",children:[n.jsx("p",{className:"text-white font-bold tracking-tight",children:"Synchronizing Interaction Layers"}),n.jsx("p",{className:"text-slate-500 text-xs mt-1",children:"Analyzing visitor behavior patterns..."})]})]}),C&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-slate-950/80 backdrop-blur-sm z-30 p-10",children:n.jsxs("div",{className:"bg-red-500/5 border border-red-500/20 p-8 rounded-[2.5rem] flex flex-col items-center gap-4 text-center max-w-md",children:[n.jsx("div",{className:"w-12 h-12 bg-red-500 rounded-2xl flex items-center justify-center shadow-lg shadow-red-500/20",children:n.jsx(pt,{className:"w-6 h-6 text-white"})}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-white font-bold text-lg",children:"Analysis Interrupted"}),n.jsx("p",{className:"text-slate-400 text-sm mt-1",children:C})]}),n.jsx("button",{onClick:()=>window.location.reload(),className:"mt-2 px-6 py-2 bg-white text-black font-bold rounded-xl hover:bg-slate-200 transition-all",children:"Retry Analysis"})]})}),!b&&k.length===0&&n.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-slate-950/20 backdrop-blur-sm z-20",children:n.jsxs("div",{className:"bg-slate-900/90 border border-white/10 p-12 rounded-[3.5rem] text-center shadow-2xl backdrop-blur-2xl",children:[n.jsx("div",{className:"w-20 h-20 bg-slate-800 rounded-3xl flex items-center justify-center mx-auto mb-6 border border-white/5",children:n.jsx(Te,{className:"w-10 h-10 text-slate-500"})}),n.jsx("h3",{className:"text-white font-bold text-xl mb-2",children:"No High-Intensity Spots"}),n.jsx("p",{className:"text-slate-500 text-sm max-w-xs mx-auto",children:"We haven't detected significant interaction clusters for this page in the selected timeframe."})]})})]})]})}function ln({events:i}){return!i||i.length===0?n.jsx("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:n.jsx("div",{className:"text-center py-12",children:n.jsx("p",{className:"text-slate-500 text-sm italic",children:"No events recorded in this timeframe."})})}):n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsx("h2",{className:"text-xl font-bold text-white",children:"Recent Interactions"}),n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-brand-gold/10 border border-brand-gold/20",children:[n.jsx(Te,{className:"w-4 h-4 text-brand-gold"}),n.jsx("span",{className:"text-[10px] font-bold text-brand-gold uppercase tracking-widest",children:"Live Feed"})]})]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-white/5 pb-4",children:[n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Time"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Event"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Category"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest",children:"User"}),n.jsx("th",{className:"pb-4 text-xs font-bold text-slate-500 uppercase tracking-widest text-right",children:"Details"})]})}),n.jsx("tbody",{className:"divide-y divide-white/5",children:i.slice(0,7).map(d=>{var l,h,u;let c=Te,o="text-slate-400 bg-slate-500/10";return d.category==="auth"?(c=jr,o="text-purple-400 bg-purple-500/10"):d.category==="investment"?(c=Ie,o="text-brand-gold bg-brand-gold/10"):d.category==="wallet"&&(c=_r,o="text-blue-400 bg-blue-500/10"),n.jsxs("tr",{className:"group hover:bg-white/5 transition-colors",children:[n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-slate-500 text-[10px] font-mono",children:new Date(d.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),n.jsx("span",{className:"text-slate-600 text-[9px]",children:Ye(d.timestamp)})]})}),n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center ${o}`,children:n.jsx(c,{className:"w-4 h-4"})}),n.jsx("span",{className:"text-white font-bold text-sm uppercase tracking-tight",children:(l=d.name)==null?void 0:l.replace(/_/g," ")})]})}),n.jsx("td",{className:"py-4",children:n.jsx("span",{className:`px-2 py-1 rounded-md text-[10px] font-bold uppercase tracking-widest border border-white/5 ${o}`,children:d.category||"General"})}),n.jsx("td",{className:"py-4",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-white text-sm font-medium",children:((h=d.user)==null?void 0:h.name)||"Anonymous User"}),((u=d.user)==null?void 0:u.email)&&n.jsx("span",{className:"text-slate-500 text-xs",children:d.user.email})]})}),n.jsx("td",{className:"py-4 text-right",children:d.metadata&&Object.keys(d.metadata).length>0&&n.jsx("div",{className:"flex flex-wrap justify-end gap-1.5 max-w-md ml-auto",children:Object.entries(d.metadata).slice(0,3).map(([b,w])=>n.jsxs("div",{className:"flex items-center gap-1.5 bg-white/5 px-2 py-1 rounded border border-white/5",children:[n.jsxs("span",{className:"text-[10px] text-slate-500 font-bold uppercase",children:[b,":"]}),n.jsx("span",{className:"text-[10px] text-slate-300 font-mono",children:typeof w=="string"&&w.length>20?w.substring(0,20)+"...":String(w)})]},b))})})]},d.id)})})]})})]})}function cn({config:i,className:d}){var x,_,P,E,H,L;const[c,o]=O.useState("24h"),[l,h]=O.useState("front"),[u,b]=O.useState("users"),[w,D]=O.useState({start:"",end:""}),[N,C]=O.useState(null),{stats:p,funnel:k,heatmapPages:T,loading:y,error:m}=vt(i,c,l,u,c==="custom"?w:void 0);return O.useEffect(()=>{!N&&T.length>0&&C(T[0].path)},[T,N]),!p&&y?n.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px]",children:[n.jsx(wr,{className:"w-10 h-10 animate-spin text-blue-500 mb-4"}),n.jsx("p",{className:"text-slate-400",children:"Loading your analytics data..."})]}):m?n.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] p-8 bg-red-500/10 rounded-3xl border border-red-500/20",children:[n.jsx("p",{className:"text-red-400 font-bold mb-2",children:"Error loading analytics"}),n.jsx("p",{className:"text-red-300 text-sm",children:m})]}):n.jsxs("div",{className:ne("space-y-8 animate-in fade-in duration-500",d),children:[n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-4xl font-bold text-white mb-2 bg-gradient-to-r from-white to-white/60 bg-clip-text text-transparent",children:"Traffic Analytics"}),n.jsx("p",{className:"text-slate-400",children:"Measure visitor behavior and traffic sources in real-time."})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 w-full lg:w-auto",children:[n.jsx("div",{className:"flex bg-slate-900/50 p-1 rounded-xl border border-white/5 backdrop-blur-sm",children:["all","front","investor","admin"].map(j=>n.jsx("button",{onClick:()=>h(j),className:ne("px-4 py-2 rounded-lg text-xs font-bold uppercase tracking-wider transition-all",l===j?"bg-white/10 text-white shadow-lg":"text-slate-500 hover:text-white hover:bg-white/5"),children:j==="all"?"All Pools":j==="front"?"Web":j==="investor"?"Dashboard":"Admin"},j))}),n.jsx("div",{className:"flex bg-slate-900/50 p-1 rounded-xl border border-white/5 backdrop-blur-sm",children:["all","users","bots"].map(j=>n.jsx("button",{onClick:()=>b(j),className:ne("px-4 py-2 rounded-lg text-xs font-bold uppercase tracking-wider transition-all",u===j?j==="bots"?"bg-orange-500/20 text-orange-400 shadow-lg border border-orange-500/20":"bg-white/10 text-white shadow-lg":"text-slate-500 hover:text-white hover:bg-white/5"),children:j==="all"?"All":j==="users"?"Visitors":"Bots"},j))}),n.jsx("div",{className:"flex bg-slate-900/50 p-1 rounded-xl border border-white/5 backdrop-blur-sm",children:["24h","7d","30d","custom"].map(j=>n.jsx("button",{onClick:()=>o(j),className:ne("px-4 py-2 rounded-lg text-sm font-medium transition-all",c===j?"bg-blue-600 text-white shadow-lg shadow-blue-600/20":"text-slate-400 hover:text-white hover:bg-white/5"),children:j==="custom"?"Custom":j.toUpperCase()},j))})]})]}),c==="custom"&&n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-2xl p-6 flex flex-col sm:flex-row items-center gap-4",children:[n.jsx(ft,{className:"w-5 h-5 text-blue-400"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("label",{className:"text-slate-400 text-sm",children:"From:"}),n.jsx("input",{type:"date",value:w.start,onChange:j=>D(A=>({...A,start:j.target.value})),className:"bg-slate-800 border border-white/10 rounded-lg px-3 py-2 text-white text-sm focus:outline-none focus:border-blue-500"})]}),n.jsx(pr,{className:"w-4 h-4 text-slate-500 hidden sm:block"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("label",{className:"text-slate-400 text-sm",children:"To:"}),n.jsx("input",{type:"date",value:w.end,onChange:j=>D(A=>({...A,end:j.target.value})),className:"bg-slate-800 border border-white/10 rounded-lg px-3 py-2 text-white text-sm focus:outline-none focus:border-blue-500"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-6",children:[n.jsx(Ne,{label:"Active Now",value:((x=p==null?void 0:p.summary)==null?void 0:x.activeNow)||0,icon:n.jsx(qe,{className:"w-5 h-5"}),color:"green",pulse:!0}),n.jsx(Ne,{label:"Total Sessions",value:((_=p==null?void 0:p.summary)==null?void 0:_.sessions)||0,icon:n.jsx(Oe,{className:"w-5 h-5"}),color:"purple"}),n.jsx(Ne,{label:"Unique Visitors",value:((P=p==null?void 0:p.summary)==null?void 0:P.uniqueVisitors)||0,icon:n.jsx(qe,{className:"w-5 h-5"}),color:"blue"}),n.jsx(Ne,{label:"Page Views",value:((E=p==null?void 0:p.summary)==null?void 0:E.pageViews)||0,icon:n.jsx(Ie,{className:"w-5 h-5"}),color:"orange"}),n.jsx(Ne,{label:"Bounce Rate",value:`${((H=p==null?void 0:p.summary)==null?void 0:H.bounceRate)||0}%`,icon:n.jsx(ft,{className:"w-5 h-5"}),color:"red"})]}),n.jsxs("div",{className:"space-y-8",children:[n.jsx(At,{stats:p}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[n.jsx(Et,{pages:(p==null?void 0:p.topPages)||[],totalViews:((L=p==null?void 0:p.summary)==null?void 0:L.pageViews)||1}),n.jsx(Rt,{geo:(p==null?void 0:p.geo)||[],cities:(p==null?void 0:p.cities)||[]})]}),n.jsx(Lt,{sources:(p==null?void 0:p.sources)||[],referrers:(p==null?void 0:p.referrers)||[]}),n.jsx(Ot,{sessions:(p==null?void 0:p.recentSessions)||[]}),n.jsx(ln,{events:(p==null?void 0:p.recentEvents)||[]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(vr,{className:"w-5 h-5 text-blue-400"}),"Device Breakdown"]}),n.jsx("div",{className:"space-y-4",children:["Desktop","Mobile","Tablet"].map(j=>{var G,X,te;const A=((X=(G=p==null?void 0:p.devices)==null?void 0:G.find(U=>{var se;return((se=U.device)==null?void 0:se.toLowerCase())===j.toLowerCase()}))==null?void 0:X.count)||0;return n.jsx(Ke,{label:j,count:A,total:((te=p==null?void 0:p.summary)==null?void 0:te.sessions)||0},j)})})]}),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(mt,{className:"w-5 h-5 text-purple-400"}),"Browser Breakdown"]}),n.jsxs("div",{className:"space-y-4",children:[((p==null?void 0:p.browsers)||[]).slice(0,5).map(j=>{var A;return n.jsx(Ke,{label:j.browser,count:j.count,total:((A=p==null?void 0:p.summary)==null?void 0:A.sessions)||0},j.browser)}),(!(p!=null&&p.browsers)||p.browsers.length===0)&&n.jsx("p",{className:"text-slate-500 text-sm italic",children:"No browser data yet"})]})]}),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(gt,{className:"w-5 h-5 text-green-400"}),"OS Breakdown"]}),n.jsxs("div",{className:"space-y-4",children:[((p==null?void 0:p.os)||[]).slice(0,5).map(j=>{var A;return n.jsx(Ke,{label:j.os,count:j.count,total:((A=p==null?void 0:p.summary)==null?void 0:A.sessions)||0},j.os)}),(!(p!=null&&p.os)||p.os.length===0)&&n.jsx("p",{className:"text-slate-500 text-sm italic",children:"No OS data yet"})]})]})]}),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(Ve,{className:"w-5 h-5 text-yellow-400"}),"Top Networks (ISP)"]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[((p==null?void 0:p.isps)||[]).slice(0,8).map(j=>{var A;return n.jsxs("div",{className:"bg-white/5 p-4 rounded-2xl border border-white/5",children:[n.jsx("p",{className:"text-white font-bold text-sm truncate",title:j.isp,children:j.isp}),n.jsxs("div",{className:"flex justify-between items-center mt-2",children:[n.jsxs("p",{className:"text-slate-500 text-xs",children:[j.count," sessions"]}),n.jsxs("p",{className:"text-blue-400 text-xs font-bold",children:[Math.round(j.count/(((A=p==null?void 0:p.summary)==null?void 0:A.sessions)||1)*100),"%"]})]})]},j.isp)}),(!(p!=null&&p.isps)||p.isps.length===0)&&n.jsx("p",{className:"text-slate-500 text-sm italic col-span-full",children:"No ISP data yet"})]})]}),k&&n.jsx(Mt,{funnel:k}),n.jsxs("div",{className:"bg-slate-900/50 border border-white/5 rounded-3xl p-8 backdrop-blur-xl",children:[n.jsxs("h2",{className:"text-xl font-bold text-white mb-8 flex items-center gap-2",children:[n.jsx(Te,{className:"w-5 h-5 text-red-500"}),"Interaction Heatmaps"]}),T.length>0?n.jsxs("div",{className:"space-y-6",children:[n.jsx("div",{className:"flex flex-wrap gap-2",children:T.map(j=>n.jsxs("button",{onClick:()=>C(j.path),className:ne("px-4 py-2 rounded-xl text-sm font-medium transition-all border",N===j.path?"bg-red-500 text-white border-red-500 shadow-lg shadow-red-500/20":"bg-white/5 text-slate-400 border-white/5 hover:bg-white/10"),children:[j.path,n.jsxs("span",{className:"ml-2 text-xs opacity-60",children:["(",j.count,")"]})]},j.path))}),N&&n.jsx(Dt,{path:N,config:i,startDate:c==="custom"?w.start:void 0,endDate:c==="custom"?w.end:void 0})]}):n.jsx("div",{className:"text-center py-20 bg-white/5 rounded-3xl border border-dashed border-white/10",children:n.jsx("p",{className:"text-slate-500",children:"No heatmap data captured yet. Ensure you are using the SDK and tracking interactions."})})]})]})]})}function Ke({label:i,count:d,total:c}){const o=c>0?Math.round(d/c*100):0;return n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex justify-between text-xs",children:[n.jsx("span",{className:"text-slate-300 font-medium",children:i}),n.jsxs("span",{className:"text-slate-500",children:[d," (",o,"%)"]})]}),n.jsx("div",{className:"h-1.5 w-full bg-white/5 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-blue-500 rounded-full transition-all duration-500",style:{width:`${o}%`}})})]})}W.AnalyticsDashboard=cn,W.COUNTRY_FLAGS=Tt,W.ConversionFunnel=Mt,W.GeoDistribution=Rt,W.HeatmapVisualizer=Dt,W.RealtimeMonitor=At,W.RecentVisitors=Ot,W.SessionTimeline=It,W.StatCard=Ne,W.TopPages=Et,W.TrafficSources=Lt,W.cn=ne,W.formatNumber=sn,W.formatRelativeTime=Ye,W.formatVisitorDate=Pt,W.getFlag=Me,W.useAnalyticsData=vt,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
|