dishub-analytics.dashboard 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(q,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],M):(q=typeof globalThis<"u"?globalThis:q||self,M(q.DishubAnalyticsDashboard={},q.React))})(this,function(q,M){"use strict";function ct(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Be={exports:{}},Ne={};/**
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 Fe={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 dt;function lr(){if(dt)return Ne;dt=1;var a=Symbol.for("react.transitional.element"),d=Symbol.for("react.fragment");function c(o,l,u){var h=null;if(u!==void 0&&(h=""+u),l.key!==void 0&&(h=""+l.key),"key"in l){u={};for(var b in l)b!=="key"&&(u[b]=l[b])}else u=l;return l=u.ref,{$$typeof:a,type:o,key:h,ref:l!==void 0?l:null,props:u}}return Ne.Fragment=d,Ne.jsx=c,Ne.jsxs=c,Ne}var Ce={};/**
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 x in l)x!=="key"&&(h[x]=l[x])}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,133 +14,133 @@
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 cr(){return ut||(ut=1,process.env.NODE_ENV!=="production"&&function(){function a(g){if(g==null)return null;if(typeof g=="function")return g.$$typeof===ge?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 B:return"Suspense";case J:return"SuspenseList";case ee: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 j:return"Portal";case y:return g.displayName||"Context";case P:return(g._context.displayName||"Context")+".Consumer";case A:var E=g.render;return g=g.displayName,g||(g=E.displayName||E.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case H:return E=g.displayName||null,E!==null?E:a(g.type)||"Memo";case G:E=g._payload,g=g._init;try{return a(g(E))}catch{}}return null}function d(g){return""+g}function c(g){try{d(g);var E=!1}catch{E=!0}if(E){E=console;var V=E.error,Y=typeof Symbol=="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object";return V.call(E,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Y),d(g)}}function o(g){if(g===m)return"<>";if(typeof g=="object"&&g!==null&&g.$$typeof===G)return"<...>";try{var E=a(g);return E?"<"+E+">":"<...>"}catch{return"<...>"}}function l(){var g=z.A;return g===null?null:g.getOwner()}function u(){return Error("react-stack-top-frame")}function h(g){if(ie.call(g,"key")){var E=Object.getOwnPropertyDescriptor(g,"key").get;if(E&&E.isReactWarning)return!1}return g.key!==void 0}function b(g,E){function V(){oe||(oe=!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)",E))}V.isReactWarning=!0,Object.defineProperty(g,"key",{get:V,configurable:!0})}function w(){var g=a(this.type);return be[g]||(be[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 O(g,E,V,Y,$,Q){var K=V.ref;return g={$$typeof:T,type:g,key:E,props:V,_owner:Y},(K!==void 0?K: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:Q}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g}function p(g,E,V,Y,$,Q){var K=E.children;if(K!==void 0)if(Y)if(pe(K)){for(Y=0;Y<K.length;Y++)C(K[Y]);Object.freeze&&Object.freeze(K)}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(K);if(ie.call(E,"key")){K=a(g);var le=Object.keys(E).filter(function(Oe){return Oe!=="key"});Y=0<le.length?"{key: someKey, "+le.join(": ..., ")+": ...}":"{key: someKey}",xe[K+Y]||(le=0<le.length?"{"+le.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
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 k:return"Profiler";case b: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 v:return"Portal";case U:return g.displayName||"Context";case R:return(g._context.displayName||"Context")+".Consumer";case H:var A=g.render;return g=g.displayName,g||(g=A.displayName||A.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case P:return A=g.displayName||null,A!==null?A:i(g.type)||"Memo";case G:A=g._payload,g=g._init;try{return i(g(A))}catch{}}return null}function d(g){return""+g}function c(g){try{d(g);var A=!1}catch{A=!0}if(A){A=console;var q=A.error,K=typeof Symbol=="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object";return q.call(A,"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 A=i(g);return A?"<"+A+">":"<...>"}catch{return"<...>"}}function l(){var g=z.A;return g===null?null:g.getOwner()}function h(){return Error("react-stack-top-frame")}function u(g){if(ne.call(g,"key")){var A=Object.getOwnPropertyDescriptor(g,"key").get;if(A&&A.isReactWarning)return!1}return g.key!==void 0}function x(g,A){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)",A))}q.isReactWarning=!0,Object.defineProperty(g,"key",{get:q,configurable:!0})}function y(){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,A,q,K,$,ee){var Z=q.ref;return g={$$typeof:N,type:g,key:A,props:q,_owner:K},(Z!==void 0?Z:null)!==null?Object.defineProperty(g,"ref",{enumerable:!1,get:y}):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 _(g,A,q,K,$,ee){var Z=A.children;if(Z!==void 0)if(K)if(fe(Z)){for(K=0;K<Z.length;K++)T(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 T(Z);if(ne.call(A,"key")){Z=i(g);var ce=Object.keys(A).filter(function(Me){return Me!=="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} />`,Y,K,le,K),xe[K+Y]=!0)}if(K=null,V!==void 0&&(c(V),K=""+V),h(E)&&(c(E.key),K=""+E.key),"key"in E){V={};for(var re in E)re!=="key"&&(V[re]=E[re])}else V=E;return K&&b(V,typeof g=="function"?g.displayName||g.name||"Unknown":g),O(g,K,V,l(),$,Q)}function C(g){k(g)?g._store&&(g._store.validated=1):typeof g=="object"&&g!==null&&g.$$typeof===G&&(g._payload.status==="fulfilled"?k(g._payload.value)&&g._payload.value._store&&(g._payload.value._store.validated=1):g._store&&(g._store.validated=1))}function k(g){return typeof g=="object"&&g!==null&&g.$$typeof===T}var S=M,T=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),y=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),ge=Symbol.for("react.client.reference"),z=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=Object.prototype.hasOwnProperty,pe=Array.isArray,fe=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(g){return g()}};var oe,be={},me=S.react_stack_bottom_frame.bind(S,u)(),se=fe(o(u)),xe={};Ce.Fragment=m,Ce.jsx=function(g,E,V){var Y=1e4>z.recentlyCreatedOwnerStacks++;return p(g,E,V,!1,Y?Error("react-stack-top-frame"):me,Y?fe(o(g)):se)},Ce.jsxs=function(g,E,V){var Y=1e4>z.recentlyCreatedOwnerStacks++;return p(g,E,V,!0,Y?Error("react-stack-top-frame"):me,Y?fe(o(g)):se)}}()),Ce}process.env.NODE_ENV==="production"?Be.exports=lr():Be.exports=cr();var n=Be.exports;/**
22
+ <%s key={someKey} {...props} />`,K,Z,ce,Z),be[Z+K]=!0)}if(Z=null,q!==void 0&&(c(q),Z=""+q),u(A)&&(c(A.key),Z=""+A.key),"key"in A){q={};for(var se in A)se!=="key"&&(q[se]=A[se])}else q=A;return Z&&x(q,typeof g=="function"?g.displayName||g.name||"Unknown":g),D(g,Z,q,l(),$,ee)}function T(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===N}var S=O,N=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),U=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),te=Symbol.for("react.client.reference"),z=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=Object.prototype.hasOwnProperty,fe=Array.isArray,me=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(g){return g()}};var le,xe={},ge=S.react_stack_bottom_frame.bind(S,h)(),ae=me(o(h)),be={};Ce.Fragment=m,Ce.jsx=function(g,A,q){var K=1e4>z.recentlyCreatedOwnerStacks++;return _(g,A,q,!1,K?Error("react-stack-top-frame"):ge,K?me(o(g)):ae)},Ce.jsxs=function(g,A,q){var K=1e4>z.recentlyCreatedOwnerStacks++;return _(g,A,q,!0,K?Error("react-stack-top-frame"):ge,K?me(o(g)):ae)}}()),Ce}process.env.NODE_ENV==="production"?Fe.exports=cr():Fe.exports=dr();var n=Fe.exports;/**
23
23
  * @license lucide-react v0.344.0 - ISC
24
24
  *
25
25
  * This source code is licensed under the ISC license.
26
26
  * See the LICENSE file in the root directory of this source tree.
27
- */var dr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
27
+ */var hr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
28
28
  * @license lucide-react v0.344.0 - ISC
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=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),X=(a,d)=>{const c=M.forwardRef(({color:o="currentColor",size:l=24,strokeWidth:u=2,absoluteStrokeWidth:h,className:b="",children:w,...O},p)=>M.createElement("svg",{ref:p,...dr,width:l,height:l,stroke:o,strokeWidth:h?Number(u)*24/Number(l):u,className:["lucide",`lucide-${ur(a)}`,b].join(" "),...O},[...d.map(([C,k])=>M.createElement(C,k)),...Array.isArray(w)?w:[w]]));return c.displayName=`${a}`,c};/**
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:x="",children:y,...D},_)=>O.createElement("svg",{ref:_,...hr,width:l,height:l,stroke:o,strokeWidth:u?Number(h)*24/Number(l):h,className:["lucide",`lucide-${ur(i)}`,x].join(" "),...D},[...d.map(([T,p])=>O.createElement(T,p)),...Array.isArray(y)?y:[y]]));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 Fe=X("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/**
37
+ */const Le=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 hr=X("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"}]]);/**
42
+ */const pr=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 pr=X("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
47
+ */const fr=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.
51
51
  * See the LICENSE file in the root directory of this source tree.
52
- */const Le=X("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
52
+ */const Ie=Y("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
53
53
  * @license lucide-react v0.344.0 - ISC
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 fr=X("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"}]]);/**
57
+ */const mr=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 ht=X("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"}]]);/**
62
+ */const pt=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 mr=X("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
67
+ */const gr=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 gr=X("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
72
+ */const xr=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 pt=X("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"}]]);/**
77
+ */const ft=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 br=X("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"}]]);/**
82
+ */const br=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 Ge=X("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"}]]);/**
87
+ */const Ge=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 xr=X("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"}]]);/**
92
+ */const vr=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 vr=X("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"}]]);/**
97
+ */const wr=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 ft=X("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
102
+ */const mt=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.
106
106
  * See the LICENSE file in the root directory of this source tree.
107
- */const wr=X("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
107
+ */const yr=Y("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
108
108
  * @license lucide-react v0.344.0 - ISC
109
109
  *
110
110
  * This source code is licensed under the ISC license.
111
111
  * See the LICENSE file in the root directory of this source tree.
112
- */const mt=X("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
112
+ */const gt=Y("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
113
113
  * @license lucide-react v0.344.0 - ISC
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 gt=X("MousePointer2",[["path",{d:"m4 4 7.07 17 2.51-7.39L21 11.07z",key:"1vqm48"}]]);/**
117
+ */const Ve=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.
121
121
  * See the LICENSE file in the root directory of this source tree.
122
- */const yr=X("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
122
+ */const jr=Y("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
123
123
  * @license lucide-react v0.344.0 - ISC
124
124
  *
125
125
  * This source code is licensed under the ISC license.
126
126
  * See the LICENSE file in the root directory of this source tree.
127
- */const bt=X("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
127
+ */const xt=Y("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
128
128
  * @license lucide-react v0.344.0 - ISC
129
129
  *
130
130
  * This source code is licensed under the ISC license.
131
131
  * See the LICENSE file in the root directory of this source tree.
132
- */const Ve=X("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
132
+ */const qe=Y("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
133
133
  * @license lucide-react v0.344.0 - ISC
134
134
  *
135
135
  * This source code is licensed under the ISC license.
136
136
  * See the LICENSE file in the root directory of this source tree.
137
- */const jr=X("Wallet",[["path",{d:"M21 12V7H5a2 2 0 0 1 0-4h14v4",key:"195gfw"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h16v-5",key:"195n9w"}],["path",{d:"M18 12a2 2 0 0 0 0 4h4v-4Z",key:"vllfpd"}]]);var xt={exports:{}};/*!
137
+ */const _r=Y("Wallet",[["path",{d:"M21 12V7H5a2 2 0 0 1 0-4h14v4",key:"195gfw"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h16v-5",key:"195n9w"}],["path",{d:"M18 12a2 2 0 0 0 0 4h4v-4Z",key:"vllfpd"}]]);var bt={exports:{}};/*!
138
138
  * Pusher JavaScript Library v8.4.0
139
139
  * https://pusher.com/
140
140
  *
141
141
  * Copyright 2020, Pusher
142
142
  * Released under the MIT licence.
143
- */(function(a,d){(function(o,l){a.exports=l()})(window,function(){return function(c){var o={};function l(u){if(o[u])return o[u].exports;var h=o[u]={i:u,l:!1,exports:{}};return c[u].call(h.exports,h,h.exports,l),h.l=!0,h.exports}return l.m=c,l.c=o,l.d=function(u,h,b){l.o(u,h)||Object.defineProperty(u,h,{enumerable:!0,get:b})},l.r=function(u){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},l.t=function(u,h){if(h&1&&(u=l(u)),h&8||h&4&&typeof u=="object"&&u&&u.__esModule)return u;var b=Object.create(null);if(l.r(b),Object.defineProperty(b,"default",{enumerable:!0,value:u}),h&2&&typeof u!="string")for(var w in u)l.d(b,w,(function(O){return u[O]}).bind(null,w));return b},l.n=function(u){var h=u&&u.__esModule?function(){return u.default}:function(){return u};return l.d(h,"a",h),h},l.o=function(u,h){return Object.prototype.hasOwnProperty.call(u,h)},l.p="",l(l.s=2)}([function(c,o,l){var u=this&&this.__extends||function(){var j=function(m,x){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,P){_.__proto__=P}||function(_,P){for(var y in P)P.hasOwnProperty(y)&&(_[y]=P[y])},j(m,x)};return function(m,x){j(m,x);function _(){this.constructor=m}m.prototype=x===null?Object.create(x):(_.prototype=x.prototype,new _)}}();Object.defineProperty(o,"__esModule",{value:!0});var h=256,b=function(){function j(m){m===void 0&&(m="="),this._paddingCharacter=m}return j.prototype.encodedLength=function(m){return this._paddingCharacter?(m+2)/3*4|0:(m*8+5)/6|0},j.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 y=m.length-_;if(y>0){var P=m[_]<<16|(y===2?m[_+1]<<8:0);x+=this._encodeByte(P>>>3*6&63),x+=this._encodeByte(P>>>2*6&63),y===2?x+=this._encodeByte(P>>>1*6&63):x+=this._paddingCharacter||"",x+=this._paddingCharacter||""}return x},j.prototype.maxDecodedLength=function(m){return this._paddingCharacter?m/4*3|0:(m*6+7)/8|0},j.prototype.decodedLength=function(m){return this.maxDecodedLength(m.length-this._getPaddingLength(m))},j.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(_)),y=0,A=0,B=0,J=0,H=0,G=0,ee=0;A<_-4;A+=4)J=this._decodeChar(m.charCodeAt(A+0)),H=this._decodeChar(m.charCodeAt(A+1)),G=this._decodeChar(m.charCodeAt(A+2)),ee=this._decodeChar(m.charCodeAt(A+3)),P[y++]=J<<2|H>>>4,P[y++]=H<<4|G>>>2,P[y++]=G<<6|ee,B|=J&h,B|=H&h,B|=G&h,B|=ee&h;if(A<_-1&&(J=this._decodeChar(m.charCodeAt(A)),H=this._decodeChar(m.charCodeAt(A+1)),P[y++]=J<<2|H>>>4,B|=J&h,B|=H&h),A<_-2&&(G=this._decodeChar(m.charCodeAt(A+2)),P[y++]=H<<4|G>>>2,B|=G&h),A<_-3&&(ee=this._decodeChar(m.charCodeAt(A+3)),P[y++]=G<<6|ee,B|=ee&h),B!==0)throw new Error("Base64Coder: incorrect characters for decoding");return P},j.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)},j.prototype._decodeChar=function(m){var x=h;return x+=(42-m&m-44)>>>8&-h+m-43+62,x+=(46-m&m-48)>>>8&-h+m-47+63,x+=(47-m&m-58)>>>8&-h+m-48+52,x+=(64-m&m-91)>>>8&-h+m-65+0,x+=(96-m&m-123)>>>8&-h+m-97+26,x},j.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},j}();o.Coder=b;var w=new b;function O(j){return w.encode(j)}o.encode=O;function p(j){return w.decode(j)}o.decode=p;var C=function(j){u(m,j);function m(){return j!==null&&j.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 _=h;return _+=(44-x&x-46)>>>8&-h+x-45+62,_+=(94-x&x-96)>>>8&-h+x-95+63,_+=(47-x&x-58)>>>8&-h+x-48+52,_+=(64-x&x-91)>>>8&-h+x-65+0,_+=(96-x&x-123)>>>8&-h+x-97+26,_},m}(b);o.URLSafeCoder=C;var k=new C;function S(j){return k.encode(j)}o.encodeURLSafe=S;function T(j){return k.decode(j)}o.decodeURLSafe=T,o.encodedLength=function(j){return w.encodedLength(j)},o.maxDecodedLength=function(j){return w.maxDecodedLength(j)},o.decodedLength=function(j){return w.decodedLength(j)}},function(c,o,l){Object.defineProperty(o,"__esModule",{value:!0});var u="utf8: invalid string",h="utf8: invalid source encoding";function b(p){for(var C=new Uint8Array(w(p)),k=0,S=0;S<p.length;S++){var T=p.charCodeAt(S);T<128?C[k++]=T:T<2048?(C[k++]=192|T>>6,C[k++]=128|T&63):T<55296?(C[k++]=224|T>>12,C[k++]=128|T>>6&63,C[k++]=128|T&63):(S++,T=(T&1023)<<10,T|=p.charCodeAt(S)&1023,T+=65536,C[k++]=240|T>>18,C[k++]=128|T>>12&63,C[k++]=128|T>>6&63,C[k++]=128|T&63)}return C}o.encode=b;function w(p){for(var C=0,k=0;k<p.length;k++){var S=p.charCodeAt(k);if(S<128)C+=1;else if(S<2048)C+=2;else if(S<55296)C+=3;else if(S<=57343){if(k>=p.length-1)throw new Error(u);k++,C+=4}else throw new Error(u)}return C}o.encodedLength=w;function O(p){for(var C=[],k=0;k<p.length;k++){var S=p[k];if(S&128){var T=void 0;if(S<224){if(k>=p.length)throw new Error(h);var j=p[++k];if((j&192)!==128)throw new Error(h);S=(S&31)<<6|j&63,T=128}else if(S<240){if(k>=p.length-1)throw new Error(h);var j=p[++k],m=p[++k];if((j&192)!==128||(m&192)!==128)throw new Error(h);S=(S&15)<<12|(j&63)<<6|m&63,T=2048}else if(S<248){if(k>=p.length-2)throw new Error(h);var j=p[++k],m=p[++k],x=p[++k];if((j&192)!==128||(m&192)!==128||(x&192)!==128)throw new Error(h);S=(S&15)<<18|(j&63)<<12|(m&63)<<6|x&63,T=65536}else throw new Error(h);if(S<T||S>=55296&&S<=57343)throw new Error(h);if(S>=65536){if(S>1114111)throw new Error(h);S-=65536,C.push(String.fromCharCode(55296|S>>10)),S=56320|S&1023}}C.push(String.fromCharCode(S))}return C.join("")}o.decode=O},function(c,o,l){c.exports=l(3).default},function(c,o,l){l.r(o);class u{constructor(e,t){this.lastId=0,this.prefix=e,this.name=t}create(e){this.lastId++;var t=this.lastId,s=this.prefix+t,i=this.name+"["+t+"]",f=!1,v=function(){f||(e.apply(null,arguments),f=!0)};return this[t]=v,{number:t,id:s,name:i,callback:v}}remove(e){delete this[e.number]}}var h=new u("_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 O{constructor(e){this.options=e,this.receivers=e.receivers||h,this.loading={}}load(e,t,s){var i=this;if(i.loading[e]&&i.loading[e].length>0)i.loading[e].push(s);else{i.loading[e]=[s];var f=L.createScriptRequest(i.getPath(e,t)),v=i.receivers.create(function(N){if(i.receivers.remove(v),i.loading[e]){var R=i.loading[e];delete i.loading[e];for(var D=function(Z){Z||f.cleanup()},U=0;U<R.length;U++)R[U](N,D)}});f.send(v)}}getRoot(e){var t,s=L.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 p=new u("_pusher_dependencies","Pusher.DependenciesReceivers"),C=new O({cdn_http:w.cdn_http,cdn_https:w.cdn_https,version:w.VERSION,suffix:w.dependency_suffix,receivers:p});const k={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=k.urls[r];if(!t)return"";let s;return t.fullUrl?s=t.fullUrl:t.path&&(s=k.baseUrl+t.path),s?`${e} ${s}`:""}},j;(function(r){r.UserAuthentication="user-authentication",r.ChannelAuthorization="channel-authorization"})(j||(j={}));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 y extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class A 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 J extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class H extends Error{constructor(e,t){super(t),this.status=e,Object.setPrototypeOf(this,new.target.prototype)}}var ee=function(r,e,t,s,i){const f=L.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 N=t.headersProvider();for(var v in N)f.setRequestHeader(v,N[v])}return f.onreadystatechange=function(){if(f.readyState===4)if(f.status===200){let N,R=!1;try{N=JSON.parse(f.responseText),R=!0}catch{i(new H(200,`JSON returned from ${s.toString()} endpoint was invalid, yet status code was 200. Data was: ${f.responseText}`),null)}R&&i(null,N)}else{let N="";switch(s){case j.UserAuthentication:N=T.buildLogSuffix("authenticationEndpoint");break;case j.ChannelAuthorization:N=`Clients must be authorized to join private or presence channels. ${T.buildLogSuffix("authorizationEndpoint")}`;break}i(new H(f.status,`Unable to retrieve auth string from ${s.toString()} endpoint - received status: ${f.status} from ${t.endpoint}. ${N}`),null)}},f.send(e),f};function ge(r){return be(fe(r))}var z=String.fromCharCode,ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe=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)},fe=function(r){return r.replace(/[^\x00-\x7F]/g,pe)},oe=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=[ie.charAt(t>>>18),ie.charAt(t>>>12&63),e>=2?"=":ie.charAt(t>>>6&63),e>=1?"=":ie.charAt(t&63)];return s.join("")},be=window.btoa||function(r){return r.replace(/[\s\S]{1,3}/g,oe)};class me{constructor(e,t,s,i){this.clear=t,this.timer=e(()=>{this.timer&&(this.timer=i(this.timer))},s)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var se=me;function xe(r){window.clearTimeout(r)}function g(r){window.clearInterval(r)}class E extends se{constructor(e,t){super(setTimeout,xe,e,function(s){return t(),null})}}class V extends se{constructor(e,t){super(setInterval,g,e,function(s){return t(),s})}}var Y={now(){return Date.now?Date.now():new Date().valueOf()},defer(r){return new E(0,r)},method(r,...e){var t=Array.prototype.slice.call(arguments,1);return function(s){return s[r].apply(s,t.concat(arguments))}}},$=Y;function Q(r,...e){for(var t=0;t<e.length;t++){var s=e[t];for(var i in s)s[i]&&s[i].constructor&&s[i].constructor===Object?r[i]=Q(r[i]||{},s[i]):r[i]=s[i]}return r}function K(){for(var r=["Pusher"],e=0;e<arguments.length;e++)typeof arguments[e]=="string"?r.push(arguments[e]):r.push(Me(arguments[e]));return r.join(" : ")}function le(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,i=r.length;s<i;s++)if(r[s]===e)return s;return-1}function re(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&e(r[t],t,r)}function Oe(r){var e=[];return re(r,function(t,s){e.push(s)}),e}function dn(r){var e=[];return re(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 Dt(r,e){for(var t=[],s=0;s<r.length;s++)t.push(e(r[s],s,r,t));return t}function un(r,e){var t={};return re(r,function(s,i){t[i]=e(s)}),t}function Ut(r,e){e=e||function(i){return!!i};for(var t=[],s=0;s<r.length;s++)e(r[s],s,r,t)&&t.push(r[s]);return t}function Ht(r,e){var t={};return re(r,function(s,i){(e&&e(s,i,r,t)||s)&&(t[i]=s)}),t}function hn(r){var e=[];return re(r,function(t,s){e.push([s,t])}),e}function Bt(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 un(r,function(e){return typeof e=="object"&&(e=Me(e)),encodeURIComponent(ge(e.toString()))})}function mn(r){var e=Ht(r,function(s){return s!==void 0}),t=Dt(hn(fn(e)),$.method("join","=")).join("&");return t}function gn(r){var e=[],t=[];return function s(i,f){var v,N,R;switch(typeof i){case"object":if(!i)return null;for(v=0;v<e.length;v+=1)if(e[v]===i)return{$ref:t[v]};if(e.push(i),t.push(f),Object.prototype.toString.apply(i)==="[object Array]")for(R=[],v=0;v<i.length;v+=1)R[v]=s(i[v],f+"["+v+"]");else{R={};for(N in i)Object.prototype.hasOwnProperty.call(i,N)&&(R[N]=s(i[N],f+"["+JSON.stringify(N)+"]"))}return R;case"number":case"string":case"boolean":return i}}(r,"$")}function Me(r){try{return JSON.stringify(r)}catch{return JSON.stringify(gn(r))}}class bn{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=K.apply(this,arguments);at.log?at.log(s):at.logToConsole&&e.bind(this)(s)}}var W=new bn,xn=function(r,e,t,s,i){(t.headers!==void 0||t.headersProvider!=null)&&W.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(),N=v.createElement("script");r.auth_callbacks[f]=function(U){i(null,U)};var R="Pusher.auth_callbacks['"+f+"']";N.src=t.endpoint+"?callback="+encodeURIComponent(R)+"&"+e;var D=v.getElementsByTagName("head")[0]||v.documentElement;D.insertBefore(N,D.firstChild)},vn=xn;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 i=document.getElementsByTagName("head")[0];i.insertBefore(t.script,i.firstChild),t.errorScript&&i.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=L.createScriptRequest(s),this.request.send(e)}}cleanup(){this.request&&this.request.cleanup()}}var jn=function(r,e){return function(t,s){var i="http"+(e?"s":"")+"://",f=i+(r.host||r.options.host)+r.options.path,v=L.createJSONPRequest(f,t),N=L.ScriptReceivers.create(function(R,D){h.remove(N),v.cleanup(),D&&D.host&&(r.host=D.host),s&&s(R,D)});v.send(N)}},_n={name:"jsonp",getAgent:jn},kn=_n;function $e(r,e,t){var s=r+(e.useTLS?"s":""),i=e.useTLS?e.hostTLS:e.hostNonTLS;return s+"://"+i+t}function Ke(r,e){var t="/app/"+r,s="?protocol="+w.PROTOCOL+"&client=js&version="+w.VERSION+(e?"&"+e:"");return t+s}var Sn={getInitial:function(r,e){var t=(e.httpPath||"")+Ke(r,"flash=false");return $e("ws",e,t)}},Nn={getInitial:function(r,e){var t=(e.httpPath||"/pusher")+Ke(r);return $e("http",e,t)}},Cn={getInitial:function(r,e){return $e("http",e,e.httpPath||"/pusher")},getPath:function(r,e){return Ke(r)}};class Tn{constructor(){this._callbacks={}}get(e){return this._callbacks[Ze(e)]}add(e,t,s){var i=Ze(e);this._callbacks[i]=this._callbacks[i]||[],this._callbacks[i].push({fn:t,context:s})}remove(e,t,s){if(!e&&!t&&!s){this._callbacks={};return}var i=e?[Ze(e)]:Oe(this._callbacks);t||s?this.removeCallback(i,t,s):this.removeAllCallbacks(i)}removeCallback(e,t,s){Ae(e,function(i){this._callbacks[i]=Ut(this._callbacks[i]||[],function(f){return t&&t!==f.fn||s&&s!==f.context}),this._callbacks[i].length===0&&delete this._callbacks[i]},this)}removeAllCallbacks(e){Ae(e,function(t){delete this._callbacks[t]},this)}}function Ze(r){return"_"+r}class ce{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=Ut(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 i=0;i<this.global_callbacks.length;i++)this.global_callbacks[i](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 i=0;i<f.length;i++)f[i].fn.apply(f[i].context||window,v);else this.failThrough&&this.failThrough(e,t);return this}}class Pn extends ce{constructor(e,t,s,i,f){super(),this.initialize=L.transportConnectionInitializer,this.hooks=e,this.name=t,this.priority=s,this.key=i,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(),W.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 Q({cid:this.id},e)}}class Se{constructor(e){this.hooks=e}isSupported(e){return this.hooks.isSupported(e)}createConnection(e,t,s,i){return new Pn(this.hooks,e,t,s,i)}}var An=new Se({urls:Sn,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!L.getWebSocketAPI()},isSupported:function(){return!!L.getWebSocketAPI()},getSocket:function(r){return L.createWebSocket(r)}}),Ft={urls:Nn,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},Gt=Q({getSocket:function(r){return L.HTTPFactory.createStreamingSocket(r)}},Ft),Vt=Q({getSocket:function(r){return L.HTTPFactory.createPollingSocket(r)}},Ft),qt={isSupported:function(){return L.isXHRSupported()}},En=new Se(Q({},Gt,qt)),Rn=new Se(Q({},Vt,qt)),Ln={ws:An,xhr_streaming:En,xhr_polling:Rn},ze=Ln,In=new Se({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}))}}),Wt={isSupported:function(r){var e=L.isXDRSupported(r.useTLS);return e}},On=new Se(Q({},Gt,Wt)),Mn=new Se(Q({},Vt,Wt));ze.xdr_streaming=On,ze.xdr_polling=Mn,ze.sockjs=In;var zn=ze;class Dn extends ce{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,i){i=Q({},i,{activityTimeout:this.pingDelay});var f=this.transport.createConnection(e,t,s,i),v=null,N=function(){f.unbind("open",N),f.bind("closed",R),v=$.now()},R=D=>{if(f.unbind("closed",R),D.code===1002||D.code===1003)this.manager.reportDeath();else if(!D.wasClean&&v){var U=$.now()-v;U<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(U/2,this.minPingDelay))}};return f.bind("open",N),f}isSupported(e){return this.manager.isAlive()&&this.transport.isSupported(e)}}const Jt={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(i){throw{type:"MessageParseError",error:i,data:r.data}}},encodeMessage:function(r){return JSON.stringify(r)},processHandshake:function(r){var e=Jt.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=Jt;class Bn extends ce{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 i={event:e,data:t};return s&&(i.channel=s),W.debug("Event sent",i),this.send(ve.encodeMessage(i))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var e={message:s=>{var i;try{i=ve.decodeMessage(s)}catch(f){this.emit("error",{type:"MessageParseError",error:f,data:s.data})}if(i!==void 0){switch(W.debug("Event recd",i),i.event){case"pusher:error":this.emit("error",{type:"PusherError",data:i.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",i)}},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=()=>{re(e,(s,i)=>{this.transport.unbind(i,s)})};re(e,(s,i)=>{this.transport.bind(i,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(Q({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(L.TimelineTransport.getAgent(this,e),t)}}class Qe extends ce{constructor(e,t){super(function(s,i){W.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");W.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 i={};this.emit(t,s,i)}}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,W.error(e.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:e.message},e instanceof H?{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 et extends Qe{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){re(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 i(f){return f instanceof t?f:new t(function(v){v(f)})}return new(t||(t=Promise))(function(f,v){function N(U){try{D(s.next(U))}catch(Z){v(Z)}}function R(U){try{D(s.throw(U))}catch(Z){v(Z)}}function D(U){U.done?f(U.value):i(U.value).then(N,R)}D((s=s.apply(r,e||[])).next())})};class Wn extends et{constructor(e,t){super(e,t),this.members=new Vn}authorize(e,t){super.authorize(e,(s,i)=>qn(this,void 0,void 0,function*(){if(!s)if(i=i,i.channel_data!=null){var f=JSON.parse(i.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");W.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,i)}))}handleEvent(e){var t=e.event;if(t.indexOf("pusher_internal:")===0)this.handleInternalEvent(e);else{var s=e.data,i={};e.user_id&&(i.user_id=e.user_id),this.emit(t,s,i)}}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 i=this.members.addMember(s);this.emit("pusher:member_added",i);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),tt=l(0);class Xn extends et{constructor(e,t,s){super(e,t),this.key=null,this.nacl=s}authorize(e,t){super.authorize(e,(s,i)=>{if(s){t(s,i);return}let f=i.shared_secret;if(!f){t(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(tt.decode)(f),delete i.shared_secret,t(null,i)})}trigger(e,t){throw new A("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){W.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!t.ciphertext||!t.nonce){W.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+t);return}let s=Object(tt.decode)(t.ciphertext);if(s.length<this.nacl.secretbox.overheadLength){W.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${s.length}`);return}let i=Object(tt.decode)(t.nonce);if(i.length<this.nacl.secretbox.nonceLength){W.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${i.length}`);return}let f=this.nacl.secretbox.open(s,i,this.key);if(f===null){W.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,N)=>{if(v){W.error(`Failed to make a request to the authEndpoint: ${N}. Unable to fetch new key, so dropping encrypted event`);return}if(f=this.nacl.secretbox.open(s,i,this.key),f===null){W.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 ce{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=L.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 E(e||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new E(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new E(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 E(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(e){return Q({},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 Q({},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 i=e;i==="connected"&&(i+=" with new socket ID "+t.socket_id),W.debug("State changed",s+" -> "+i),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 $n{constructor(){this.channels={}}add(e,t){return this.channels[e]||(this.channels[e]=Kn(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(){re(this.channels,function(e){e.disconnect()})}}function Kn(r,e){if(r.indexOf("private-encrypted-")===0){if(e.config.nacl)return de.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 A(`${t}. ${s}`)}else{if(r.indexOf("private-")===0)return de.createPrivateChannel(r,e);if(r.indexOf("presence-")===0)return de.createPresenceChannel(r,e);if(r.indexOf("#")===0)throw new x('Cannot create a channel with name "'+r+'".');return de.createChannel(r,e)}}var Zn={createChannels(){return new $n},createConnectionManager(r,e){return new Yn(r,e)},createChannel(r,e){return new Qe(r,e)},createPrivateChannel(r,e){return new et(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)}},de=Zn;class Xt{constructor(e){this.options=e||{},this.livesLeft=this.options.lives||1/0}getAssistant(e){return de.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 Bt(this.strategies,$.method("isSupported"))}connect(e,t){var s=this.strategies,i=0,f=this.timeout,v=null,N=(R,D)=>{D?t(null,D):(i=i+1,this.loop&&(i=i%s.length),i<s.length?(f&&(f=f*2,this.timeoutLimit&&(f=Math.min(f,this.timeoutLimit))),v=this.tryStrategy(s[i],e,{timeout:f,failFast:this.failFast},N)):t(!0))};return v=this.tryStrategy(s[i],e,{timeout:f,failFast:this.failFast},N),{abort:function(){v.abort()},forceMinPriority:function(R){e=R,v&&v.forceMinPriority(R)}}}tryStrategy(e,t,s,i){var f=null,v=null;return s.timeout>0&&(f=new E(s.timeout,function(){v.abort(),i(!0)})),v=e.connect(t,function(N,R){N&&f&&f.isRunning()&&!s.failFast||(f&&f.ensureAborted(),i(N,R))}),{abort:function(){f&&f.ensureAborted(),v.abort()},forceMinPriority:function(N){v.forceMinPriority(N)}}}}class rt{constructor(e){this.strategies=e}isSupported(){return Bt(this.strategies,$.method("isSupported"))}connect(e,t){return Qn(this.strategies,e,function(s,i){return function(f,v){if(i[s].error=f,f){es(i)&&t(!0);return}Ae(i,function(N){N.forceMinPriority(v.transport.priority)}),t(null,v)}})}}function Qn(r,e,t){var s=Dt(r,function(i,f,v,N){return i.connect(e,t(f,N))});return{abort:function(){Ae(s,ts)},forceMinPriority:function(i){Ae(s,function(f){f.forceMinPriority(i)})}}}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,i=ns(s),f=i&&i.cacheSkipCount?i.cacheSkipCount:0,v=[this.strategy];if(i&&i.timestamp+this.ttl>=$.now()){var N=this.transports[i.transport];N&&(["ws","wss"].includes(i.transport)||f>3?(this.timeline.info({cached:!0,transport:i.transport,latency:i.latency}),v.push(new we([N],{timeout:i.latency*2+1e3,failFast:!0}))):f++)}var R=$.now(),D=v.pop().connect(e,function U(Z,He){Z?(Yt(s),v.length>0?(R=$.now(),D=v.pop().connect(e,U)):t(Z)):(ss(s,He.transport.name,$.now()-R,f),t(null,He))});return{abort:function(){D.abort()},forceMinPriority:function(U){e=U,D&&D.forceMinPriority(U)}}}}function nt(r){return"pusherTransport"+(r?"TLS":"NonTLS")}function ns(r){var e=L.getLocalStorage();if(e)try{var t=e[nt(r)];if(t)return JSON.parse(t)}catch{Yt(r)}return null}function ss(r,e,t,s){var i=L.getLocalStorage();if(i)try{i[nt(r)]=Me({timestamp:$.now(),transport:e,latency:t,cacheSkipCount:s})}catch{}}function Yt(r){var e=L.getLocalStorage();if(e)try{delete e[nt(r)]}catch{}}class De{constructor(e,{delay:t}){this.strategy=e,this.options={delay:t}}isSupported(){return this.strategy.isSupported()}connect(e,t){var s=this.strategy,i,f=new E(this.options.delay,function(){i=s.connect(e,t)});return{abort:function(){f.ensureAborted(),i&&i.abort()},forceMinPriority:function(v){e=v,i&&i.forceMinPriority(v)}}}}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(i,f){f&&s.abort(),t(i,f)});return s}}function Re(r){return function(){return r.isSupported()}}var as=function(r,e,t){var s={};function i(ar,ii,ai,oi,li){var or=t(r,ar,ii,ai,oi,li);return s[ar]=or,or}var f=Object.assign({},e,{hostNonTLS:r.wsHost+":"+r.wsPort,hostTLS:r.wsHost+":"+r.wssPort,httpPath:r.wsPath}),v=Object.assign({},f,{useTLS:!0}),N=Object.assign({},e,{hostNonTLS:r.httpHost+":"+r.httpPort,hostTLS:r.httpHost+":"+r.httpsPort,httpPath:r.httpPath}),R={loop:!0,timeout:15e3,timeoutLimit:6e4},D=new Xt({minPingDelay:1e4,maxPingDelay:r.activityTimeout}),U=new Xt({lives:2,minPingDelay:1e4,maxPingDelay:r.activityTimeout}),Z=i("ws","ws",3,f,D),He=i("wss","ws",3,v,D),ei=i("sockjs","sockjs",1,N),er=i("xhr_streaming","xhr_streaming",1,N,U),ti=i("xdr_streaming","xdr_streaming",1,N,U),tr=i("xhr_polling","xhr_polling",1,N),ri=i("xdr_polling","xdr_polling",1,N),rr=new we([Z],R),ni=new we([He],R),si=new we([ei],R),nr=new we([new Ee(Re(er),er,ti)],R),sr=new we([new Ee(Re(tr),tr,ri)],R),ir=new we([new Ee(Re(nr),new rt([nr,new De(sr,{delay:4e3})]),sr)],R),ot=new Ee(Re(ir),ir,si),lt;return e.useTLS?lt=new rt([rr,new De(ot,{delay:2e3})]):lt=new rt([rr,new De(ni,{delay:2e3}),new De(ot,{delay:5e3})]),new rs(new is(new Ee(Re(Z),lt,ot)),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 us=256*1024;class hs extends ce{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()},L.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&&(L.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>us}}var st;(function(r){r[r.CONNECTING=0]="CONNECTING",r[r.OPEN=1]="OPEN",r[r.CLOSED=3]="CLOSED"})(st||(st={}));var ye=st,ps=1;class fs{constructor(e,t){this.hooks=e,this.session=Kt(1e3)+"/"+xs(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 L.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 i=0;i<t.length;i++)this.onEvent(t[i]);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=bs(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=L.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 bs(r,e){var t=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(r);return t[1]+e+t[3]}function Kt(r){return L.randomInt(r)}function xs(r){for(var e=[],t=0;t<r;t++)e.push(Kt(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=L.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()}},Ss=ks,Ns={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(Ss,r,e)},createRequest(r,e,t){return new hs(r,e,t)}},Zt=Ns;Zt.createXDR=function(r,e){return this.createRequest(ds,r,e)};var Cs=Zt,Ts={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:h,DependenciesReceivers:p,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():C.load("json2",{},e)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:ee,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)}},L=Ts,it;(function(r){r[r.ERROR=3]="ERROR",r[r.INFO=6]="INFO",r[r.DEBUG=7]="DEBUG"})(it||(it={}));var Ue=it;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(Q({},t,{timestamp:$.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(e){this.log(Ue.ERROR,e)}info(e){this.log(Ue.INFO,e)}debug(e){this.log(Ue.DEBUG,e)}isEmpty(){return this.events.length===0}send(e,t){var s=Q({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,(i,f)=>{i||this.sent++,t&&t(i,f)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class As{constructor(e,t,s,i){this.name=e,this.priority=t,this.transport=s,this.options=i||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(e,t){if(this.isSupported()){if(this.priority<e)return Qt(new P,t)}else return Qt(new J,t);var s=!1,i=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),f=null,v=function(){i.unbind("initialized",v),i.connect()},N=function(){f=de.createHandshake(i,function(Z){s=!0,U(),t(null,Z)})},R=function(Z){U(),t(Z)},D=function(){U();var Z;Z=Me(i),t(new y(Z))},U=function(){i.unbind("initialized",v),i.unbind("open",N),i.unbind("error",R),i.unbind("closed",D)};return i.bind("initialized",v),i.bind("open",N),i.bind("error",R),i.bind("closed",D),i.initialize(),{abort:()=>{s||(U(),f?f.close():i.close())},forceMinPriority:Z=>{s||this.priority<Z&&(f?f.close():i.close())}}}}function Qt(r,e){return $.defer(function(){e(r)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Es}=L;var Rs=function(r,e,t,s,i,f){var v=Es[t];if(!v)throw new B(t);var N=(!r.enabledTransports||le(r.enabledTransports,e)!==-1)&&(!r.disabledTransports||le(r.disabledTransports,e)===-1),R;return N?(i=Object.assign({ignoreNullOrigin:r.ignoreNullOrigin},i),R=new As(e,s,f?f.getAssistant(v):v,i)):R=Ls,R},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&&W.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 i=e.paramsProvider();for(var s in i)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(i[s])}return t};var Ms=r=>{if(typeof L.getAuthorizers()[r.transport]>"u")throw`'${r.transport}' is not a recognized auth transport`;return(e,t)=>{const s=Os(e,r);L.getAuthorizers()[r.transport](L,s,r,j.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 i=e.paramsProvider();for(var s in i)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(i[s])}return t};var Ds=r=>{if(typeof L.getAuthorizers()[r.transport]>"u")throw`'${r.transport}' is not a recognized auth transport`;return(e,t)=>{const s=zs(e,r);L.getAuthorizers()[r.transport](L,s,r,j.ChannelAuthorization,t)}};const Us=(r,e,t)=>{const s={authTransport:e.transport,authEndpoint:e.endpoint,auth:{params:e.params,headers:e.headers}};return(i,f)=>{const v=r.channel(i.channelName);t(v,s).authorize(i.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 L.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 ce{constructor(e){super(function(t,s){W.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 $s(){let r,e;return{promise:new Promise((s,i)=>{r=s,e=i}),resolve:r,reject:e}}var Ks=$s;class Zs extends ce{constructor(e){super(function(t,s){W.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){W.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{W.error(`Failed parsing user data after signin: ${e.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){W.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 Qe(`#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}=Ks();e.done=!1;const s=()=>{e.done=!0};e.then(s).catch(s),this.signinDonePromise=e,this._signinDoneResolve=t}}class te{static ready(){te.isReady=!0;for(var e=0,t=te.instances.length;e<t;e++)te.instances[e].connect()}static getClientFeatures(){return Oe(Ht({ws:L.Transports.ws},function(e){return e.isSupported({})}))}constructor(e,t){Qs(e),Is(t),this.key=e,this.config=Hs(t,this),this.channels=de.createChannels(),this.global_emitter=new ce,this.sessionID=L.randomInt(1e9),this.timeline=new Ps(this.key,this.sessionID,{cluster:this.config.cluster,features:te.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Ue.INFO,version:w.VERSION}),this.config.enableStats&&(this.timelineSender=de.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+L.TimelineTransport.name}));var s=i=>L.getDefaultStrategy(this.config,i,Rs);this.connection=de.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",i=>{var f=i.event,v=f.indexOf("pusher_internal:")===0;if(i.channel){var N=this.channel(i.channel);N&&N.handleEvent(i)}v||this.global_emitter.emit(i.event,i.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",i=>{W.warn(i)}),te.instances.push(this),this.timeline.info({instances:te.instances.length}),this.user=new Zs(this),te.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 V(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()}}te.instances=[],te.isReady=!1,te.logToConsole=!1,te.Runtime=L,te.ScriptReceivers=L.ScriptReceivers,te.DependenciesReceivers=L.DependenciesReceivers,te.auth_callbacks=L.auth_callbacks;var at=o.default=te;function Qs(r){if(r==null)throw"You must pass your app key when you instantiate Pusher."}L.setup(te)}])})})(xt);var _r=xt.exports;const kr=ct(_r);function vt(a,d,c,o,l){const[u,h]=M.useState(null),[b,w]=M.useState(null),[O,p]=M.useState(!0),[C,k]=M.useState(null),S=M.useCallback(async()=>{try{p(!0);const P=c!=="all"?`&segment=${c}`:"",y=`&trafficType=${o}`;let A=`${a.endpoint}/stats?`;d==="custom"&&(l!=null&&l.start)&&(l!=null&&l.end)?A+=`startDate=${l.start}&endDate=${l.end}${P}${y}`:A+=`timeframe=${d}${P}${y}`;const B=await fetch(A,{headers:{"x-tenant-key":a.apiKey,"x-tenant-secret":a.adminSecret,"Cache-Control":"no-cache"}});if(B.ok){const J=await B.json();h(J),k(null)}else throw new Error("Failed to fetch stats")}catch(P){k(P.message)}finally{p(!1)}},[a.endpoint,a.apiKey,a.adminSecret,d,c,o,l]),T=M.useCallback(async()=>{try{const P=c!=="all"?`&segment=${c}`:"",y=`&trafficType=${o}`;let A=l==null?void 0:l.start,B=l==null?void 0:l.end;if(!A||!B){const H=new Date,G=new Date;d==="7d"?G.setDate(H.getDate()-7):d==="30d"?G.setDate(H.getDate()-30):G.setHours(H.getHours()-24),A=G.toISOString().split("T")[0],B=H.toISOString().split("T")[0]}const J=await fetch(`${a.endpoint}/funnel?startDate=${A}&endDate=${B}${P}${y}`,{headers:{"x-tenant-key":a.apiKey,"x-tenant-secret":a.adminSecret,"Cache-Control":"no-cache"}});if(J.ok){const H=await J.json();w(H)}}catch(P){console.error("[Dashboard] funnel fetch error:",P)}},[a.endpoint,a.apiKey,a.adminSecret,d,c,o,l]),j=M.useRef(0),m=M.useRef(null),x=M.useCallback(()=>{S(),T()},[S,T]),_=M.useCallback(()=>{m.current&&clearTimeout(m.current);const P=Date.now(),y=P-j.current;y>2e3?(x(),j.current=P):m.current=setTimeout(()=>{x(),j.current=Date.now()},2e3-y)},[x]);return M.useEffect(()=>{if(S(),T(),a.realtimeEnabled){const P=new kr(a.soketiKey||"infrabricks_key",{wsHost:a.soketiHost||"127.0.0.1",wsPort:a.soketiPort||443,forceTLS:a.soketiUseTLS!==!1,enabledTransports:["ws","wss"],cluster:"mt1"}),y=`analytics-${a.apiKey}`,A=P.subscribe(y);return A.bind("new-session",_),A.bind("new-pageview",_),A.bind("new-event",_),A.bind("heartbeat",_),A.bind("session-offline",_),()=>{P.unsubscribe(y),P.disconnect()}}},[S,T,_,a.realtimeEnabled,a.soketiHost,a.soketiKey,a.soketiPort,a.soketiUseTLS,a.apiKey]),M.useEffect(()=>{const P=setInterval(x,a.refreshInterval||6e4);return()=>clearInterval(P)},[x,a.refreshInterval]),{stats:u,funnel:b,loading:O,error:C,refresh:S}}function wt(a){var d,c,o="";if(typeof a=="string"||typeof a=="number")o+=a;else if(typeof a=="object")if(Array.isArray(a)){var l=a.length;for(d=0;d<l;d++)a[d]&&(c=wt(a[d]))&&(o&&(o+=" "),o+=c)}else for(c in a)a[c]&&(o&&(o+=" "),o+=c);return o}function Sr(){for(var a,d,c=0,o="",l=arguments.length;c<l;c++)(a=arguments[c])&&(d=wt(a))&&(o&&(o+=" "),o+=d);return o}const qe="-",Nr=a=>{const d=Tr(a),{conflictingClassGroups:c,conflictingClassGroupModifiers:o}=a;return{getClassGroupId:h=>{const b=h.split(qe);return b[0]===""&&b.length!==1&&b.shift(),yt(b,d)||Cr(h)},getConflictingClassGroupIds:(h,b)=>{const w=c[h]||[];return b&&o[h]?[...w,...o[h]]:w}}},yt=(a,d)=>{var h;if(a.length===0)return d.classGroupId;const c=a[0],o=d.nextPart.get(c),l=o?yt(a.slice(1),o):void 0;if(l)return l;if(d.validators.length===0)return;const u=a.join(qe);return(h=d.validators.find(({validator:b})=>b(u)))==null?void 0:h.classGroupId},jt=/^\[(.+)\]$/,Cr=a=>{if(jt.test(a)){const d=jt.exec(a)[1],c=d==null?void 0:d.substring(0,d.indexOf(":"));if(c)return"arbitrary.."+c}},Tr=a=>{const{theme:d,prefix:c}=a,o={nextPart:new Map,validators:[]};return Ar(Object.entries(a.classGroups),c).forEach(([u,h])=>{We(h,o,u,d)}),o},We=(a,d,c,o)=>{a.forEach(l=>{if(typeof l=="string"){const u=l===""?d:_t(d,l);u.classGroupId=c;return}if(typeof l=="function"){if(Pr(l)){We(l(o),d,c,o);return}d.validators.push({validator:l,classGroupId:c});return}Object.entries(l).forEach(([u,h])=>{We(h,_t(d,u),c,o)})})},_t=(a,d)=>{let c=a;return d.split(qe).forEach(o=>{c.nextPart.has(o)||c.nextPart.set(o,{nextPart:new Map,validators:[]}),c=c.nextPart.get(o)}),c},Pr=a=>a.isThemeGetter,Ar=(a,d)=>d?a.map(([c,o])=>{const l=o.map(u=>typeof u=="string"?d+u:typeof u=="object"?Object.fromEntries(Object.entries(u).map(([h,b])=>[d+h,b])):u);return[c,l]}):a,Er=a=>{if(a<1)return{get:()=>{},set:()=>{}};let d=0,c=new Map,o=new Map;const l=(u,h)=>{c.set(u,h),d++,d>a&&(d=0,o=c,c=new Map)};return{get(u){let h=c.get(u);if(h!==void 0)return h;if((h=o.get(u))!==void 0)return l(u,h),h},set(u,h){c.has(u)?c.set(u,h):l(u,h)}}},kt="!",Rr=a=>{const{separator:d,experimentalParseClassName:c}=a,o=d.length===1,l=d[0],u=d.length,h=b=>{const w=[];let O=0,p=0,C;for(let m=0;m<b.length;m++){let x=b[m];if(O===0){if(x===l&&(o||b.slice(m,m+u)===d)){w.push(b.slice(p,m)),p=m+u;continue}if(x==="/"){C=m;continue}}x==="["?O++:x==="]"&&O--}const k=w.length===0?b:b.substring(p),S=k.startsWith(kt),T=S?k.substring(1):k,j=C&&C>p?C-p:void 0;return{modifiers:w,hasImportantModifier:S,baseClassName:T,maybePostfixModifierPosition:j}};return c?b=>c({className:b,parseClassName:h}):h},Lr=a=>{if(a.length<=1)return a;const d=[];let c=[];return a.forEach(o=>{o[0]==="["?(d.push(...c.sort(),o),c=[]):c.push(o)}),d.push(...c.sort()),d},Ir=a=>({cache:Er(a.cacheSize),parseClassName:Rr(a),...Nr(a)}),Or=/\s+/,Mr=(a,d)=>{const{parseClassName:c,getClassGroupId:o,getConflictingClassGroupIds:l}=d,u=[],h=a.trim().split(Or);let b="";for(let w=h.length-1;w>=0;w-=1){const O=h[w],{modifiers:p,hasImportantModifier:C,baseClassName:k,maybePostfixModifierPosition:S}=c(O);let T=!!S,j=o(T?k.substring(0,S):k);if(!j){if(!T){b=O+(b.length>0?" "+b:b);continue}if(j=o(k),!j){b=O+(b.length>0?" "+b:b);continue}T=!1}const m=Lr(p).join(":"),x=C?m+kt:m,_=x+j;if(u.includes(_))continue;u.push(_);const P=l(j,T);for(let y=0;y<P.length;++y){const A=P[y];u.push(x+A)}b=O+(b.length>0?" "+b:b)}return b};function zr(){let a=0,d,c,o="";for(;a<arguments.length;)(d=arguments[a++])&&(c=St(d))&&(o&&(o+=" "),o+=c);return o}const St=a=>{if(typeof a=="string")return a;let d,c="";for(let o=0;o<a.length;o++)a[o]&&(d=St(a[o]))&&(c&&(c+=" "),c+=d);return c};function Dr(a,...d){let c,o,l,u=h;function h(w){const O=d.reduce((p,C)=>C(p),a());return c=Ir(O),o=c.cache.get,l=c.cache.set,u=b,b(w)}function b(w){const O=o(w);if(O)return O;const p=Mr(w,c);return l(w,p),p}return function(){return u(zr.apply(null,arguments))}}const F=a=>{const d=c=>c[a]||[];return d.isThemeGetter=!0,d},Nt=/^\[(?:([a-z-]+):)?(.+)\]$/i,Ur=/^\d+\/\d+$/,Hr=new Set(["px","full","screen"]),Br=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fr=/\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$/,Gr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Vr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ae=a=>je(a)||Hr.has(a)||Ur.test(a),ue=a=>_e(a,"length",Qr),je=a=>!!a&&!Number.isNaN(Number(a)),Je=a=>_e(a,"number",je),Te=a=>!!a&&Number.isInteger(Number(a)),Wr=a=>a.endsWith("%")&&je(a.slice(0,-1)),I=a=>Nt.test(a),he=a=>Br.test(a),Jr=new Set(["length","size","percentage"]),Xr=a=>_e(a,Jr,Ct),Yr=a=>_e(a,"position",Ct),$r=new Set(["image","url"]),Kr=a=>_e(a,$r,tn),Zr=a=>_e(a,"",en),Pe=()=>!0,_e=(a,d,c)=>{const o=Nt.exec(a);return o?o[1]?typeof d=="string"?o[1]===d:d.has(o[1]):c(o[2]):!1},Qr=a=>Fr.test(a)&&!Gr.test(a),Ct=()=>!1,en=a=>Vr.test(a),tn=a=>qr.test(a),rn=Dr(()=>{const a=F("colors"),d=F("spacing"),c=F("blur"),o=F("brightness"),l=F("borderColor"),u=F("borderRadius"),h=F("borderSpacing"),b=F("borderWidth"),w=F("contrast"),O=F("grayscale"),p=F("hueRotate"),C=F("invert"),k=F("gap"),S=F("gradientColorStops"),T=F("gradientColorStopPositions"),j=F("inset"),m=F("margin"),x=F("opacity"),_=F("padding"),P=F("saturate"),y=F("scale"),A=F("sepia"),B=F("skew"),J=F("space"),H=F("translate"),G=()=>["auto","contain","none"],ee=()=>["auto","hidden","clip","visible","scroll"],ge=()=>["auto",I,d],z=()=>[I,d],ie=()=>["",ae,ue],pe=()=>["auto",je,I],fe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],oe=()=>["solid","dashed","dotted","double","none"],be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>["start","end","center","between","around","evenly","stretch"],se=()=>["","0",I],xe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],g=()=>[je,I];return{cacheSize:500,separator:":",theme:{colors:[Pe],spacing:[ae,ue],blur:["none","",he,I],brightness:g(),borderColor:[a],borderRadius:["none","","full",he,I],borderSpacing:z(),borderWidth:ie(),contrast:g(),grayscale:se(),hueRotate:g(),invert:se(),gap:z(),gradientColorStops:[a],gradientColorStopPositions:[Wr,ue],inset:ge(),margin:ge(),opacity:g(),padding:z(),saturate:g(),scale:g(),sepia:se(),skew:g(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",I]}],container:["container"],columns:[{columns:[he]}],"break-after":[{"break-after":xe()}],"break-before":[{"break-before":xe()}],"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:[...fe(),I]}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:G()}],"overscroll-x":[{"overscroll-x":G()}],"overscroll-y":[{"overscroll-y":G()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Te,I]}],basis:[{basis:ge()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",I]}],grow:[{grow:se()}],shrink:[{shrink:se()}],order:[{order:["first","last","none",Te,I]}],"grid-cols":[{"grid-cols":[Pe]}],"col-start-end":[{col:["auto",{span:["full",Te,I]},I]}],"col-start":[{"col-start":pe()}],"col-end":[{"col-end":pe()}],"grid-rows":[{"grid-rows":[Pe]}],"row-start-end":[{row:["auto",{span:[Te,I]},I]}],"row-start":[{"row-start":pe()}],"row-end":[{"row-end":pe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",I]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",I]}],gap:[{gap:[k]}],"gap-x":[{"gap-x":[k]}],"gap-y":[{"gap-y":[k]}],"justify-content":[{justify:["normal",...me()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...me(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...me(),"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",I,d]}],"min-w":[{"min-w":[I,d,"min","max","fit"]}],"max-w":[{"max-w":[I,d,"none","full","min","max","fit","prose",{screen:[he]},he]}],h:[{h:[I,d,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[I,d,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[I,d,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[I,d,"auto","min","max","fit"]}],"font-size":[{text:["base",he,ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Je]}],"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",I]}],"line-clamp":[{"line-clamp":["none",je,Je]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ae,I]}],"list-image":[{"list-image":["none",I]}],"list-style-type":[{list:["none","disc","decimal",I]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[a]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[a]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ae,ue]}],"underline-offset":[{"underline-offset":["auto",ae,I]}],"text-decoration-color":[{decoration:[a]}],"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",I]}],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",I]}],"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:[...fe(),Yr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Xr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Kr]}],"bg-color":[{bg:[a]}],"gradient-from-pos":[{from:[T]}],"gradient-via-pos":[{via:[T]}],"gradient-to-pos":[{to:[T]}],"gradient-from":[{from:[S]}],"gradient-via":[{via:[S]}],"gradient-to":[{to:[S]}],rounded:[{rounded:[u]}],"rounded-s":[{"rounded-s":[u]}],"rounded-e":[{"rounded-e":[u]}],"rounded-t":[{"rounded-t":[u]}],"rounded-r":[{"rounded-r":[u]}],"rounded-b":[{"rounded-b":[u]}],"rounded-l":[{"rounded-l":[u]}],"rounded-ss":[{"rounded-ss":[u]}],"rounded-se":[{"rounded-se":[u]}],"rounded-ee":[{"rounded-ee":[u]}],"rounded-es":[{"rounded-es":[u]}],"rounded-tl":[{"rounded-tl":[u]}],"rounded-tr":[{"rounded-tr":[u]}],"rounded-br":[{"rounded-br":[u]}],"rounded-bl":[{"rounded-bl":[u]}],"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:[...oe(),"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:oe()}],"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:["",...oe()]}],"outline-offset":[{"outline-offset":[ae,I]}],"outline-w":[{outline:[ae,ue]}],"outline-color":[{outline:[a]}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[a]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[ae,ue]}],"ring-offset-color":[{"ring-offset":[a]}],shadow:[{shadow:["","inner","none",he,Zr]}],"shadow-color":[{shadow:[Pe]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...be(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":be()}],filter:[{filter:["","none"]}],blur:[{blur:[c]}],brightness:[{brightness:[o]}],contrast:[{contrast:[w]}],"drop-shadow":[{"drop-shadow":["","none",he,I]}],grayscale:[{grayscale:[O]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[C]}],saturate:[{saturate:[P]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[c]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[w]}],"backdrop-grayscale":[{"backdrop-grayscale":[O]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[C]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[P]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[h]}],"border-spacing-x":[{"border-spacing-x":[h]}],"border-spacing-y":[{"border-spacing-y":[h]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",I]}],duration:[{duration:g()}],ease:[{ease:["linear","in","out","in-out",I]}],delay:[{delay:g()}],animate:[{animate:["none","spin","ping","pulse","bounce",I]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[Te,I]}],"translate-x":[{"translate-x":[H]}],"translate-y":[{"translate-y":[H]}],"skew-x":[{"skew-x":[B]}],"skew-y":[{"skew-y":[B]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",I]}],accent:[{accent:["auto",a]}],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",I]}],"caret-color":[{caret:[a]}],"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",I]}],fill:[{fill:[a,"none"]}],"stroke-w":[{stroke:[ae,ue,Je]}],stroke:[{stroke:[a,"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:"🏴󠁧󠁢󠁷󠁬󠁳󠁿"},Ie=(a,d)=>!a&&!d?"🌐":d&&d.length===2?d.toUpperCase().split("").map(c=>String.fromCodePoint(c.charCodeAt(0)+127397)).join(""):a&&Tt[a]||"🌐",nn=a=>new Intl.NumberFormat().format(a),Xe=a=>{const d=new Date,c=new Date(a),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=a=>{const d=new Date(a),c=d.getDate(),o=d.toLocaleString("en-US",{month:"long"}),l=d.toLocaleString("en-US",{weekday:"long"});return d.getFullYear(),`${l} ${c}${(h=>{if(h>3&&h<21)return"th";switch(h%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}})(c)}, ${o}`};function ne(...a){return rn(Sr(a))}function ke({label:a,value:d,icon:c,color:o,pulse:l}){const u={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",u[o]),children:c}),n.jsx("p",{className:"text-slate-400 text-sm font-medium mb-1",children:a}),n.jsx("p",{className:"text-3xl font-bold text-white tracking-tight",children:d})]})}function At({stats:a}){var l,u;const d=((l=a==null?void 0:a.summary)==null?void 0:l.realtimeActivity)||Array(30).fill(0),c=((u=a==null?void 0:a.summary)==null?void 0:u.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(Le,{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((h,b)=>{const w=h/o*100,O=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:[h," views • ",d.length-1-b,"m ago"]}),O.length>0&&n.jsxs("div",{className:"space-y-0.5 border-t border-white/10 pt-1.5 mt-1",children:[O.slice(0,3).map((p,C)=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-sm",children:Ie(p.country,p.countryCode)}),n.jsx("span",{className:"text-slate-300 truncate max-w-[80px]",children:p.city||p.country}),n.jsxs("span",{className:"text-slate-500 ml-auto",children:["(",p.count,")"]})]},C)),O.length>3&&n.jsxs("div",{className:"text-slate-500 text-[9px]",children:["+",O.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:a,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:[a.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)),a.length===0&&n.jsx("p",{className:"text-center text-slate-500 py-8 italic",children:"No page view data yet."})]})]})}function Rt({geo:a,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:a.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:Ie(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))})]}),a.length===0&&n.jsx("p",{className:"text-center text-slate-500 py-12 italic",children:"Waiting for more traffic data..."})]})]})}function Lt({sources:a,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(Le,{className:"w-5 h-5 text-orange-400"}),"Traffic Sources (UTM)"]}),n.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[a.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)),a.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:a}){var c;if(!a.pageViews&&!a.events)return null;const d=[...(a.pageViews||[]).map(o=>({...o,type:"page_view"})),...(a.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(pt,{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:a.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(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:"OS & Screen"}),n.jsxs("p",{className:"text-white text-xs font-medium",children:[a.os||"Unknown",a.screenWidth&&` (${a.screenWidth}x${a.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(xr,{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:a.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:a.org||a.isp,children:a.org||a.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 u;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,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
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(gt,{className:"w-3 h-3 text-white"}):n.jsx(Fe,{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:((u=o.name)==null?void 0:u.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(([h,b])=>h!=="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:[h,":"]}),typeof b=="object"?JSON.stringify(b):String(b)]},h))})]})]},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(wr,{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(a.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:a}){const[d,c]=M.useState(null),[,o]=M.useState(0);return M.useEffect(()=>{const l=setInterval(()=>o(u=>u+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(Ve,{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:a.slice(0,7).map(l=>{var w;const u=new Date(l.lastActive||l.createdAt).getTime(),h=l.isOnline&&Date.now()-u<3e4,b=d===l.id;return n.jsxs(M.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:h&&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:Ie(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:Xe(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 sn({events:a}){return!a||a.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(Fe,{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:a.slice(0,7).map(d=>{var l,u,h;let c=Fe,o="text-slate-400 bg-slate-500/10";return d.category==="auth"?(c=yr,o="text-purple-400 bg-purple-500/10"):d.category==="investment"?(c=Le,o="text-brand-gold bg-brand-gold/10"):d.category==="wallet"&&(c=jr,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:Xe(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:((u=d.user)==null?void 0:u.name)||"Anonymous User"}),((h=d.user)==null?void 0:h.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 Mt({funnel:a}){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(bt,{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:[a.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:a.steps.map((d,c)=>{const o=a.steps[0].count||1,l=Math.max(d.count/o*100,8),u=a.steps[c+1],h=u?d.count-u.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===a.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,"%"]})})}),u&&h>0&&n.jsxs("div",{className:"flex items-center justify-center text-[10px] text-red-400 py-1",children:[n.jsx(bt,{className:"w-3 h-3 mr-1"}),h.toLocaleString()," dropped (",100-u.rate,"% loss)"]})]},d.name)})})]})}function an({config:a,className:d}){var T,j,m,x,_,P;const[c,o]=M.useState("24h"),[l,u]=M.useState("front"),[h,b]=M.useState("users"),[w,O]=M.useState({start:"",end:""}),{stats:p,funnel:C,loading:k,error:S}=vt(a,c,l,h,c==="custom"?w:void 0);return!p&&k?n.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px]",children:[n.jsx(ft,{className:"w-10 h-10 animate-spin text-blue-500 mb-4"}),n.jsx("p",{className:"text-slate-400",children:"Loading your analytics data..."})]}):S?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:S})]}):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(y=>n.jsx("button",{onClick:()=>u(y),className:ne("px-4 py-2 rounded-lg text-xs font-bold uppercase tracking-wider transition-all",l===y?"bg-white/10 text-white shadow-lg":"text-slate-500 hover:text-white hover:bg-white/5"),children:y==="all"?"All Pools":y==="front"?"Web":y==="investor"?"Dashboard":"Admin"},y))}),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(y=>n.jsx("button",{onClick:()=>b(y),className:ne("px-4 py-2 rounded-lg text-xs font-bold uppercase tracking-wider transition-all",h===y?y==="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:y==="all"?"All":y==="users"?"Visitors":"Bots"},y))}),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(y=>n.jsx("button",{onClick:()=>o(y),className:ne("px-4 py-2 rounded-lg text-sm font-medium transition-all",c===y?"bg-blue-600 text-white shadow-lg shadow-blue-600/20":"text-slate-400 hover:text-white hover:bg-white/5"),children:y==="custom"?"Custom":y.toUpperCase()},y))})]})]}),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(ht,{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:y=>O(A=>({...A,start:y.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:y=>O(A=>({...A,end:y.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:((T=p==null?void 0:p.summary)==null?void 0:T.activeNow)||0,icon:n.jsx(Ve,{className:"w-5 h-5"}),color:"green",pulse:!0}),n.jsx(ke,{label:"Total Sessions",value:((j=p==null?void 0:p.summary)==null?void 0:j.sessions)||0,icon:n.jsx(gt,{className:"w-5 h-5"}),color:"purple"}),n.jsx(ke,{label:"Unique Visitors",value:((m=p==null?void 0:p.summary)==null?void 0:m.uniqueVisitors)||0,icon:n.jsx(Ve,{className:"w-5 h-5"}),color:"blue"}),n.jsx(ke,{label:"Page Views",value:((x=p==null?void 0:p.summary)==null?void 0:x.pageViews)||0,icon:n.jsx(Le,{className:"w-5 h-5"}),color:"orange"}),n.jsx(ke,{label:"Bounce Rate",value:`${((_=p==null?void 0:p.summary)==null?void 0:_.bounceRate)||0}%`,icon:n.jsx(ht,{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:((P=p==null?void 0:p.summary)==null?void 0:P.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(sn,{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(y=>{var B,J,H;const A=((J=(B=p==null?void 0:p.devices)==null?void 0:B.find(G=>{var ee;return((ee=G.device)==null?void 0:ee.toLowerCase())===y.toLowerCase()}))==null?void 0:J.count)||0;return n.jsx(Ye,{label:y,count:A,total:((H=p==null?void 0:p.summary)==null?void 0:H.sessions)||0},y)})})]}),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(pt,{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(y=>{var A;return n.jsx(Ye,{label:y.browser,count:y.count,total:((A=p==null?void 0:p.summary)==null?void 0:A.sessions)||0},y.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(mt,{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(y=>{var A;return n.jsx(Ye,{label:y.os,count:y.count,total:((A=p==null?void 0:p.summary)==null?void 0:A.sessions)||0},y.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(y=>{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:y.isp,children:y.isp}),n.jsxs("div",{className:"flex justify-between items-center mt-2",children:[n.jsxs("p",{className:"text-slate-500 text-xs",children:[y.count," sessions"]}),n.jsxs("p",{className:"text-blue-400 text-xs font-bold",children:[Math.round(y.count/(((A=p==null?void 0:p.summary)==null?void 0:A.sessions)||1)*100),"%"]})]})]},y.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"})]})]}),C&&n.jsx(Mt,{funnel:C})]})]})}function Ye({label:a,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:a}),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}%`}})})]})}var zt={exports:{}};(function(a){a.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(),u=l.getContext("2d"),h=this._r=c+o;return l.width=l.height=h*2,u.shadowOffsetX=u.shadowOffsetY=h*2,u.shadowBlur=o,u.shadowColor="black",u.beginPath(),u.arc(-h,-h,c,0,Math.PI*2,!0),u.closePath(),u.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"),u=l.createLinearGradient(0,0,0,256);o.width=1,o.height=256;for(var h in c)u.addColorStop(+h,c[h]);return l.fillStyle=u,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,u=this._data.length,h;l<u;l++)h=this._data[l],o.globalAlpha=Math.max(h[2]/this._max,c===void 0?.05:c),o.drawImage(this._circle,h[0]-this._r,h[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,u=c.length,h;l<u;l+=4)h=c[l+3]*4,h&&(c[l]=o[h],c[l+1]=o[h+1],c[l+2]=o[h+2])},_createCanvas:function(){return typeof document<"u"?document.createElement("canvas"):new this._canvas.constructor}}})(zt);var on=zt.exports;const ln=ct(on);function cn({path:a,tenantUrl:d}){var p;const c=M.useRef(null),o=M.useRef(null),[l,u]=M.useState(!0),[h,b]=M.useState(null),[w,O]=M.useState([]);return M.useEffect(()=>{(async()=>{u(!0),b(null);try{const k=await fetch(`/api/v1/heatmap?path=${encodeURIComponent(a)}`,{headers:{"x-tenant-key":localStorage.getItem("ib_v2_api_key")||""}});if(!k.ok)throw new Error("Failed to fetch heatmap data");const S=await k.json();O(S)}catch(k){b(k.message)}finally{u(!1)}})()},[a]),M.useEffect(()=>{var m;if(!c.current||w.length===0||l)return;const C=c.current,k=C.getContext("2d");if(!k)return;k.clearRect(0,0,C.width,C.height);const S=ln(C),T=((m=o.current)==null?void 0:m.offsetWidth)||window.innerWidth,j=w.map(x=>{const _=T/x.width;return[x.x*_,x.y,1]});S.data(j),S.radius(25,15),S.draw()},[w,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.jsx("h2",{className:"text-xl font-bold text-white",children:"Interaction Heatmap"}),n.jsxs("p",{className:"text-slate-500 text-sm",children:["Showing clusters for: ",a]})]}),n.jsxs("div",{className:"bg-slate-800 rounded-lg px-4 py-2 border border-white/5",children:[n.jsx("span",{className:"text-white font-bold",children:w.length}),n.jsx("span",{className:"text-slate-500 text-xs ml-2",children:"Total Interactions"})]})]}),n.jsxs("div",{ref:o,className:"relative bg-slate-900 rounded-3xl border border-white/5 overflow-hidden min-h-[600px]",children:[n.jsx("iframe",{src:`${d}${a}`,className:"absolute inset-0 w-full h-full border-none opacity-50 pointer-events-none",title:"Heatmap Preview"}),n.jsx("canvas",{ref:c,width:((p=o.current)==null?void 0:p.offsetWidth)||1200,height:2e3,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(ft,{className:"w-8 h-8 text-red-500 animate-spin"})}),h&&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(hr,{className:"w-8 h-8 text-red-500"}),n.jsx("p",{className:"text-white font-medium",children:h})]})}),!l&&w.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."})})})]})]})}q.AnalyticsDashboard=an,q.COUNTRY_FLAGS=Tt,q.ConversionFunnel=Mt,q.GeoDistribution=Rt,q.HeatmapVisualizer=cn,q.RealtimeMonitor=At,q.RecentVisitors=Ot,q.SessionTimeline=It,q.StatCard=ke,q.TopPages=Et,q.TrafficSources=Lt,q.cn=ne,q.formatNumber=nn,q.formatRelativeTime=Xe,q.formatVisitorDate=Pt,q.getFlag=Ie,q.useAnalyticsData=vt,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
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"})});